]> git.saurik.com Git - apt.git/commitdiff
merged r2204 from lp:~donkult/apt/sid
authorMichael Vogt <michael.vogt@ubuntu.com>
Fri, 20 Apr 2012 08:47:05 +0000 (10:47 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Fri, 20 Apr 2012 08:47:05 +0000 (10:47 +0200)
apt-pkg/cacheset.cc
debian/changelog
test/integration/test-bug-593360-modifiers-in-names

index b892ab4bfd9a69964c3c0762d63c4e187347f7d2..e2dbe0e5776e28259c006d3fc893c566cba36acc 100644 (file)
@@ -217,6 +217,7 @@ bool PackageContainerInterface::FromModifierCommandLine(unsigned short &modID, P
                                                        pkgCacheFile &Cache, const char * cmdline,
                                                        std::list<Modifier> const &mods, CacheSetHelper &helper) {
        std::string str = cmdline;
+       unsigned short fallback = modID;
        bool modifierPresent = false;
        for (std::list<Modifier>::const_iterator mod = mods.begin();
             mod != mods.end(); ++mod) {
@@ -243,6 +244,7 @@ bool PackageContainerInterface::FromModifierCommandLine(unsigned short &modID, P
                helper.showErrors(errors);
                if (Pkg.end() == false) {
                        pci->insert(Pkg);
+                       modID = fallback;
                        return true;
                }
        }
@@ -281,13 +283,14 @@ bool VersionContainerInterface::FromModifierCommandLine(unsigned short &modID,
                modifierPresent = true;
                break;
        }
-
        if (modifierPresent == true) {
                bool const errors = helper.showErrors(false);
                bool const found = VersionContainerInterface::FromString(vci, Cache, cmdline, select, helper, true);
                helper.showErrors(errors);
-               if (found == true)
+               if (found == true) {
+                       modID = fallback;
                        return true;
+               }
        }
        return FromString(vci, Cache, str, select, helper);
 }
index d637beb5989740e9dfbc841b7bd295dc80836415..ee59beb329d76dfb7d3288b143991341ac2b2068 100644 (file)
@@ -12,6 +12,11 @@ apt (0.8.16~exp12ubuntu10) UNRELEASEDprecise-proposed; urgency=low
       ordering code does not get into a endless loop when it flip-flops
       between two states
 
+  [ David Kalnischkies ]
+  * apt-pkg/cacheset.cc:
+    - actually return to the fallback modifier if we have detected we
+      should for packagenames which look like modifiers (Closes: #669591)
+
  -- Malcolm Scott <launchpad@malc.org.uk>  Thu, 19 Apr 2012 19:52:56 +0100
 
 apt (0.8.16~exp12ubuntu9) precise-proposed; urgency=low
index 83a3cfabfdc7699731c18c7f19a2eaeb4373808a..74826cbdba8a47b68ae49aa5d68abb1597b7782a 100755 (executable)
@@ -15,6 +15,11 @@ The following NEW packages will be installed:
 Inst g++ (4:4.4.5-1 localhost [i386])
 Conf g++ (4:4.4.5-1 localhost [i386])' aptget install g++ -s
 
+testequal "Reading package lists...
+Building dependency tree...
+Package 'g++' is not installed, so not removed
+0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove g++ -s
+
 testequal 'Reading package lists...
 Building dependency tree...
 The following NEW packages will be installed: