Bug#531515: [Pkg-ia32-libs-maintainers] Processed: Re: Bug#531515: ia32-apt-get: breaks dpkg --control (= 1.15.1) and debsums
Hi, thank you for starcing the problem. Too me it looks like debsums calls dpkg-deb in an undocumented (although not uncommon for tools in general) way: 4: /usr/bin/dpkg-deb --control -- /var/cache/apt/archives/bzip2_1.0.5-2_amd64.deb /tmp/gD4mFRK2gm/DEBIAN According to the manpage the syntax is: -e, --control archive [directory] There is no mention in the docs that dpkg-deb supports --. Maybe because it is such a common option. Your patch isn't correct though, at least not complete. Think of this invocation: dpkg-deb --control -- /var/cache/apt/archives/bzip2_1.0.5-2_amd64.deb In that case, despite having 3 arguments, the DIR has to default to $(pwd)/DEBIAN. I guess there is no way around fully scanning the arguments and counting the valid bits. That should allow the use of the -D option as well. MfG Goswin -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#531515: [Pkg-ia32-libs-maintainers] Processed: Re: Bug#531515: ia32-apt-get: breaks dpkg --control (= 1.15.1) and debsums
Hi Goswin, Goswin von Brederlow schrieb am Fri, Jun 12, 2009 at 09:20:32PM +0200: thank you for starcing the problem. Too me it looks like debsums calls dpkg-deb in an undocumented (although not uncommon for tools in general) way: I don't think it's debsums. Debsums calls dpkg without --, see line 491 of debsums: 491 system 'dpkg', '--control', $deb, $control But it doesn't call dpkg-deb, but dpkg (which is ok) and dpkg adds this -- since 1.15.1. 4: /usr/bin/dpkg-deb --control -- /var/cache/apt/archives/bzip2_1.0.5-2_amd64.deb /tmp/gD4mFRK2gm/DEBIAN According to the manpage the syntax is: -e, --control archive [directory] There is no mention in the docs that dpkg-deb supports --. Then it's a bug that it's not documented anywhere else than in the dpkg 1.15.1 changelog entry: * When dpkg delegates to dpkg-query or dpkg-deb to do the actual work, add the -- marker to explicitely document the end of options so that arguments starting with a dash are not interpreted as options. Closes: #293163 Thanks to Bill Allombert for the patch. Your patch isn't correct though, at least not complete. Think of this invocation: dpkg-deb --control -- /var/cache/apt/archives/bzip2_1.0.5-2_amd64.deb There you are right. Missed that one. In that case, despite having 3 arguments, the DIR has to default to $(pwd)/DEBIAN. I guess there is no way around fully scanning the arguments and counting the valid bits. Looks so to me now, too. :-/ Regards, Axel -- /~\ Plain Text Ribbon Campaign | Axel Beckert \ / Say No to HTML in E-Mail and News| a...@deuxchevaux.org (Mail) X| a...@noone.org (Mail+Jabber) / \ I love long mails: http://email.is-not-s.ms/ | http://noone.org/abe/ (Web) -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#531515: ia32-apt-get: breaks dpkg --control (= 1.15.1) and debsums
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.0 +0200 +++ /usr/bin/dpkg-deb.patched 2009-06-09 18:22:42.0 +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 - a...@deuxchevaux.org - http://noone.org/abe/ -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#531515: ia32-apt-get: breaks dpkg --control (= 1.15.1) and debsums
On 2009-06-03 at 18:15:17, Goswin von Brederlow wrote: Francois, if you want to sponsor the upload: Done. I also took the liberty to bump the Standards-Version to 3.8.1 to fix a lintian warning. Cheers, Francois -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#531515: ia32-apt-get: breaks dpkg --control (= 1.15.1) and debsums
reassign 531515 ia32-apt-get 13 severity 531515 critical retitle 531515 ia32-apt-get: breaks dpkg --control (= 1.15.1) and debsums kthxbye Package: ia32-apt-get Version: 13 Severity: critical Justification: breaks unrelated software With ia32-apt-get and dpkg 1.15.2 installed, the following command fails: 60/0/0 r...@kiva6:pts/ttyp4 13:17:08 [~] # dpkg --control /var/cache/apt/archives/gawk_1%3a3.1.6.dfsg-3_amd64.deb /tmp/bla dpkg-deb: --control -- /var/cache/apt/archives/gawk_1%3a3.1.6.dfsg-3_amd64.deb /tmp/bla Unexpected number of arguments to --control 61/1/0 r...@kiva6:pts/ttyp4 13:17:22 [~] # Without ia32-apt-get installed, the command just works fine as it should: 62/0/0 r...@kiva6:pts/ttyp4 13:27:35 [~] # dpkg --control /var/cache/apt/archives/gawk_1%3a3.1.6.dfsg-3_amd64.deb /tmp/bla 63/0/0 r...@kiva6:pts/ttyp4 13:27:38 [~] # ls -alF /tmp/bla total 20 drwxr-xr-x 2 root root 4096 2009-05-28 11:27 ./ drwxrwxrwt 52 root root 4096 2009-06-03 13:27 ../ -rw-r--r-- 1 root root 910 2009-05-28 11:27 control -rwxr-xr-x 1 root root 494 2009-05-28 11:27 postinst* -rwxr-xr-x 1 root root 97 2009-05-28 11:27 prerm* 64/0/0 r...@kiva6:pts/ttyp4 13:27:43 [~] # According to the dpkg changelog the additional -- has been introduced with dpkg 1.15.1: * When dpkg delegates to dpkg-query or dpkg-deb to do the actual work, add the -- marker to explicitely document the end of options so that arguments starting with a dash are not interpreted as options. Closes: #293163 debsums calls dpkg that way and so causes dpkg-deb to be called with --. Therefore it (and anything else calling dpkg that way) fails if ia32-apt-get is installed. According to reportbug, a bug that makes unrelated software on the system [...] break is critical. IMHO this is the case here, since debsums neither directly depends/recommends/suggests ia32-apt-get nor vice versa, so I set the severity to critical. I though don't think it deserves the highest possible severity. If you think this bug is less severe, too, feel free to downgrade this bug. -- System Information: Debian Release: squeeze/sid APT prefers unstable APT policy: (990, 'unstable'), (600, 'testing'), (500, 'oldstable'), (400, 'stable'), (110, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 2.6.18-6-xen-amd64 (SMP w/1 CPU core) Locale: LANG=en_US.ISO-8859-15, LC_CTYPE=en_US.ISO-8859-15 (charmap=ISO-8859-15$ Shell: /bin/sh linked to /bin/bash Versions of packages ia32-apt-get depends on: ii ia32-libs-tools 13 Tools for converting i386 debs for ia32-apt-get recommends no packages. ia32-apt-get suggests no packages. -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#531515: ia32-apt-get: breaks dpkg --control (= 1.15.1) and debsums
tag 531515 + pending thanks ow...@bugs.debian.org (Debian Bug Tracking System) writes: Changed Bug title to `ia32-apt-get: breaks dpkg --control (= 1.15.1) and debsums' from `debsums: dpkg-deb: Unexpected number of arguments to --control'. I didn't support the full commandline syntax of dpkg-deb --control. Fixed now and uploaded to mentors.debian.net. It will be fixed in Debian as soon as someone sponsors the upload. Francois, if you want to sponsor the upload: http://mentors.debian.net/cgi-bin/sponsor-pkglist?action=details;package=ia32-libs-tools http://mentors.debian.net/debian/pool/main/i/ia32-libs-tools/ia32-libs-tools_14.dsc http://mentors.debian.net/debian/pool/main/i/ia32-libs-tools/ia32-libs-tools_14.tar.gz MfG Goswin -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org