On Wed, Aug 20, 2008 at 07:41:05AM +0200, Frans Pop wrote: > Attached (tested) patch is what I had in mind (based on similar code in > base-installer). It assigns 1% of the progress bar to each hook script > with a maximum of 10% for all hook scripts. For popcon I've just dropped > the advancement of the progress bar by d-a-p as it's not really worth it > anyway. Both sounds good to me. :) > The patch, even though fairly big, is IMO the least invasive way to fix > the issue while preserving relevant existing functionality. […] Attached you will find a broken down version of your patch (result is identical after applying them all). After breaking it down, the patch do not appear so big and I would be in favour of commiting these changes. Cheers, -- Jérémy Bobbio .''`. lunar@debian.org : :Ⓐ : # apt-get install anarchism `. `'` `-
commit 5dfbe010b93d2eea9df39f16937409e60e35e45e Author: Jérémy Bobbio <lunar@debian.org> Date: Wed Aug 20 14:53:50 2008 +0000 Drop the advancement of the progress bar in pre-pkgsel.d/10popcon (Closes: #492861) diff --git a/packages/pkgsel/debian/changelog b/packages/pkgsel/debian/changelog index 90361c5..a524861 100644 --- a/packages/pkgsel/debian/changelog +++ b/packages/pkgsel/debian/changelog @@ -5,6 +5,8 @@ pkgsel (0.22) UNRELEASED; urgency=low incompatible with the Etch version of aptitude. Closes: #492593. * There is no need to run debconf-apt-progress --config as in-target already sets the correct environment. + * Drop the advancement of the progress bar in pre-pkgsel.d/10popcon. + (Closes: #492861) [ Jérémy Bobbio ] * Add missing warning() definition in postinst script. diff --git a/packages/pkgsel/pre-pkgsel.d/10popcon b/packages/pkgsel/pre-pkgsel.d/10popcon index fbee737..1110a06 100755 --- a/packages/pkgsel/pre-pkgsel.d/10popcon +++ b/packages/pkgsel/pre-pkgsel.d/10popcon @@ -4,7 +4,7 @@ set -e # Install popularity-contest but remove it if the user decides not to # participate. -if in-target sh -c "debconf-apt-progress --from 1 --to 5 --logstderr -- apt-get -o APT::Install-Recommends=false -q -y -f install popularity-contest"; then +if in-target sh -c "debconf-apt-progress --no-progress --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 commit 5308acf67887a1d23426564b4a4acf33b0fd0a07 Author: Jérémy Bobbio <lunar@debian.org> Date: Wed Aug 20 14:40:33 2008 +0000 Fix style in pkgsel postinst diff --git a/packages/pkgsel/debian/postinst b/packages/pkgsel/debian/postinst index 4a90f14..76926a0 100755 --- a/packages/pkgsel/debian/postinst +++ b/packages/pkgsel/debian/postinst @@ -15,7 +15,7 @@ warning() { log "warning: $@" } -cleanup () { +cleanup() { for divert in $DIVERTS; do rm -f "/target$divert" log-output -t pkgsel chroot /target dpkg-divert \ @@ -23,7 +23,7 @@ cleanup () { done } -aptfailed () { +aptfailed() { ret=$? if [ "$ret" != 0 ]; then # In case packages failed to install, try to clean up. @@ -92,13 +92,13 @@ fi partsdir="/usr/lib/pre-pkgsel.d" if [ -d "$partsdir" ]; then - for script in `ls "$partsdir"/* 2>/dev/null`; do + for script in $(ls "$partsdir"/* 2>/dev/null); do base=$(basename $script | sed 's/[0-9]*//') if ! db_progress INFO pkgsel/progress/$base; then db_subst pkgsel/progress/fallback SCRIPT "$base" db_progress INFO pkgsel/progress/fallback fi - if [ -x "$script" ] ; then + if [ -x "$script" ]; then # be careful to preserve exit code if log-output -t pkgsel "$script"; then : commit 439b9236cda2cd821c2dd89a7a69f2be5ebacae1 Author: Jérémy Bobbio <lunar@debian.org> Date: Wed Aug 20 14:45:52 2008 +0000 Multiply progress steps by 10 in pkgsel postinst This will make room for stepping the progress bar when running pre-pkgsel.d scripts. diff --git a/packages/pkgsel/debian/changelog b/packages/pkgsel/debian/changelog index a524861..9dd94cd 100644 --- a/packages/pkgsel/debian/changelog +++ b/packages/pkgsel/debian/changelog @@ -7,6 +7,7 @@ pkgsel (0.22) UNRELEASED; urgency=low sets the correct environment. * Drop the advancement of the progress bar in pre-pkgsel.d/10popcon. (Closes: #492861) + * Multiply progress steps by 10 in postinst script. [ Jérémy Bobbio ] * Add missing warning() definition in postinst script. diff --git a/packages/pkgsel/debian/postinst b/packages/pkgsel/debian/postinst index 76926a0..f56164a 100755 --- a/packages/pkgsel/debian/postinst +++ b/packages/pkgsel/debian/postinst @@ -46,7 +46,7 @@ load_install_cd() { fi } -db_progress START 0 100 debian-installer/pkgsel/title +db_progress START 0 1000 debian-installer/pkgsel/title db_progress INFO pkgsel/progress/init # d-i debconf variables used by packages @@ -61,7 +61,7 @@ for divert in $DIVERTS; do ln -sf /bin/true "/target$divert" done -db_progress STEP 1 +db_progress STEP 10 # Unmount the installation CD to allow CD changing; as it may be needed # again after pkgsel, make sure it is reloaded before exiting @@ -80,14 +80,14 @@ suite=$RET db_get pkgsel/upgrade if [ "$RET" = none ] || [ "$suite" = etch ]; then - tasksel_start=5 + tasksel_start=50 else upgrade_type="$RET" db_progress INFO pkgsel/progress/upgrade sleep 2 # allow the message to be seen - in-target sh -c "debconf-apt-progress --from 5 --to 10 --logstderr -- aptitude -q --without-recommends -y -o DPkg::options=--force-confnew '$upgrade_type'" || aptfailed - tasksel_start=10 + in-target sh -c "debconf-apt-progress --from 50 --to 100 --logstderr -- aptitude -q --without-recommends -y -o DPkg::options=--force-confnew '$upgrade_type'" || aptfailed + tasksel_start=100 fi partsdir="/usr/lib/pre-pkgsel.d" @@ -113,9 +113,9 @@ fi db_get pkgsel/include if [ "$RET" ]; then - tasksel_end=90 + tasksel_end=900 else - tasksel_end=95 + tasksel_end=950 fi db_progress INFO pkgsel/progress/tasksel @@ -126,7 +126,7 @@ if [ "$RET" ]; then # Allow comma-separation so that this can more easily be preseeded # at the kernel command line. RET="$(printf '%s' "$RET" | sed 's/,/ /g')" - in-target sh -c "debconf-apt-progress --from 90 --to 95 --logstderr -- aptitude -q --without-recommends -y install -- $RET" || aptfailed + in-target sh -c "debconf-apt-progress --from 900 --to 950 --logstderr -- aptitude -q --without-recommends -y install -- $RET" || aptfailed fi db_progress INFO pkgsel/progress/cleanup @@ -134,7 +134,7 @@ if ! cleanup; then log "cleanup failed" fi -db_progress STEP 2 +db_progress STEP 20 if [ -x /target/usr/bin/scrollkeeper-update ]; then log-output -t pkgsel chroot /target scrollkeeper-update -q || true @@ -144,7 +144,7 @@ if [ -x /target/usr/bin/fc-cache ]; then || true fi -db_progress STEP 3 +db_progress STEP 30 db_progress STOP load_install_cd commit 21f53b1a904c065f1b5eda3c31c2e7ff5d9b48d3 Author: Jérémy Bobbio <lunar@debian.org> Date: Wed Aug 20 14:50:07 2008 +0000 Advance progress bar when running pre-pkgsel.d scripts diff --git a/packages/pkgsel/debian/changelog b/packages/pkgsel/debian/changelog index 9dd94cd..3c31606 100644 --- a/packages/pkgsel/debian/changelog +++ b/packages/pkgsel/debian/changelog @@ -8,6 +8,7 @@ pkgsel (0.22) UNRELEASED; urgency=low * Drop the advancement of the progress bar in pre-pkgsel.d/10popcon. (Closes: #492861) * Multiply progress steps by 10 in postinst script. + * Advance progress bar when running pre-pkgsel.d scripts. [ Jérémy Bobbio ] * Add missing warning() definition in postinst script. diff --git a/packages/pkgsel/debian/postinst b/packages/pkgsel/debian/postinst index f56164a..ff7b6af 100755 --- a/packages/pkgsel/debian/postinst +++ b/packages/pkgsel/debian/postinst @@ -92,6 +92,16 @@ fi partsdir="/usr/lib/pre-pkgsel.d" if [ -d "$partsdir" ]; then + scriptcount=$(ls "$partsdir"/* 2>/dev/null | wc -l) + if [ $scriptcount -lt 10 ]; then + scripts_range=$(($scriptcount * 10)) + else + scripts_range=100 + fi + scripts_start=$tasksel_start + tasksel_start=$(($scripts_start + $scripts_range)) + + scriptcur=0 for script in $(ls "$partsdir"/* 2>/dev/null); do base=$(basename $script | sed 's/[0-9]*//') if ! db_progress INFO pkgsel/progress/$base; then @@ -108,6 +118,10 @@ if [ -d "$partsdir" ]; then else error "Unable to execute $script" fi + + # Advance progress bar + scriptcur=$(($scriptcur + 1)) + db_progress SET $(($scripts_start + $scripts_range * $scriptcur / $scriptcount)) done fi
Attachment:
signature.asc
Description: Digital signature