X-Git-Url: http://pere.pagekite.me/gitweb/homepage.git/blobdiff_plain/aa16e3a5d13953016b5f30337644389222b2c86a..c790f2ff4d7b27e3765965d422e5df6e24214d21:/blog/archive/2010/06/index.html diff --git a/blog/archive/2010/06/index.html b/blog/archive/2010/06/index.html index 173698878f..f53b076e69 100644 --- a/blog/archive/2010/06/index.html +++ b/blog/archive/2010/06/index.html @@ -811,6 +811,69 @@ håndheves strengt.

+
+
+ Calling tasksel like the installer, while still getting useful output +
+
+ 2010-06-16 14:55 +
+ +
+ +

A few times I have had the need to simulate the way tasksel +installs packages during the normal debian-installer run. Until now, +I have ended up letting tasksel do the work, with the annoying problem +of not getting any feedback at all when something fails (like a +conffile question from dpkg or a download that fails), using code like +this: + +

+export DEBIAN_FRONTEND=noninteractive
+tasksel --new-install
+
+ +This would invoke tasksel, let its automatic task selection pick the +tasks to install, and continue to install the requested tasks without +any output what so ever. + +Recently I revisited this problem while working on the automatic +package upgrade testing, because tasksel would some times hang without +any useful feedback, and I want to see what is going on when it +happen. Then it occured to me, I can parse the output from tasksel +when asked to run in test mode, and use that aptitude command line +printed by tasksel then to simulate the tasksel run. I ended up using +code like this: + +
+export DEBIAN_FRONTEND=noninteractive
+cmd="$(in_target tasksel -t --new-install | sed 's/debconf-apt-progress -- //')"
+$cmd
+
+ +

The content of $cmd is typically something like "aptitude -q +--without-recommends -o APT::Install-Recommends=no -y install +~t^desktop$ ~t^gnome-desktop$ ~t^laptop$ ~pstandard ~prequired +~pimportant", which will install the gnome desktop task, the +laptop task and all packages with priority standard , required and +important, just like tasksel would have done it during +installation.

+ +

A better approach is probably to extend tasksel to be able to +install packages without using debconf-apt-progress, for use cases +like this.

+ +
+
+ + + + Tags: debian, english, nuug. + +
+
+
+

RSS Feed

@@ -833,7 +896,7 @@ håndheves strengt.

  • May (9)
  • -
  • June (11)
  • +
  • June (12)
  • @@ -890,11 +953,11 @@ hÃ¥ndheves strengt.

  • bootsystem (10)
  • -
  • debian (26)
  • +
  • debian (27)
  • debian edu (26)
  • -
  • english (38)
  • +
  • english (39)
  • fiksgatami (1)
  • @@ -910,7 +973,7 @@ hÃ¥ndheves strengt.

  • norsk (69)
  • -
  • nuug (76)
  • +
  • nuug (77)
  • opphavsrett (13)