summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-07-30 09:51:42 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-07-30 09:51:42 +0200
commitcd7bbc479f8e2f277092a9557bb486ab664deba6 (patch)
tree4c3a5ed40727d193920203d57f1b9fea09d0afd8 /cmdline
parent4ed3806e625a4b5c148e27dba5384f133dd77c1a (diff)
- [ABI BREAK] add an ErrorType option to CacheSetHelper
* cmdline/apt-cache.cc: - use Notice instead of Error in the CacheSetHelper messages for compat reasons. Otherwise tools like sbuild blow up
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-cache.cc24
1 files changed, 16 insertions, 8 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index 70732e4d0..2a4e200a7 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -173,7 +173,9 @@ bool UnMet(CommandLine &CmdL)
}
else
{
- APT::VersionSet verset = APT::VersionSet::FromCommandLine(CacheFile, CmdL.FileList + 1);
+ APT::CacheSetHelper helper(true, GlobalError::NOTICE);
+ APT::VersionSet verset = APT::VersionSet::FromCommandLine(CacheFile, CmdL.FileList + 1,
+ APT::VersionSet::CANDIDATE, helper);
for (APT::VersionSet::iterator V = verset.begin(); V != verset.end(); ++V)
if (ShowUnMet(V, Important) == false)
return false;
@@ -187,7 +189,8 @@ bool UnMet(CommandLine &CmdL)
bool DumpPackage(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
- APT::PackageSet pkgset = APT::PackageSet::FromCommandLine(CacheFile, CmdL.FileList + 1);
+ APT::CacheSetHelper helper(true, GlobalError::NOTICE);
+ APT::PackageSet pkgset = APT::PackageSet::FromCommandLine(CacheFile, CmdL.FileList + 1, helper);
for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg)
{
@@ -566,7 +569,7 @@ public:
return pkgCache::VerIterator(Cache, 0);
}
- CacheSetHelperDepends() : CacheSetHelper(false) {}
+ CacheSetHelperDepends() : CacheSetHelper(false, GlobalError::NOTICE) {}
};
bool ShowDepends(CommandLine &CmdL, bool const RevDepends)
{
@@ -754,11 +757,12 @@ bool XVcg(CommandLine &CmdL)
}
// Load the list of packages from the command line into the show list
+ APT::CacheSetHelper helper(true, GlobalError::NOTICE);
std::list<APT::PackageSet::Modifier> mods;
mods.push_back(APT::PackageSet::Modifier(0, ",", APT::PackageSet::Modifier::POSTFIX));
mods.push_back(APT::PackageSet::Modifier(1, "^", APT::PackageSet::Modifier::POSTFIX));
std::map<unsigned short, APT::PackageSet> pkgsets =
- APT::PackageSet::GroupedFromCommandLine(CacheFile, CmdL.FileList + 1, mods, 0);
+ APT::PackageSet::GroupedFromCommandLine(CacheFile, CmdL.FileList + 1, mods, 0, helper);
for (APT::PackageSet::const_iterator Pkg = pkgsets[0].begin();
Pkg != pkgsets[0].end(); ++Pkg)
@@ -968,11 +972,12 @@ bool Dotty(CommandLine &CmdL)
}
// Load the list of packages from the command line into the show list
+ APT::CacheSetHelper helper(true, GlobalError::NOTICE);
std::list<APT::PackageSet::Modifier> mods;
mods.push_back(APT::PackageSet::Modifier(0, ",", APT::PackageSet::Modifier::POSTFIX));
mods.push_back(APT::PackageSet::Modifier(1, "^", APT::PackageSet::Modifier::POSTFIX));
std::map<unsigned short, APT::PackageSet> pkgsets =
- APT::PackageSet::GroupedFromCommandLine(CacheFile, CmdL.FileList + 1, mods, 0);
+ APT::PackageSet::GroupedFromCommandLine(CacheFile, CmdL.FileList + 1, mods, 0, helper);
for (APT::PackageSet::const_iterator Pkg = pkgsets[0].begin();
Pkg != pkgsets[0].end(); ++Pkg)
@@ -1403,9 +1408,10 @@ bool ShowAuto(CommandLine &CmdL)
bool ShowPackage(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
+ APT::CacheSetHelper helper(true, GlobalError::NOTICE);
APT::VersionSet::Version const select = _config->FindB("APT::Cache::AllVersions", true) ?
APT::VersionSet::ALL : APT::VersionSet::CANDIDATE;
- APT::VersionSet const verset = APT::VersionSet::FromCommandLine(CacheFile, CmdL.FileList + 1, select);
+ APT::VersionSet const verset = APT::VersionSet::FromCommandLine(CacheFile, CmdL.FileList + 1, select, helper);
for (APT::VersionSet::const_iterator Ver = verset.begin(); Ver != verset.end(); ++Ver)
if (DisplayRecord(CacheFile, Ver) == false)
return false;
@@ -1564,7 +1570,8 @@ bool Policy(CommandLine &CmdL)
(InstalledLessCandidate > 0 ? (InstalledLessCandidate) : 0) - 1;
// Print out detailed information for each package
- APT::PackageSet pkgset = APT::PackageSet::FromCommandLine(CacheFile, CmdL.FileList + 1);
+ APT::CacheSetHelper helper(true, GlobalError::NOTICE);
+ APT::PackageSet pkgset = APT::PackageSet::FromCommandLine(CacheFile, CmdL.FileList + 1, helper);
for (APT::PackageSet::const_iterator I = pkgset.begin(); I != pkgset.end(); ++I)
{
pkgCache::PkgIterator Pkg = I.Group().FindPkg("any");
@@ -1644,7 +1651,8 @@ bool Madison(CommandLine &CmdL)
if (_error->PendingError() == true)
_error->Discard();
- APT::PackageSet pkgset = APT::PackageSet::FromCommandLine(CacheFile, CmdL.FileList + 1);
+ APT::CacheSetHelper helper(true, GlobalError::NOTICE);
+ APT::PackageSet pkgset = APT::PackageSet::FromCommandLine(CacheFile, CmdL.FileList + 1, helper);
for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg)
{
if (Pkg.end() == false)