Bug#447326: pkgsel: add support for pre-hooks
On Sat, Oct 20, 2007 at 11:31:17AM -0200, Otavio Salvador wrote: > For popcon I'd suggest to use 10popcon script name so people can put > something before it to be called easily. Yes, that makes sense. -- dann frazier -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#447326: pkgsel: add support for pre-hooks
On Sat, Oct 20, 2007 at 07:37:25PM -0400, Joey Hess wrote: > dann frazier wrote: > > This patch adds an /usr/lib/pre-pkgsel.d/ directory where hooks can be > > added in a run-parts fashion. popcon handling has been factored out > > into its own script in this directory. > > > > My main motivation for this patch is that I wanted the ability to > > install a package containing a task definition into /target just > > before tasksel gets executed. > > Couldn't you get the same effect by using apt-install in > pressed/early_command, or in a hook in /usr/lib/base-installer.d? > > Or does this need to happen after apt-setup? Exactly. I use an apt-setup generator to add a repository that includes my custom task package, so this must happen afterwards. In sarge I stored the deb including the task definition in the initrd and installed it w/ a late-command. This obviously doesn't work now that tasksel runs before the late-command. This revised method also avoids the sync problem with the task definition in the initrd and the one on the mirror. > The patch is fine for small hooks, but doesn't advance the progress bar > between hooks as base-installer does, so would be problimatic if any > hooks took long. I haven't messed w/ progress bar stuff much, but I'll look into adding this support. Thanks for the review. -- dann frazier -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#447326: pkgsel: add support for pre-hooks
Joey Hess <[EMAIL PROTECTED]> writes: > The patch is fine for small hooks, but doesn't advance the progress bar > between hooks as base-installer does, so would be problimatic if any > hooks took long. What if we do same thing as finish-install does to support progress on the hooks? Then it would be OK for commiting from your side? -- O T A V I OS A L V A D O R - E-mail: [EMAIL PROTECTED] UIN: 5906116 GNU/Linux User: 239058 GPG ID: 49A5F855 Home Page: http://otavio.ossystems.com.br - "Microsoft sells you Windows ... Linux gives you the whole house." -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#447326: pkgsel: add support for pre-hooks
dann frazier wrote: > This patch adds an /usr/lib/pre-pkgsel.d/ directory where hooks can be > added in a run-parts fashion. popcon handling has been factored out > into its own script in this directory. > > My main motivation for this patch is that I wanted the ability to > install a package containing a task definition into /target just > before tasksel gets executed. Couldn't you get the same effect by using apt-install in pressed/early_command, or in a hook in /usr/lib/base-installer.d? Or does this need to happen after apt-setup? The patch is fine for small hooks, but doesn't advance the progress bar between hooks as base-installer does, so would be problimatic if any hooks took long. -- see shy jo signature.asc Description: Digital signature
Bug#447326: pkgsel: add support for pre-hooks
dann frazier <[EMAIL PROTECTED]> writes: > Package: pkgsel > Version: 0.15 > Severity: wishlist > Tags: patch > > This patch adds an /usr/lib/pre-pkgsel.d/ directory where hooks can be > added in a run-parts fashion. popcon handling has been factored out > into its own script in this directory. I personally like the idea and it's really useful to be added. The only thing I found, that could be improved, is it to use sorting when calling the scripts so you have an expected order respected as it being done on other hooks directories like finish-install.d and like. For popcon I'd suggest to use 10popcon script name so people can put something before it to be called easily. -- O T A V I OS A L V A D O R - E-mail: [EMAIL PROTECTED] UIN: 5906116 GNU/Linux User: 239058 GPG ID: 49A5F855 Home Page: http://otavio.ossystems.com.br - "Microsoft sells you Windows ... Linux gives you the whole house." -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#447326: pkgsel: add support for pre-hooks
Package: pkgsel Version: 0.15 Severity: wishlist Tags: patch This patch adds an /usr/lib/pre-pkgsel.d/ directory where hooks can be added in a run-parts fashion. popcon handling has been factored out into its own script in this directory. My main motivation for this patch is that I wanted the ability to install a package containing a task definition into /target just before tasksel gets executed. -- dann frazier Index: debian/postinst === --- debian/postinst (revision 49834) +++ debian/postinst (working copy) @@ -39,12 +39,20 @@ db_progress STEP 1 -# Install popularity-contest but remove it if the user decides not to -# participate. -if in-target sh -c "$config debconf-apt-progress --from 1 --to 5 --logstderr -- apt-get -o APT::Install-Recommends=false -q -y -f install popularity-contest"; then - if ! grep -q '^PARTICIPATE=\"*yes\"*' /target/etc/popularity-contest.conf; then - in-target dpkg --purge popularity-contest - fi +partsdir="/usr/lib/pre-pkgsel.d" +if [ -d "$partsdir" ]; then +for script in `ls "$partsdir"/*`; do +if [ -x "$script" ] ; then +# be careful to preserve exit code + if log-output -t pkgsel "$script"; then + : +else + warning "$script returned error code $?" + fi +else + error "Unable to execute $script" + fi +done fi db_get pkgsel/include Index: debian/pkgsel.dirs === --- debian/pkgsel.dirs (revision 0) +++ debian/pkgsel.dirs (revision 0) @@ -0,0 +1 @@ +usr/lib/pre-pkgsel.d Index: debian/changelog === --- debian/changelog (revision 49834) +++ debian/changelog (working copy) @@ -1,3 +1,9 @@ +pkgsel (0.16) UNRELEASED; urgency=low + + * Add support for a /usr/lib/pre-pkgsel.d run-parts syle directory + + -- dann frazier <[EMAIL PROTECTED]> Fri, 19 Oct 2007 23:31:05 -0600 + pkgsel (0.15) unstable; urgency=low [ Frans Pop ] Index: debian/rules === --- debian/rules (revision 49834) +++ debian/rules (working copy) @@ -12,6 +12,8 @@ dh_testdir dh_testroot dh_clean -k + dh_installdirs + install -m755 popcon debian/pkgsel/usr/lib/pre-pkgsel.d/ dh_install binary-indep: build install Index: popcon === --- popcon (revision 0) +++ popcon (revision 0) @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +# get debconf-apt-progress config, which will make it run properly later +config=$(chroot /target debconf-apt-progress --config| sed "s/$/;/") + +# Install popularity-contest but remove it if the user decides not to +# participate. +if in-target sh -c "$config debconf-apt-progress --from 1 --to 5 --logstderr -- apt-get -o APT::Install-Recommends=false -q -y -f install popularity-contest"; then + if ! grep -q '^PARTICIPATE=\"*yes\"*' /target/etc/popularity-contest.conf; then + in-target dpkg --purge popularity-contest + fi +fi Property changes on: popcon ___ Name: svn:executable + *