summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-06-26 21:17:34 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-06-26 21:17:34 +0200
commit48c39e3246b72802a6f723eef1ce0c30e06be33d (patch)
tree4b1475b2c66a985a107946c8a6c824974522ee6b /cmdline
parent5c640e864f8b5f1c175682a94f6c6d0dff42d4bc (diff)
- only print errors if all tries to get a package by string failed
*
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/cacheset.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/cmdline/cacheset.cc b/cmdline/cacheset.cc
index 88a98fdbe..2b00187d8 100644
--- a/cmdline/cacheset.cc
+++ b/cmdline/cacheset.cc
@@ -200,15 +200,21 @@ PackageSet PackageSet::FromString(pkgCacheFile &Cache, std::string const &str, C
pkgset.insert(Pkg);
return pkgset;
}
+
+ _error->PushToStack();
+
PackageSet pset = FromTask(Cache, str, helper);
- if (pset.empty() == false)
- return pset;
+ if (pset.empty() == true) {
+ pset = FromRegEx(Cache, str, helper);
+ if (pset.empty() == true)
+ pset = helper.canNotFindPackage(Cache, str);
+ }
- pset = FromRegEx(Cache, str, helper);
if (pset.empty() == false)
- return pset;
-
- return helper.canNotFindPackage(Cache, str);
+ _error->RevertToStack();
+ else
+ _error->MergeWithStack();
+ return pset;
}
/*}}}*/
// GroupedFromCommandLine - Return all versions specified on commandline/*{{{*/