* apt-pkg/deb/dpkgpm.cc:
authorDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 19 Jan 2012 11:40:38 +0000 (12:40 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Thu, 19 Jan 2012 11:40:38 +0000 (12:40 +0100)
  - redirect out/input of dpkg --assert-multi-arch to /dev/null

apt-pkg/deb/dpkgpm.cc
debian/changelog
test/integration/test-dpkg-assert-multi-arch

index 4dc0baa..0dc00e8 100644 (file)
@@ -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);
index ef25344..6ed7cb7 100644 (file)
@@ -1,3 +1,11 @@
+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
+
+ -- David Kalnischkies <kalnischkies@gmail.com>  Thu, 19 Jan 2012 12:39:31 +0100
+
 apt (0.8.16~exp10) experimental; urgency=low
 
   [ David Kalnischkies ]
index b1ec73e..8be7e0d 100755 (executable)
@@ -14,14 +14,22 @@ 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