From 67b5d3dc34e88e092c8e5f05efc82370a873c80f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 19 Jan 2012 12:40:38 +0100 Subject: * apt-pkg/deb/dpkgpm.cc: - redirect out/input of dpkg --assert-multi-arch to /dev/null --- apt-pkg/deb/dpkgpm.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'apt-pkg/deb/dpkgpm.cc') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 4dc0baa50..0dc00e8ad 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); -- cgit v1.2.3 From 3a5ec3053c00ff5db058f1ddd99bf23591b9a181 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 19 Jan 2012 13:12:14 +0100 Subject: if multi-arch is detected ensure that pkg:all is reported as pkg:all Versions with arch:all are added to the package with the native arch, so we can't rely on Pkg.Arch() for the architecture --- apt-pkg/deb/dpkgpm.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'apt-pkg/deb/dpkgpm.cc') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 0dc00e8ad..6feada4cc 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1090,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); } -- cgit v1.2.3