summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/algorithms.h2
-rw-r--r--apt-pkg/cacheiterators.h32
-rw-r--r--apt-pkg/depcache.cc4
-rw-r--r--apt-pkg/depcache.h6
-rw-r--r--apt-pkg/pkgcache.cc12
-rw-r--r--apt-pkg/policy.h2
-rw-r--r--debian/changelog4
7 files changed, 32 insertions, 30 deletions
diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h
index cee30b679..cf4a98c4f 100644
--- a/apt-pkg/algorithms.h
+++ b/apt-pkg/algorithms.h
@@ -48,7 +48,7 @@ class pkgSimulate : public pkgPackageManager /*{{{*/
pkgDepCache *Cache;
public:
- virtual VerIterator GetCandidateVer(PkgIterator Pkg)
+ virtual VerIterator GetCandidateVer(PkgIterator const &Pkg)
{
return (*Cache)[Pkg].CandidateVerIter(*Cache);
}
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h
index 51bf6819e..dfe5707e1 100644
--- a/apt-pkg/cacheiterators.h
+++ b/apt-pkg/cacheiterators.h
@@ -105,13 +105,13 @@ class pkgCache::GrpIterator: public Iterator<Group, GrpIterator> {
inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;};
inline PkgIterator PackageList() const;
- PkgIterator FindPkg(string Arch = "any");
+ PkgIterator FindPkg(string Arch = "any") const;
/** \brief find the package with the "best" architecture
The best architecture is either the "native" or the first
in the list of Architectures which is not an end-Pointer */
- PkgIterator FindPreferredPkg();
- PkgIterator NextPkg(PkgIterator const &Pkg);
+ PkgIterator FindPreferredPkg() const;
+ PkgIterator NextPkg(PkgIterator const &Pkg) const;
// Constructors
inline GrpIterator(pkgCache &Owner, Group *Trg) : Iterator<Group, GrpIterator>(Owner, Trg), HashIndex(0) {
@@ -272,17 +272,17 @@ class pkgCache::DepIterator : public Iterator<Dependency, DepIterator> {
// Accessors
inline const char *TargetVer() const {return S->Version == 0?0:Owner->StrP + S->Version;};
- inline PkgIterator TargetPkg() {return PkgIterator(*Owner,Owner->PkgP + S->Package);};
- inline PkgIterator SmartTargetPkg() {PkgIterator R(*Owner,0);SmartTargetPkg(R);return R;};
- inline VerIterator ParentVer() {return VerIterator(*Owner,Owner->VerP + S->ParentVer);};
- inline PkgIterator ParentPkg() {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[S->ParentVer].ParentPkg);};
- inline bool Reverse() {return Type == DepRev;};
- bool IsCritical();
+ inline PkgIterator TargetPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->Package);};
+ inline PkgIterator SmartTargetPkg() const {PkgIterator R(*Owner,0);SmartTargetPkg(R);return R;};
+ inline VerIterator ParentVer() const {return VerIterator(*Owner,Owner->VerP + S->ParentVer);};
+ inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[S->ParentVer].ParentPkg);};
+ inline bool Reverse() const {return Type == DepRev;};
+ bool IsCritical() const;
void GlobOr(DepIterator &Start,DepIterator &End);
- Version **AllTargets();
- bool SmartTargetPkg(PkgIterator &Result);
- inline const char *CompType() {return Owner->CompType(S->CompareOp);};
- inline const char *DepType() {return Owner->DepType(S->Type);};
+ Version **AllTargets() const;
+ bool SmartTargetPkg(PkgIterator &Result) const;
+ inline const char *CompType() const {return Owner->CompType(S->CompareOp);};
+ inline const char *DepType() const {return Owner->DepType(S->Type);};
inline DepIterator(pkgCache &Owner, Dependency *Trg, Version* = 0) :
Iterator<Dependency, DepIterator>(Owner, Trg), Type(DepVer) {
@@ -315,9 +315,9 @@ class pkgCache::PrvIterator : public Iterator<Provides, PrvIterator> {
// Accessors
inline const char *Name() const {return Owner->StrP + Owner->PkgP[S->ParentPkg].Name;};
inline const char *ProvideVersion() const {return S->ProvideVersion == 0?0:Owner->StrP + S->ProvideVersion;};
- inline PkgIterator ParentPkg() {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);};
- inline VerIterator OwnerVer() {return VerIterator(*Owner,Owner->VerP + S->Version);};
- inline PkgIterator OwnerPkg() {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[S->Version].ParentPkg);};
+ inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);};
+ inline VerIterator OwnerVer() const {return VerIterator(*Owner,Owner->VerP + S->Version);};
+ inline PkgIterator OwnerPkg() const {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[S->Version].ParentPkg);};
inline PrvIterator() : Iterator<Provides, PrvIterator>(), Type(PrvVer) {};
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index c93993ab1..05127fe18 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -1585,7 +1585,7 @@ const char *pkgDepCache::StateCache::StripEpoch(const char *Ver)
// ---------------------------------------------------------------------
/* The default just returns the highest available version that is not
a source and automatic. */
-pkgCache::VerIterator pkgDepCache::Policy::GetCandidateVer(PkgIterator Pkg)
+pkgCache::VerIterator pkgDepCache::Policy::GetCandidateVer(PkgIterator const &Pkg)
{
/* Not source/not automatic versions cannot be a candidate version
unless they are already installed */
@@ -1620,7 +1620,7 @@ pkgCache::VerIterator pkgDepCache::Policy::GetCandidateVer(PkgIterator Pkg)
// Policy::IsImportantDep - True if the dependency is important /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool pkgDepCache::Policy::IsImportantDep(DepIterator Dep)
+bool pkgDepCache::Policy::IsImportantDep(DepIterator const &Dep)
{
if(Dep.IsCritical())
return true;
diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h
index 66c099b80..45276dc95 100644
--- a/apt-pkg/depcache.h
+++ b/apt-pkg/depcache.h
@@ -256,8 +256,8 @@ class pkgDepCache : protected pkgCache::Namespace
{
public:
- virtual VerIterator GetCandidateVer(PkgIterator Pkg);
- virtual bool IsImportantDep(DepIterator Dep);
+ virtual VerIterator GetCandidateVer(PkgIterator const &Pkg);
+ virtual bool IsImportantDep(DepIterator const &Dep);
virtual ~Policy() {};
};
@@ -334,7 +334,7 @@ class pkgDepCache : protected pkgCache::Namespace
inline pkgVersioningSystem &VS() {return *Cache->VS;};
// Policy implementation
- inline VerIterator GetCandidateVer(PkgIterator Pkg) {return LocalPolicy->GetCandidateVer(Pkg);};
+ inline VerIterator GetCandidateVer(PkgIterator const &Pkg) {return LocalPolicy->GetCandidateVer(Pkg);};
inline bool IsImportantDep(DepIterator Dep) {return LocalPolicy->IsImportantDep(Dep);};
inline Policy &GetPolicy() {return *LocalPolicy;};
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index 30bb41470..68aa83d0c 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -307,7 +307,7 @@ const char *pkgCache::Priority(unsigned char Prio)
// GrpIterator::FindPkg - Locate a package by arch /*{{{*/
// ---------------------------------------------------------------------
/* Returns an End-Pointer on error, pointer to the package otherwise */
-pkgCache::PkgIterator pkgCache::GrpIterator::FindPkg(string Arch) {
+pkgCache::PkgIterator pkgCache::GrpIterator::FindPkg(string Arch) const {
if (unlikely(IsGood() == false || S->FirstPackage == 0))
return PkgIterator(*Owner, 0);
@@ -346,7 +346,7 @@ pkgCache::PkgIterator pkgCache::GrpIterator::FindPkg(string Arch) {
// GrpIterator::FindPreferredPkg - Locate the "best" package /*{{{*/
// ---------------------------------------------------------------------
/* Returns an End-Pointer on error, pointer to the package otherwise */
-pkgCache::PkgIterator pkgCache::GrpIterator::FindPreferredPkg() {
+pkgCache::PkgIterator pkgCache::GrpIterator::FindPreferredPkg() const {
pkgCache::PkgIterator Pkg = FindPkg("native");
if (Pkg.end() == false)
return Pkg;
@@ -367,7 +367,7 @@ pkgCache::PkgIterator pkgCache::GrpIterator::FindPreferredPkg() {
/* Returns an End-Pointer on error, pointer to the package otherwise.
We can't simply ++ to the next as the next package of the last will
be from a different group (with the same hash value) */
-pkgCache::PkgIterator pkgCache::GrpIterator::NextPkg(pkgCache::PkgIterator const &LastPkg) {
+pkgCache::PkgIterator pkgCache::GrpIterator::NextPkg(pkgCache::PkgIterator const &LastPkg) const {
if (unlikely(IsGood() == false || S->FirstPackage == 0 ||
LastPkg.end() == true))
return PkgIterator(*Owner, 0);
@@ -504,7 +504,7 @@ std::string pkgCache::PkgIterator::FullName(bool const &Pretty) const
// ---------------------------------------------------------------------
/* Currently critical deps are defined as depends, predepends and
conflicts (including dpkg's Breaks fields). */
-bool pkgCache::DepIterator::IsCritical()
+bool pkgCache::DepIterator::IsCritical() const
{
if (S->Type == pkgCache::Dep::Conflicts ||
S->Type == pkgCache::Dep::DpkgBreaks ||
@@ -528,7 +528,7 @@ bool pkgCache::DepIterator::IsCritical()
In Conjunction with the DepCache the value of Result may not be
super-good since the policy may have made it uninstallable. Using
AllTargets is better in this case. */
-bool pkgCache::DepIterator::SmartTargetPkg(PkgIterator &Result)
+bool pkgCache::DepIterator::SmartTargetPkg(PkgIterator &Result) const
{
Result = TargetPkg();
@@ -577,7 +577,7 @@ bool pkgCache::DepIterator::SmartTargetPkg(PkgIterator &Result)
provides. It includes every possible package-version that could satisfy
the dependency. The last item in the list has a 0. The resulting pointer
must be delete [] 'd */
-pkgCache::Version **pkgCache::DepIterator::AllTargets()
+pkgCache::Version **pkgCache::DepIterator::AllTargets() const
{
Version **Res = 0;
unsigned long Size =0;
diff --git a/apt-pkg/policy.h b/apt-pkg/policy.h
index 28cb3ccbb..f8b2678de 100644
--- a/apt-pkg/policy.h
+++ b/apt-pkg/policy.h
@@ -76,7 +76,7 @@ class pkgPolicy : public pkgDepCache::Policy
// Things for the cache interface.
virtual pkgCache::VerIterator GetCandidateVer(pkgCache::PkgIterator const &Pkg);
- virtual bool IsImportantDep(pkgCache::DepIterator Dep) {return pkgDepCache::Policy::IsImportantDep(Dep);};
+ virtual bool IsImportantDep(pkgCache::DepIterator const &Dep) {return pkgDepCache::Policy::IsImportantDep(Dep);};
bool InitDefaults();
pkgPolicy(pkgCache *Owner);
diff --git a/debian/changelog b/debian/changelog
index d7c6b8d0c..0b1ca3cf1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -32,7 +32,9 @@ apt (0.7.26~exp8) UNRELEASED; urgency=low
* apt-pkg/contrib/fileutl.cc:
- show notice about ignored file instead of being always silent
- add a Dir::Ignore-Files-Silently list option to control the notice
- *
+ * apt-pkg/policy.h:
+ - add another round of const& madness as the previous round accidently
+ NOT override the virtual GetCandidateVer() method (Closes: #587725)
-- David Kalnischkies <kalnischkies@gmail.com> Mon, 28 Jun 2010 22:12:24 +0200