[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: r39721 - in trunk/packages/pkgsel: debian



On Friday 11 August 2006 23:13, Otavio Salvador wrote:
[...]
> +if ! db_fget tasksel/first seen || (! db_get tasksel/first || [ -z 
"$RET" ]); then

Is it absolutely certain that tasksel currently does nothing if no tasks
are selected?

> +       db_progress INFO pkgsel/progress/tasksel
> +       ret=0
> +       in-target sh -c "$config tasksel --new-install 
--debconf-apt-progress='--from $progress_start --to $progress_end 
--logstderr'" || ret=$?
> +
[...]
>         fi
> -       db_progress STOP
> -       exit $ret
> +       progress_start=$progress_end
> +else
> +       progress_end=100

This is incorrect. progress_end should not be set to 100 here as the last
two steps in the script are unconditional and together take 5 units.

>  fi
>  db_get pkgsel/include

If none of the now optional commands have been run, the progress bar will 
still be stuck on 1 after the pkgsel/include step. So, what needs to 
happen after this step is to make the progress bar jump to the current 
value of progress_end.

I have committed the attached additional patch that should fix both issues 
(untested). It also makes the setting of progress_end a bit more 
consistent.
Please check.

Index: debian/postinst
===================================================================
--- debian/postinst	(revision 39722)
+++ debian/postinst	(working copy)
@@ -39,12 +39,11 @@
 config=$(chroot /target debconf-apt-progress --config| sed "s/$/;/")
 
 db_progress STEP 1
-
-# progressbar should start at 1
 progress_start=1
 
 if ! db_get popularity-contest/participate || [ "$RET" != false ]; then
 	progress_end=5
+
 	# Install popularity-contest but remove it if the user decides not to
 	# participate.
 	if in-target sh -c "$config debconf-apt-progress --from $progress_start --to $progress_end --logstderr -- apt-get -q -y -f install popularity-contest"; then
@@ -55,14 +54,14 @@
 	progress_start=$progress_end
 fi
 
-db_get pkgsel/include
-if [ "$RET" ]; then
-	progress_end=90
-else
-	progress_end=95
-fi
+if ! db_fget tasksel/first seen || (! db_get tasksel/first || [ -z "$RET" ]); then
+	db_get pkgsel/include
+	if [ "$RET" ]; then
+		progress_end=90
+	else
+		progress_end=95
+	fi
 
-if ! db_fget tasksel/first seen || (! db_get tasksel/first || [ -z "$RET" ]); then
 	db_progress INFO pkgsel/progress/tasksel
 	ret=0
 	in-target sh -c "$config tasksel --new-install --debconf-apt-progress='--from $progress_start --to $progress_end --logstderr'" || ret=$?
@@ -80,12 +79,12 @@
 		exit $ret
 	fi
 	progress_start=$progress_end
-else
-	progress_end=100
 fi
 
 db_get pkgsel/include
 if [ "$RET" ]; then
+	progress_end=95
+
 	# Allow comma-separation so that this can more easily be preseeded
 	# at the kernel command line.
 	RET="$(printf '%s' "$RET" | sed 's/,/ /g')"
@@ -102,8 +101,13 @@
 		db_progress STOP
 		exit $ret
 	fi
+	progress_start=$progress_end
 fi
 
+if [ $progress_end -gt $progress_start ]; then
+	db_progress STEP $(($progress_end - $progress_start))
+fi
+
 db_progress INFO pkgsel/progress/cleanup
 if ! cleanup; then
 	log "cleanup failed"

Attachment: pgpmEWxouZaJl.pgp
Description: PGP signature


Reply to: