From aa16e3a5d13953016b5f30337644389222b2c86a Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Wed, 16 Jun 2010 12:48:29 +0000 Subject: [PATCH] =?utf8?q?Ny=20oppf=C3=B8ring.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- blog/data/2010-06-16-calling-tasksel.txt | 45 ++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 blog/data/2010-06-16-calling-tasksel.txt diff --git a/blog/data/2010-06-16-calling-tasksel.txt b/blog/data/2010-06-16-calling-tasksel.txt new file mode 100644 index 0000000000..a5d67657a6 --- /dev/null +++ b/blog/data/2010-06-16-calling-tasksel.txt @@ -0,0 +1,45 @@ +Title: Calling tasksel like the installer, while still getting useful output +Tags: english, nuug, debian +Date: 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.

-- 2.47.2