]> git.saurik.com Git - apt.git/commitdiff
support regex and co in 'apt-cache policy $pkg' again
authorDavid Kalnischkies <david@kalnischkies.de>
Mon, 14 Dec 2015 01:38:34 +0000 (02:38 +0100)
committerDavid Kalnischkies <david@kalnischkies.de>
Mon, 14 Dec 2015 01:38:34 +0000 (02:38 +0100)
Regression of 1e064088bf7b3e29cd36d30760fb3e4143a1a49a (1.1~exp4) which
moved code around and renamed methods heavily ending up calling the
wrong method matching packagenames only instead of calling the full
array. Most commands work with versions, so this managed to fly under
the radar for quite a while.

Closes: 807870
apt-pkg/cacheset.cc
test/integration/test-policy-pinning

index db34c4a20c47d94199018afed4c509c810759fc1..816925c4dbc00bbbbe5b13d21fa6b969919cba00 100644 (file)
@@ -336,7 +336,7 @@ bool CacheSetHelper::PackageFromString(PackageContainerInterface * const pci, pk
 bool CacheSetHelper::PackageFromCommandLine(PackageContainerInterface * const pci, pkgCacheFile &Cache, const char **cmdline) {
        bool found = false;
        for (const char **I = cmdline; *I != 0; ++I)
-               found |= PackageFrom(CacheSetHelper::PACKAGENAME, pci, Cache, *I);
+               found |= PackageFrom(CacheSetHelper::STRING, pci, Cache, *I);
        return found;
 }
                                                                        /*}}}*/
index dba8736564f0cb46a6437d64610b1dc2fbe5c0dd..062c8058f0e3525306a59ba78726bc1a712d6a4e 100755 (executable)
@@ -83,6 +83,15 @@ buildsimplenativepackage "coolstuff" "all" "2.0~bpo1" "backports"
 
 setupaptarchive
 
+testsuccessequal "coolstuff:
+  Installed: (none)
+  Candidate: 2.0~bpo1
+  Version table:
+     2.0~bpo1 500
+        500 file:${APTARCHIVE} backports/main all Packages
+     1.0 500
+        500 file:${APTARCHIVE} stable/main all Packages" apt policy '^cool.*'
+
 testequalpolicycoolstuff() {
        local INSTALLED="${1:-(none)}"
        local CANDIDATE="${2:-(none)}"