]> pere.pagekite.me Git - homepage.git/commitdiff
Ny oppføring.
authorPetter Reinholdtsen <pere@hungry.com>
Wed, 16 Jun 2010 12:48:29 +0000 (12:48 +0000)
committerPetter Reinholdtsen <pere@hungry.com>
Wed, 16 Jun 2010 12:48:29 +0000 (12:48 +0000)
blog/data/2010-06-16-calling-tasksel.txt [new file with mode: 0644]

diff --git a/blog/data/2010-06-16-calling-tasksel.txt b/blog/data/2010-06-16-calling-tasksel.txt
new file mode 100644 (file)
index 0000000..a5d6765
--- /dev/null
@@ -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
+
+<p>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:
+
+<blockquote><pre>
+export DEBIAN_FRONTEND=noninteractive
+tasksel --new-install
+</pre></blockquote>
+
+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:
+
+<blockquote><pre>
+export DEBIAN_FRONTEND=noninteractive
+cmd="$(in_target tasksel -t --new-install | sed 's/debconf-apt-progress -- //')"
+$cmd
+</pre></blockquote>
+
+<p>The content of $cmd is typically something like "<tt>aptitude -q
+--without-recommends -o APT::Install-Recommends=no -y install
+~t^desktop$ ~t^gnome-desktop$ ~t^laptop$ ~pstandard ~prequired
+~pimportant</tt>", 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.</p>
+
+<p>A better approach is probably to extend tasksel to be able to
+install packages without using debconf-apt-progress, for use cases
+like this.</p>