]> git.saurik.com Git - apt.git/commitdiff
support " " in deb822 source options
authorMichael Vogt <mvo@debian.org>
Sat, 25 Jan 2014 13:53:03 +0000 (14:53 +0100)
committerMichael Vogt <mvo@debian.org>
Sat, 25 Jan 2014 13:53:03 +0000 (14:53 +0100)
apt-pkg/sourcelist.cc
test/integration/test-apt-sources-deb822

index 4e580ba04f97a515396d9581505fe14366ebf7d8..8462027c50d4abd289b1ebe4588590e64e2694a5 100644 (file)
@@ -20,6 +20,7 @@
 #include <apt-pkg/tagfile.h>
 
 #include <fstream>
 #include <apt-pkg/tagfile.h>
 
 #include <fstream>
+#include <algorithm>
 
 #include <apti18n.h>
                                                                        /*}}}*/
 
 #include <apti18n.h>
                                                                        /*}}}*/
@@ -94,7 +95,12 @@ bool pkgSourceList::Type::ParseStanza(vector<metaIndex *> &List,
    };
    for (unsigned int j=0; j < sizeof(option_deb822)/sizeof(char*); j++)
       if (Tags.Exists(option_deb822[j]))
    };
    for (unsigned int j=0; j < sizeof(option_deb822)/sizeof(char*); j++)
       if (Tags.Exists(option_deb822[j]))
-         Options[option_internal[j]] = Tags.FindS(option_deb822[j]);
+      {
+         // for deb822 the " " is the delimiter, but the backend expects ","
+         std::string option = Tags.FindS(option_deb822[j]);
+         std::replace(option.begin(), option.end(), ' ', ',');
+         Options[option_internal[j]] = option;
+      }
    
    // now create one item per suite/section
    string Suite = Tags.FindS("Suites");
    
    // now create one item per suite/section
    string Suite = Tags.FindS("Suites");
index 6e9a02417c5c64b8134948f9b4918ea0b8474c42..7237960182891df0471ac62ba80681200f5f0449 100755 (executable)
@@ -66,7 +66,7 @@ testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/P
 
 msgtest 'Test deb822' 'architecture option'
 echo "$BASE" > $SOURCES
 
 msgtest 'Test deb822' 'architecture option'
 echo "$BASE" > $SOURCES
-echo "Architectures: amd64,armel" >> $SOURCES
+echo "Architectures: amd64 armel" >> $SOURCES
 testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-amd64_Packages 0 :
 'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 :
 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
 testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-amd64_Packages 0 :
 'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 :
 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :