fix some debug code and improve the sanity check on the dpkg version.

git-svn-id: http://emdebian.org/svn/current@8059 563faec7-e20c-0410-992a-a66f704d0ccd
This commit is contained in:
codehelp 2011-07-30 09:07:31 +00:00
parent 2a63b8a701
commit dc7b978df7

View file

@ -1135,7 +1135,7 @@ sub cascade {
} }
} }
my @ma=(); my @ma=();
if ($olddpkg != 0) { if ($olddpkg == 0) {
@ma = split(' ',lc($keys{$section}{'multiarch'})) @ma = split(' ',lc($keys{$section}{'multiarch'}))
if (defined $keys{$section}{'multiarch'}); if (defined $keys{$section}{'multiarch'});
} }
@ -1240,20 +1240,20 @@ sub check_multiarch_dpkg {
chomp ($distro); chomp ($distro);
} }
if ($distro eq "debian") { if ($distro eq "debian") {
$version = `dpkg -l dpkg|grep dpkg`; $version = `dpkg -s dpkg|grep Version`;
chomp ($version); chomp ($version);
$version =~ s/^ii[ ]+dpkg[ ]+([0-9\.]+)[ ]+.+$/$1/; $version =~ s/^Version: //;
# fill in the version which gets this support in Debian # fill in the version which gets this support in Debian
$retval = system("dpkg --compare-versions $version '>=' 1.20"); $retval = system("dpkg --compare-versions $version '>=' 1.16.1multiarch1");
$retval /= 256; $retval /= 256;
# returns 1 for Debian. # returns 1 for Debian.
return $retval; return $retval;
} else { } else {
# only Ubuntu explicitly supported here # only Ubuntu explicitly supported here
# looking for >= 1.16.0~ubuntu4 # looking for >= 1.16.0~ubuntu4
$version = `dpkg -l dpkg|grep dpkg`; $version = `dpkg -s dpkg|grep Version`;
chomp ($version); chomp ($version);
$version =~ s/^ii[ ]+dpkg[ ]+([^ ]+)[ ]+.+$/$1/; $version =~ s/^Version: //;
$retval = system("dpkg --compare-versions $version '>=' 1.16.0~ubuntu4"); $retval = system("dpkg --compare-versions $version '>=' 1.16.0~ubuntu4");
$retval /= 256; $retval /= 256;
return $retval; return $retval;