While testing Etch installs using the Lenny installer, Phil Hands noticed
that D-I complained about missing --dlwaypoint option when calling
debconf-apt-progress.
This is logical as the Etch version does not include that while we do make
use of it in Lenny D-I for an improved progress bar experience ;-)
So, a number of changes in debconf should be backported to Etch. AFAICT this
can be limited to changes in debconf-apt-progress. One change that is not
strictly needed is the support for progress bar cancellation.
The attached patch series is what IMO should be backported. It includes the
following commits (this is on top of the patch that was already backported
in the 1.5.11etch1 release):
* debconf-apt-progress: Add --no-progress option intended to be used
by apt-install in d-i.
* debconf-apt-progress: Notice if the child exited abnormally, and exit
nonzero.
* add --dlwaypoint option (without the cancel changes)
* debconf-apt-progress sometimes gets captured by buggy daemons, causing
tasksel to hang because $debconf_command_eof never becomes true.
STATUS_READ should be the last fd to close, so checking $status_eof is
sufficient (LP: #141601).
The last patch also looks interesting from a stability PoV.
As these patches cannot be backported in time for beta1, I have also
prepared a new version of the etch-support udeb that includes an updated
debconf-apt-progress with these patches and that diverts the Etch version
debconf-apt-progress for the duration of the installation (from
post-base-installer to finish-install).
I think we should upload this as there is a chance beta1 will be used with
Etch+1/2 if that gets released before D-I beta2.
If a backport of debconf is included in the next Etch point release, this
would no longer be needed and could be reverted.
OK if I upload the new etch-support?
Cheers,
FJP
commit 0a10960213f5dfc22aa7546ff67307c28aa4d10b
Author: cjwatson <cjwatson@a4a2c43b-8ac3-0310-8836-e0e880c912e2>
Date: Tue Dec 4 17:12:53 2007 +0000
* debconf-apt-progress sometimes gets captured by buggy daemons, causing
tasksel to hang because $debconf_command_eof never becomes true.
STATUS_READ should be the last fd to close, so checking $status_eof is
sufficient (LP: #141601).
git-svn-id: svn+ssh://svn.debian.org/svn/debconf/trunk/src/debconf@2249 a4a2c43b-8ac3-0310-8836-e0e880c912e2
diff --git a/debconf-apt-progress b/debconf-apt-progress
index 17bfdf1..3100f49 100755
--- a/debconf-apt-progress
+++ b/debconf-apt-progress
@@ -388,11 +388,13 @@ sub run_progress ($$@) {
my $status_buf = '';
my $debconf_command_buf = '';
- while (not $status_eof or not $debconf_command_eof) {
+ # STATUS_READ should be the last fd to close. DEBCONF_COMMAND_WRITE
+ # may end up captured by buggy daemons, so terminate the loop even
+ # if we haven't hit $debconf_command_eof.
+ while (not $status_eof) {
my $rin = '';
my $rout;
- vec($rin, fileno(STATUS_READ), 1) = 1
- unless $status_eof;
+ vec($rin, fileno(STATUS_READ), 1) = 1;
vec($rin, fileno(DEBCONF_COMMAND_READ), 1) = 1
unless $debconf_command_eof;
my $sel = select($rout = $rin, undef, undef, undef);
commit d982fa1c2c440617d7edcbfd5a81455e58bc586e
Author: joeyh <joeyh@a4a2c43b-8ac3-0310-8836-e0e880c912e2>
Date: Fri Nov 2 20:44:05 2007 +0000
add --dlwaypoint option
git-svn-id: svn+ssh://svn.debian.org/svn/debconf/trunk/src/debconf@2244 a4a2c43b-8ac3-0310-8836-e0e880c912e2
diff --git a/debconf-apt-progress b/debconf-apt-progress
index 4b8e5fe..17bfdf1 100755
--- a/debconf-apt-progress
+++ b/debconf-apt-progress
@@ -79,6 +79,12 @@ Avoid starting, stopping, or stepping the progress bar. Progress
messages from apt, media change events, and debconf questions will still
be passed through to debconf.
+=item B<--dlwaypoint> I<percentage>
+
+Specify what percent of the progress bar to use for downloading packages.
+The remainder will be used for installing packages. The default is to use
+15% for downloading and the remaining 85% for installing.
+
=item B<--logfile> I<file>
Send the normal output from apt to the given file.
@@ -135,6 +141,7 @@ use Debconf::Client::ConfModule ();
my ($config, $start, $from, $to, $stop);
my $progress=1;
+my $dlwaypoint=15;
my ($logfile, $logstderr);
sub checkopen (@) {
@@ -267,17 +274,14 @@ sub handle_status ($$$) {
my ($from, $to, $line) = @_;
my ($status, $pkg, $percent, $description) = split ':', $line, 4;
- # Crude waypointing. 15% was chosen to match base-installer,
- # but could benefit from timing tests under various
- # bandwidth conditions.
my ($min, $len);
if ($status eq 'dlstatus') {
$min = 0;
- $len = 15;
+ $len = $dlwaypoint;
}
elsif ($status eq 'pmstatus') {
- $min = 15;
- $len = 85;
+ $min = $dlwaypoint;
+ $len = 100 - $dlwaypoint;
}
elsif ($status eq 'media-change') {
Debconf::Client::ConfModule::subst(
@@ -503,14 +507,16 @@ if (envnonempty('DEBCONF_APT_PROGRESS_DB_OVERRIDE')) {
my @saved_argv = @ARGV;
-my $result = GetOptions('config' => \$config,
- 'start' => \$start,
- 'from=i' => \$from,
- 'to=i' => \$to,
- 'stop' => \$stop,
- 'logfile=s' => \$logfile,
- 'logstderr' => \$logstderr,
- 'progress!' => \$progress);
+my $result = GetOptions('config' => \$config,
+ 'start' => \$start,
+ 'from=i' => \$from,
+ 'to=i' => \$to,
+ 'stop' => \$stop,
+ 'logfile=s' => \$logfile,
+ 'logstderr' => \$logstderr,
+ 'progress!' => \$progress,
+ 'dlwaypoint=i' => \$dlwaypoint,
+);
if (! $progress && ($start || $from || $to || $stop)) {
die "--no-progress cannot be used with --start, --from, --to, or --stop\n";
commit f28e167b7c722b5c0ea5e377b29dd4f659d43c96
Author: joeyh <joeyh@a4a2c43b-8ac3-0310-8836-e0e880c912e2>
Date: Thu Nov 1 22:37:03 2007 +0000
debconf-apt-progress: Notice if the child exited abnormally, and exit
nonzero.
git-svn-id: svn+ssh://svn.debian.org/svn/debconf/trunk/src/debconf@2237 a4a2c43b-8ac3-0310-8836-e0e880c912e2
diff --git a/debconf-apt-progress b/debconf-apt-progress
index b24ec03..4b8e5fe 100755
--- a/debconf-apt-progress
+++ b/debconf-apt-progress
@@ -467,6 +467,10 @@ sub run_progress ($$@) {
# make sure that the progress bar always gets to the end
Debconf::Client::ConfModule::progress('SET', $to) if $progress;
+ if ($status & 127) {
+ return 127;
+ }
+
return ($status >> 8);
}
commit 19e6c5b341028b884486a88efec434b5e609c9d5
Author: joeyh <joeyh@a4a2c43b-8ac3-0310-8836-e0e880c912e2>
Date: Thu Oct 25 18:49:18 2007 +0000
* debconf-apt-progress: Add --no-progress option intended to be used
by apt-install in d-i.
git-svn-id: svn+ssh://svn.debian.org/svn/debconf/trunk/src/debconf@2233 a4a2c43b-8ac3-0310-8836-e0e880c912e2
diff --git a/debconf-apt-progress b/debconf-apt-progress
index 8ee94c6..b24ec03 100755
--- a/debconf-apt-progress
+++ b/debconf-apt-progress
@@ -73,6 +73,12 @@ Otherwise, install packages with their progress bar ending at this
Stop a running progress bar.
+=item B<--no-progress>
+
+Avoid starting, stopping, or stepping the progress bar. Progress
+messages from apt, media change events, and debconf questions will still
+be passed through to debconf.
+
=item B<--logfile> I<file>
Send the normal output from apt to the given file.
@@ -128,6 +134,7 @@ use Getopt::Long;
use Debconf::Client::ConfModule ();
my ($config, $start, $from, $to, $stop);
+my $progress=1;
my ($logfile, $logstderr);
sub checkopen (@) {
@@ -290,7 +297,7 @@ sub handle_status ($$$) {
$percent = ($percent * $len / 100 + $min);
$percent = ($percent * ($to - $from) / 100 + $from);
$percent =~ s/\..*//;
- Debconf::Client::ConfModule::progress('SET', $percent);
+ Debconf::Client::ConfModule::progress('SET', $percent) if $progress;
Debconf::Client::ConfModule::subst(
'debconf-apt-progress/info', 'DESCRIPTION', $description);
Debconf::Client::ConfModule::progress(
@@ -321,7 +328,7 @@ sub run_progress ($$@) {
use IO::Handle;
Debconf::Client::ConfModule::progress(
- 'INFO', 'debconf-apt-progress/preparing');
+ 'INFO', 'debconf-apt-progress/preparing') if $progress;
reservefds(4, 5, 6);
@@ -458,7 +465,7 @@ sub run_progress ($$@) {
my $status = $?;
# make sure that the progress bar always gets to the end
- Debconf::Client::ConfModule::progress('SET', $to);
+ Debconf::Client::ConfModule::progress('SET', $to) if $progress;
return ($status >> 8);
}
@@ -466,13 +473,13 @@ sub run_progress ($$@) {
sub start_bar ($$) {
my ($from, $to) = @_;
Debconf::Client::ConfModule::progress(
- 'START', $from, $to, 'debconf-apt-progress/title');
+ 'START', $from, $to, 'debconf-apt-progress/title') if $progress;
Debconf::Client::ConfModule::progress(
- 'INFO', 'debconf-apt-progress/preparing');
+ 'INFO', 'debconf-apt-progress/preparing') if $progress;
}
sub stop_bar () {
- Debconf::Client::ConfModule::progress('STOP');
+ Debconf::Client::ConfModule::progress('STOP') if $progress;
# If we don't stop, we leave a zombie in case some daemon fails to
# disconnect from fd 3.
Debconf::Client::ConfModule::stop();
@@ -498,7 +505,12 @@ my $result = GetOptions('config' => \$config,
'to=i' => \$to,
'stop' => \$stop,
'logfile=s' => \$logfile,
- 'logstderr' => \$logstderr);
+ 'logstderr' => \$logstderr,
+ 'progress!' => \$progress);
+
+if (! $progress && ($start || $from || $to || $stop)) {
+ die "--no-progress cannot be used with --start, --from, --to, or --stop\n";
+}
unless ($start) {
if (defined $from and not defined $to) {
Attachment:
signature.asc
Description: This is a digitally signed message part.