summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-11-09 17:22:57 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-11-09 17:22:57 +0100
commit15fc8636b3e48eab5f3bc6f2e8c61c0409246909 (patch)
treed7b24c811c07d89efb86b547c0f9d1e2000588f8 /cmdline
parent04340db392f14e2610189db6f8787e10fbf3c6d0 (diff)
* apt-pkg/cacheset.cc:
- make the cachesets real containers which can embedding any container to be able to use the same interface regardless of set or list usage
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-cache.cc8
-rw-r--r--cmdline/apt-get.cc20
2 files changed, 13 insertions, 15 deletions
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index 82a31c9b1..ee3416ffb 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -65,12 +65,12 @@ public:
return CacheSetHelper::canNotFindNewestVer(Cache, Pkg);
}
- virtual APT::VersionSet canNotFindAllVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) {
+ virtual void canNotFindAllVer(APT::VersionContainerInterface * vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) {
virtualPkgs.insert(Pkg);
- return CacheSetHelper::canNotFindAllVer(Cache, Pkg);
+ CacheSetHelper::canNotFindAllVer(vci, Cache, Pkg);
}
- CacheSetHelperVirtuals(bool const &ShowErrors = true, GlobalError::MsgType const &ErrorType = GlobalError::NOTICE) : CacheSetHelper(ShowErrors, ErrorType) {}
+ CacheSetHelperVirtuals(bool const ShowErrors = true, GlobalError::MsgType const &ErrorType = GlobalError::NOTICE) : CacheSetHelper(ShowErrors, ErrorType) {}
};
/*}}}*/
// LocalitySort - Sort a version list by package file locality /*{{{*/
@@ -108,7 +108,7 @@ void LocalitySort(pkgCache::DescFile **begin,
// UnMet - Show unmet dependencies /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool ShowUnMet(pkgCache::VerIterator const &V, bool const &Important)
+bool ShowUnMet(pkgCache::VerIterator const &V, bool const Important)
{
bool Header = false;
for (pkgCache::DepIterator D = V.DependsList(); D.end() == false;)
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 1925dea87..5ead83ddf 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -628,20 +628,18 @@ public:
explicitlyNamed = true;
}
- virtual void showTaskSelection(APT::PackageSet const &pkgset, string const &pattern) {
- for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg)
- ioprintf(out, _("Note, selecting '%s' for task '%s'\n"),
- Pkg.FullName(true).c_str(), pattern.c_str());
+ virtual void showTaskSelection(pkgCache::PkgIterator const &Pkg, string const &pattern) {
+ ioprintf(out, _("Note, selecting '%s' for task '%s'\n"),
+ Pkg.FullName(true).c_str(), pattern.c_str());
explicitlyNamed = false;
}
- virtual void showRegExSelection(APT::PackageSet const &pkgset, string const &pattern) {
- for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg)
- ioprintf(out, _("Note, selecting '%s' for regex '%s'\n"),
- Pkg.FullName(true).c_str(), pattern.c_str());
+ virtual void showRegExSelection(pkgCache::PkgIterator const &Pkg, string const &pattern) {
+ ioprintf(out, _("Note, selecting '%s' for regex '%s'\n"),
+ Pkg.FullName(true).c_str(), pattern.c_str());
explicitlyNamed = false;
}
virtual void showSelectedVersion(pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const Ver,
- string const &ver, bool const &verIsRel) {
+ string const &ver, bool const verIsRel) {
if (ver == Ver.VerStr())
return;
selectedByRelease.push_back(make_pair(Ver, ver));
@@ -707,7 +705,7 @@ public:
APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, APT::VersionSet::CANDIDATE);
if (verset.empty() == false)
return *(verset.begin());
- if (ShowError == true) {
+ else if (ShowError == true) {
_error->Error(_("Package '%s' has no installation candidate"),Pkg.FullName(true).c_str());
virtualPkgs.insert(Pkg);
}
@@ -769,7 +767,7 @@ struct TryToInstall {
unsigned long AutoMarkChanged;
APT::PackageSet doAutoInstallLater;
- TryToInstall(pkgCacheFile &Cache, pkgProblemResolver *PM, bool const &FixBroken) : Cache(&Cache), Fix(PM),
+ TryToInstall(pkgCacheFile &Cache, pkgProblemResolver *PM, bool const FixBroken) : Cache(&Cache), Fix(PM),
FixBroken(FixBroken), AutoMarkChanged(0) {};
void operator() (pkgCache::VerIterator const &Ver) {