summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <egon@debian-devbox>2012-01-19 13:46:09 +0100
committerMichael Vogt <egon@debian-devbox>2012-01-19 13:46:09 +0100
commit4f8f5e3d8de21d578c6acd46896fcf62447a7cfd (patch)
tree44bc915f8c36e77dc9dce92a46094a1bac3cd0a7
parent0d5603b886f67562c105b03820c595ac7ae3451a (diff)
parent3a5ec3053c00ff5db058f1ddd99bf23591b9a181 (diff)
* apt-pkg/deb/dpkgpm.cc:
- redirect out/input of dpkg --assert-multi-arch to /dev/null - if multi-arch is detected ensure that pkg:all is reported as pkg:all
-rw-r--r--apt-pkg/deb/dpkgpm.cc10
-rw-r--r--debian/changelog9
-rwxr-xr-xtest/integration/test-dpkg-assert-multi-arch36
3 files changed, 52 insertions, 3 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 4dc0baa50..6feada4cc 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -858,6 +858,11 @@ bool pkgDPkgPM::Go(int OutStatusFd)
pid_t dpkgAssertMultiArch = ExecFork();
if (dpkgAssertMultiArch == 0)
{
+ // redirect everything to the ultimate sink as we only need the exit-status
+ int const nullfd = open("/dev/null", O_RDONLY);
+ dup2(nullfd, STDIN_FILENO);
+ dup2(nullfd, STDOUT_FILENO);
+ dup2(nullfd, STDERR_FILENO);
execv(Args[0], (char**) &Args[0]);
_error->WarningE("dpkgGo", "Can't detect if dpkg supports multi-arch!");
_exit(2);
@@ -1085,7 +1090,10 @@ bool pkgDPkgPM::Go(int OutStatusFd)
}
else
{
- char * const fullname = strdup(I->Pkg.FullName(false).c_str());
+ std::string name = I->Pkg.Name();
+ pkgCache::VerIterator PkgVer = Cache[I->Pkg].InstVerIter(Cache);
+ name.append(":").append(PkgVer.Arch());
+ char * const fullname = strdup(name.c_str());
Packages.push_back(fullname);
ADDARG(fullname);
}
diff --git a/debian/changelog b/debian/changelog
index ef25344ca..10356cde8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+apt (0.8.16~exp11) experimental; urgency=low
+
+ [ David Kalnischkies ]
+ * apt-pkg/deb/dpkgpm.cc:
+ - redirect out/input of dpkg --assert-multi-arch to /dev/null
+ - if multi-arch is detected ensure that pkg:all is reported as pkg:all
+
+ -- David Kalnischkies <kalnischkies@gmail.com> Thu, 19 Jan 2012 13:00:13 +0100
+
apt (0.8.16~exp10) experimental; urgency=low
[ David Kalnischkies ]
diff --git a/test/integration/test-dpkg-assert-multi-arch b/test/integration/test-dpkg-assert-multi-arch
index b1ec73e18..532cfd26a 100755
--- a/test/integration/test-dpkg-assert-multi-arch
+++ b/test/integration/test-dpkg-assert-multi-arch
@@ -9,19 +9,29 @@ configarchitecture 'amd64' 'i386'
buildsimplenativepackage 'native-pkg' 'amd64' '1.0' 'stable'
buildsimplenativepackage 'foreign-pkg' 'i386' '0.5' 'stable' 'Multi-Arch: foreign'
buildsimplenativepackage 'same-lib' 'amd64,i386' '0.5' 'stable' 'Multi-Arch: same'
+buildsimplenativepackage 'all-pkg' 'all' '2.0' 'stable'
+buildsimplenativepackage 'all-foreign-pkg' 'all' '2.0' 'stable'
setupaptarchive
testqualifier() {
msgtest 'Test for correct qualifier mode' $2
- GIVEN="$(aptget install $1 -qq -o Debug::pkgDPkgPM=1 2>&1 | grep -- '--configure' | sed -e 's/^.*--configure \([^ ]*\).*$/\1/')"
- test "$GIVEN" = "$2" && msgpass || msgfail
+ GIVEN="$(aptget install $1 -qq -o Debug::pkgDPkgPM=1 2>&1 | grep -e '--configure' -e '^dpkg:' | sed -e 's/^.*--configure \([^ ]*\).*$/\1/')"
+ if [ "$GIVEN" = "$2" ]; then
+ msgpass
+ else
+ echo
+ echo "$GIVEN"
+ msgfail
+ fi
}
# non-multiarch or "ubuntus" old multiarchified dpkg
echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
echo '#! /bin/sh
if echo "$*" | grep -q -- "--assert-multi-arch"; then
+ echo >&2 'dpkg: Fehler: unbekannte Option --assert-multi-arch'
+ echo >&1 'dpkg: Info: unbekannte Option --assert-multi-arch'
return 2;
fi
return $*' > ./dpkg-wrapper
@@ -34,9 +44,21 @@ testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386'
testqualifier 'same-lib' 'same-lib'
testqualifier 'same-lib:amd64' 'same-lib'
testqualifier 'same-lib:i386' 'same-lib:i386'
+testqualifier 'all-pkg' 'all-pkg'
+testqualifier 'all-pkg:amd64' 'all-pkg'
+testqualifier 'all-foreign-pkg' 'all-foreign-pkg'
+testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg'
+insertinstalledpackage 'all-pkg' 'amd64' '1.0'
+insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0'
+testqualifier 'all-pkg' 'all-pkg'
+testqualifier 'all-pkg:amd64' 'all-pkg'
+testqualifier 'all-foreign-pkg' 'all-foreign-pkg'
+testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg'
# multiarch dpkg (new interface version)
+rm rootdir/var/lib/dpkg/status
+touch rootdir/var/lib/dpkg/status
echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper
echo '#! /bin/sh
if echo "$*" | grep -q -- "--assert-multi-arch"; then
@@ -51,3 +73,13 @@ testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386'
testqualifier 'same-lib' 'same-lib:amd64'
testqualifier 'same-lib:amd64' 'same-lib:amd64'
testqualifier 'same-lib:i386' 'same-lib:i386'
+testqualifier 'all-pkg' 'all-pkg:all'
+testqualifier 'all-pkg:amd64' 'all-pkg:all'
+testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all'
+testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all'
+insertinstalledpackage 'all-pkg' 'amd64' '1.0'
+insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0'
+testqualifier 'all-pkg' 'all-pkg:all'
+testqualifier 'all-pkg:amd64' 'all-pkg:all'
+testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all'
+testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all'