summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-01-24 20:18:39 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2012-01-24 20:18:39 +0100
commit5b172c0263c12f1163cfa17170a9b0da917e782c (patch)
treea8a978b0ca1891c492c554c8c1d9cbf5c030b529 /apt-pkg/deb
parent76dbf3cee365788eb7291c96f06b73a3769946d6 (diff)
parent3102af74e7ffaab3f47741c05451ce7f0e3b38fe (diff)
merged from experimental
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/dpkgpm.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index c08f52c25..82b127c2f 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -857,6 +857,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);
@@ -1084,7 +1089,14 @@ bool pkgDPkgPM::Go(int OutStatusFd)
}
else
{
- char * const fullname = strdup(I->Pkg.FullName(false).c_str());
+ pkgCache::VerIterator PkgVer;
+ std::string name = I->Pkg.Name();
+ if (Op == Item::Remove || Op == Item::Purge)
+ PkgVer = I->Pkg.CurrentVer();
+ else
+ PkgVer = Cache[I->Pkg].InstVerIter(Cache);
+ name.append(":").append(PkgVer.Arch());
+ char * const fullname = strdup(name.c_str());
Packages.push_back(fullname);
ADDARG(fullname);
}