[Pkg-ia32-libs-maintainers] Bug#531515: ia32-apt-get: breaks "dpkg --control" (>= 1.15.1) and debsums
Axel Beckert
abe at deuxchevaux.org
Tue Jun 9 17:01:21 UTC 2009
reopen 531515 14
tag 531515 + patch
kthxbye
Hi Goswin,
I'm sorry, but this bug is back respectively still there.
I'm not sure why it did happen again for the first time only today
although I dist-upgrade that box at least once a day. But it was
reproducable here by calling "/usr/bin/debsums --generate=nocheck -sp
/var/cache/apt/archives" after the upgrade of bzip2 in Sid, either via
DPkg::Post-Invoke or manually.
François, maybe you can enlighten me in which situations debsums calls
dpkg --control and in which not... Although I do think I can reliably
reproduce this bug. (See below.)
With version 14 the bug now seems to be only an off-by-one bug.
I added the following two lines to your dpkg-deb wrapper right after
'set -e':
echo $#: $0 "$@"
set -x
Now the output is as follows:
# /usr/bin/debsums --generate=nocheck -sp /var/cache/apt/archives
4: /usr/bin/dpkg-deb --control -- /var/cache/apt/archives/bzip2_1.0.5-2_amd64.deb /tmp/gD4mFRK2gm/DEBIAN
+ case "$1" in
+ case $# in
+ echo 'Unexpected number of arguments to --control'
Unexpected number of arguments to --control
+ exit 1
debsums: can't extract control info from
/var/cache/apt/archives/bzip2_1.0.5-2_amd64.deb
So for me it looks as if the two cases for (--control) should be 3 and
4, not 2 and 3, probably because --control is also counted as
parameter.
The following patch works for me:
--- /usr/bin/dpkg-deb 2009-06-04 11:19:02.000000000 +0200
+++ /usr/bin/dpkg-deb.patched 2009-06-09 18:22:42.000000000 +0200
@@ -5,8 +5,8 @@
case "$1" in
(--control)
case $# in
- 2) DIR="$(pwd)/DEBIAN"; break;;
3) DIR="$3"; break;;
+ 4) DIR="$4"; break;;
*) echo >&2 "Unexpected number of arguments to --control"
exit 1;;
esac
With set -x still enabled I also saw both cases[1], with and without
"--", so both, 3 and 4 worked for me. (It though later confused
dpkg/tar when piping the output of --fsys-tarfile to somewhere...
After removing the -x this worked fine again, too.)
[1] On calling /usr/bin/debsums --generate=nocheck -sp /var/cache/apt/archives
3: /usr/bin/dpkg-deb --control /var/cache/apt/archives/bzip2_1.0.5-2_amd64.deb /var/lib/dpkg/tmp.ci
On calling aptitude reinstall bzip2
4: /usr/bin/dpkg-deb --control -- /var/cache/apt/archives/bzip2_1.0.5-2_amd64.deb /tmp/pS0f3zhYUg/DEBIAN
To be sure the bug is gone with my patch, I did the following:
Downgrading bzip2 to testing and upgrading again to Sid with dpkg-deb
patched as above. This didn't cause the error.
After reinstalling version 14 of ia32-apt-get (and therefore removing
my patch) and then downgrading bzip2 to testing and upgrading again to
Sid caused the bug to reappear in both situations (downgrading and
upgrading).
Regards, Axel
--
Axel Beckert - abe at deuxchevaux.org - http://noone.org/abe/
More information about the Pkg-ia32-libs-maintainers
mailing list