summaryrefslogtreecommitdiff
path: root/apt-pkg/cacheset.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-04-20 10:37:04 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2012-04-20 10:37:04 +0200
commit518763f630873e35398d2537ebfabf97b5aea489 (patch)
treed7b36ef50a9301ac8099edc48a0ab9e563125198 /apt-pkg/cacheset.cc
parent8c6d0ba4e25baa7b0dffc4e06e76fc63a71e656f (diff)
parente6a12579e9e5d5735eda450cf2bb3986d828ab65 (diff)
merged from lp:~donkult/apt/sid
Diffstat (limited to 'apt-pkg/cacheset.cc')
-rw-r--r--apt-pkg/cacheset.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc
index b892ab4bf..e2dbe0e57 100644
--- a/apt-pkg/cacheset.cc
+++ b/apt-pkg/cacheset.cc
@@ -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);
}