Package: dpkg
Version: 1.19.5
Severity: normal

Dear Maintainer,

I was trying to install every single Debian package on Debian 7.

To sort out package conflicts or failed package installs I tried running
| dpkg --configure -a --abort-after=1
In order to reduce the complication of sorting out these packages.

dpkg would always stop after two failed package configurations, not one.

I expected dpkg to abort after 1 failed package configuration, when
specifying --abort-after=1, not 2.

I also tryed with --abort-after=2 and --abort-after=0.  dpkg always
aborts after just one more than I specify.

I have tried a similar scenario on Debian unstable in a VM, and dpkg
always fails after one more package than I specify with --abort-after
there, too.

I have examined the source code and I might have a patch.  I am only a
very beginner or intermediate coder, so it might be the wrong patch.
Here you go:

diff -burN dpkg-1.19.5.original/src/errors.c dpkg-1.19.5/src/errors.c
--- dpkg-1.19.5.original/src/errors.c   2019-02-23 09:26:43.000000000 -0500
+++ dpkg-1.19.5/src/errors.c    2019-03-17 00:45:14.940000000 -0400
@@ -71,7 +71,7 @@
   *lastreport= nr;
   lastreport= &nr->next;

-  if (nerrs++ < errabort) return;
+  if (++nerrs < errabort) return;
   notice(_("too many errors, stopping"));
   abort_processing = true;
 }

I have tested out this change in dpkg on my vm and I have found that
dpkg now aborts after the specified number of packages in the --abort-after
option.

I hope that helps.  Let me know if I can help with anything.

-- Package-specific info:

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), LANGUAGE=en_CA:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages dpkg depends on:
ii  libbz2-1.0   1.0.6-9
ii  libc6        2.28-8
ii  liblzma5     5.2.4-1
ii  libselinux1  2.8-1+b1
ii  tar          1.30+dfsg-5
ii  zlib1g       1:1.2.11.dfsg-1

dpkg recommends no packages.

Versions of packages dpkg suggests:
ii  apt            1.8.0
pn  debsig-verify  <none>

-- no debconf information

Reply via email to