* apt-pkg/aptconfiguration.cc:
authorDavid Kalnischkies <kalnischkies@gmail.com>
Wed, 14 Dec 2011 11:32:53 +0000 (12:32 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Wed, 14 Dec 2011 11:32:53 +0000 (12:32 +0100)
  - parse dpkg --print-foreign-architectures correctly in
    case archs are separated by newline instead of space, too.

apt-pkg/aptconfiguration.cc
debian/changelog
test/integration/test-bug-612958-use-dpkg-multiarch-config

index bc385b2..cc77eea 100644 (file)
@@ -335,7 +335,7 @@ std::vector<std::string> const Configuration::getArchitectures(bool const &Cache
                FILE *dpkg = popen(dpkgcall.c_str(), "r");
                char buf[1024];
                if(dpkg != NULL) {
-                       if (fgets(buf, sizeof(buf), dpkg) != NULL) {
+                       while (fgets(buf, sizeof(buf), dpkg) != NULL) {
                                char* arch = strtok(buf, " ");
                                while (arch != NULL) {
                                        for (; isspace(*arch) != 0; ++arch);
index 1dffe9c..277c1d9 100644 (file)
@@ -5,13 +5,16 @@ apt (0.8.15.10) UNRELEASEDunstable; urgency=low
     - show a debug why a package was kept by ResolveByKeep()
   * doc/manpage-style.xml:
     - put <brackets> around email addresses
+  * apt-pkg/aptconfiguration.cc:
+    - parse dpkg --print-foreign-architectures correctly in
+      case archs are separated by newline instead of space, too.
 
   [ Chris Leick ]
   * German manpage translation update
   * doc/*.xml:
     - find and fix a bunch of misspellings
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Sun, 20 Nov 2011 18:02:08 +0100
+ -- David Kalnischkies <kalnischkies@gmail.com>  Wed, 14 Dec 2011 12:32:37 +0100
 
 apt (0.8.15.9) unstable; urgency=low
 
index 4f31c39..18b9646 100755 (executable)
@@ -56,4 +56,22 @@ testfail 'dpkg config' 'armel'
 echo '#! /bin/sh
 echo "amd64 armel"' > ./dpkg-printer
 
+testpass 'dpkg config' 'i386'
+testpass 'dpkg config' 'amd64'
+testpass 'dpkg config' 'armel'
+
+echo '#! /bin/sh
+echo "amd64
+armel"' > ./dpkg-printer
+
+testpass 'dpkg config' 'i386'
+testpass 'dpkg config' 'amd64'
 testpass 'dpkg config' 'armel'
+
+echo '#! /bin/sh
+echo "amd64
+i386"' > ./dpkg-printer
+
+testpass 'dpkg config' 'i386'
+testpass 'dpkg config' 'amd64'
+testfail 'dpkg config' 'armel'