Hi François,

On Wed, Jun 03, 2009 at 10:04:34PM +1200, Francois Marier wrote:
> I've tried to find where this is coming from and the only line which uses
> "--control" is /usr/bin/debsums:491
> 
> It is triggered whenever I do something like:
> 
>   apt-get install --reinstall gawk
> 
> However, this is what gets run:
> 
>   dpkg --control /var/cache/apt/archives/gawk_1%3a3.1.6.dfsg-3_amd64.deb 
> /tmp/vQkt8g7Oc8/DEBIAN
> 
> So I'm not sure how to reproduce your problem using dpkg 1.15.2

Interesting.

One thing I noticed just now (and more or less by accident while
trying to capture the whole strace output) is that the reinstalling
apt-get process was named "apt-get.real".

And this was the reason for this suffix:

53/100/0 r...@kiva6:pts/ttyp4 12:47:50 [~] # dpkg -S /usr/bin/apt-get
diversion by ia32-apt-get from: /usr/bin/apt-get
diversion by ia32-apt-get to: /usr/bin/apt-get.real
apt, ia32-apt-get: /usr/bin/apt-get
54/0/0 r...@kiva6:pts/ttyp4 12:48:02 [~] # 

I purged ia32-apt-get (and all not otherwise necessary dependencies)
and the problem vanished.

With ia32-apt-get installed, your command looks like this:

24/1/1 r...@kiva6:pts/ttyp4 12:25:02 [~] # apt-get install --reinstall gawk
apt-get: install --reinstall gawk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 1 not upgraded.
Need to get 769kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.ch.debian.org sid/main gawk 1:3.1.6.dfsg-3 [769kB]
Fetched 769kB in 0s (7320kB/s)
dpkg-deb: --control /var/cache/apt/archives/gawk_1%3a3.1.6.dfsg-3_amd64.deb 
/var/lib/dpkg/tmp.ci
(Reading database ... 112706 files and directories currently installed.)
Preparing to replace gawk 1:3.1.6.dfsg-3 (using 
.../gawk_1%3a3.1.6.dfsg-3_amd64.deb) ...
Unpacking replacement gawk ...
dpkg-deb: --fsys-tarfile /var/cache/apt/archives/gawk_1%3a3.1.6.dfsg-3_amd64.deb
Processing triggers for man-db ...
Setting up gawk (1:3.1.6.dfsg-3) ...
dpkg-deb: --control -- /var/cache/apt/archives/gawk_1%3a3.1.6.dfsg-3_amd64.deb 
/tmp/zXWUaWyjbb/DEBIAN
Unexpected number of arguments to --control
debsums: can't extract control info from 
/var/cache/apt/archives/gawk_1%3a3.1.6.dfsg-3_amd64.deb
E: Problem executing scripts DPkg::Post-Invoke 'if [ -x /usr/bin/debsums ]; 
then /usr/bin/debsums --generate=nocheck -sp /var/cache/apt/archives; fi'
E: Sub-process returned an error code
25/100/1 r...@kiva6:pts/ttyp4 12:26:25 [~] # 

Without ia32-apt-get installed, it looks like this:

55/0/0 r...@kiva6:pts/ttyp4 12:50:25 [~] # apt-get install --reinstall gawk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 1 not upgraded.
Need to get 0B/769kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 112682 files and directories currently installed.)
Preparing to replace gawk 1:3.1.6.dfsg-3 (using 
.../gawk_1%3a3.1.6.dfsg-3_amd64.deb) ...
Unpacking replacement gawk ...
Processing triggers for man-db ...
Setting up gawk (1:3.1.6.dfsg-3) ...
localepurge: Disk space freed in /usr/share/locale: 580K
56/0/0 r...@kiva6:pts/ttyp4 12:50:36 [~] # 

So the culprit is ia32-apt-get.

BTW, to reproduce the behaviour, it suffices to only call

/usr/bin/debsums --generate=nocheck -sp /var/cache/apt/archives

29/0/1 r...@kiva6:pts/ttyp4 12:28:32 [~] # /usr/bin/debsums 
--generate=nochecksp /var/cache/apt/archives
dpkg-deb: --control -- /var/cache/apt/archives/gawk_1%3a3.1.6.dfsg-3_amd64.deb 
/tmp/8uRFCniM8U/DEBIAN
Unexpected number of arguments to --control
debsums: can't extract control info from 
/var/cache/apt/archives/gawk_1%3a3.1.6.dfsg-3_amd64.deb
30/2/1 r...@kiva6:pts/ttyp4 12:30:05 [~] # 

I just ran it in the perl debugger with a break point a line 491 (the
only occurance of "--control", and as you said without "--"):

  DB<6> b 491
  DB<7> c
main::(/usr/bin/debsums:491):           system 'dpkg', '--control', $deb, 
$control
main::(/usr/bin/debsums:492):               and die "$self: can't extract 
control info from $deb\n";
  DB<7> x $deb
0  '/var/cache/apt/archives/gawk_1%3a3.1.6.dfsg-3_amd64.deb'
  DB<8> x $control
0  '/tmp/5xGtL9Zd8N/DEBIAN'
  DB<9> s
dpkg-deb: --control -- /var/cache/apt/archives/gawk_1%3a3.1.6.dfsg-3_amd64.deb 
/tmp/5xGtL9Zd8N/DEBIAN
Unexpected number of arguments to --control
debsums: can't extract control info from 
/var/cache/apt/archives/gawk_1%3a3.1.6.dfsg-3_amd64.deb
 at /usr/bin/debsums line 491
File::Temp::CODE(0xbe0b10)(/usr/share/perl/5.10/File/Temp.pm:866):
866:        cleanup();
  DB<9> 

Then I noticed that ia32-apt-get not only diverts apt-get but also dpkg-deb:

57/0/0 r...@kiva6:pts/ttyp4 12:52:15 [~] # dpkg -S /usr/bin/dpkg-deb
diversion by ia32-apt-get from: /usr/bin/dpkg-deb
diversion by ia32-apt-get to: /usr/bin/dpkg-deb.real
dpkg, ia32-apt-get: /usr/bin/dpkg-deb
58/0/0 r...@kiva6:pts/ttyp4 12:53:29 [~] # 

And a look in this script reveals:

---snip---
#!/bin/sh

set -e

echo >&2 "dpkg-deb: $*"

case "$1" in
  (--control)
    if ! [ $# = 3 ]; then
      echo >&2 "Unexpected number of arguments to --control"
      exit 1;
    fi
[...]
---snap--

This is at least where the error message comes from.

So debsums calls "dpkg --control $deb $control", dpkg calls dpkg-deb
since 1.15.1 with an additional "--" (see #293163 or the changelog of
dpkg 1.15.1) and dpkg-deb is the diversion of ia32-apt-get which
doesn't cope with the additional "--".

A workaround would be to call dpkg-deb directly, but this is
definitely a bug in ia32-apt-get.

I will soon reassign this bug appropriately to ia32-apt-get with
additional informations for the ia32-apt-get maintainers.

Thanks for your patience and help to locate this problem.

                Regards, Axel
-- 
Axel Beckert - [email protected], [email protected] - http://noone.org/abe/



--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to