]> git.saurik.com Git - apt.git/commitdiff
deb822: Restore support for <multivalue>-{Add,Remove}
authorJames McCoy <jamessan@debian.org>
Wed, 20 Apr 2016 02:27:21 +0000 (22:27 -0400)
committerDavid Kalnischkies <david@kalnischkies.de>
Thu, 28 Apr 2016 08:08:32 +0000 (10:08 +0200)
Redesign of multivalue options in 463c8d801595ce5ac94d7c032264820be7434232
caused the parser to look for <multivalue>{Add,Remove} (no hyphen)
instead of the expected <multivalue>-{Add,Remove}.

apt-pkg/sourcelist.cc
test/integration/test-apt-sources-deb822

index 82d2ed3c662dd13c56ed3de992656a21155167ce..afbf3e665f49aa616611dc5d6a2103b1291c6737 100644 (file)
@@ -98,8 +98,8 @@ bool pkgSourceList::Type::ParseStanza(vector<metaIndex *> &List,      /*{{{*/
    std::map<char const * const, std::pair<char const * const, bool> > mapping;
 #define APT_PLUSMINUS(X, Y) \
    mapping.insert(std::make_pair(X, std::make_pair(Y, true))); \
-   mapping.insert(std::make_pair(X "Add", std::make_pair(Y "+", true))); \
-   mapping.insert(std::make_pair(X "Remove", std::make_pair(Y "-", true)))
+   mapping.insert(std::make_pair(X "-Add", std::make_pair(Y "+", true))); \
+   mapping.insert(std::make_pair(X "-Remove", std::make_pair(Y "-", true)))
    APT_PLUSMINUS("Architectures", "arch");
    APT_PLUSMINUS("Languages", "lang");
    APT_PLUSMINUS("Targets", "target");
index fd275f978ffed010cc64295b9b69be4d72cfec4e..9f761cb1c42addca8cb1d5be459d2ad8715fd47c 100755 (executable)
@@ -189,3 +189,13 @@ EOF
 testsuccessequal --nomsg "'http://emacs.naquadah.org/stable/InRelease' emacs.naquadah.org_stable_InRelease 0 
 'http://emacs.naquadah.org/stable/Packages.xz' emacs.naquadah.org_stable_Packages 0 
 'http://emacs.naquadah.org/stable/en.xz' emacs.naquadah.org_stable_en 0 " aptget update --print-uris
+
+# multivalue -Add/-Remove
+msgcleantest 'Test deb822 sources.list file which has' '-Add/-Remove multivalues'
+echo "$BASE" > $SOURCES
+echo "Languages-Remove: en" >> $SOURCES
+echo "Architectures-Add: armel" >> $SOURCES
+testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 
+'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 
+'http://ftp.debian.org/debian/dists/stable/main/binary-all/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-all_Packages 0 
+'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 " aptget update --print-uris