diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-09-15 19:56:50 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-09-15 19:56:50 +0200 |
commit | 3b3a681c79d3e5c32fcd6ccb87e74e5ca6e234b4 (patch) | |
tree | 325ff730ac56ff7313f4044d2406f47600d27b35 /apt-pkg | |
parent | 8877870768f3525ae72dc13a438100e90260f4e2 (diff) | |
parent | 58d9e6e0f9bf93724637c8a5687fe22058fc75a1 (diff) |
merged lp:~donkult/apt/sid
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/deb/deblistparser.cc | 6 | ||||
-rw-r--r-- | apt-pkg/depcache.cc | 3 | ||||
-rw-r--r-- | apt-pkg/pkgcache.cc | 1 | ||||
-rw-r--r-- | apt-pkg/pkgcache.h | 2 | ||||
-rw-r--r-- | apt-pkg/policy.cc | 9 |
5 files changed, 15 insertions, 6 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 5fb737970..da8b0271b 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -815,6 +815,12 @@ bool debListParser::LoadReleaseInfo(pkgCache::PkgFileIterator &FileI, if (Section.FindFlag("NotAutomatic",FileI->Flags, pkgCache::Flag::NotAutomatic) == false) _error->Warning("Bad NotAutomatic flag"); + if (Section.FindFlag("ButAutomaticUpgrades",FileI->Flags, + pkgCache::Flag::ButAutomaticUpgrades) == false) + _error->Warning("Bad ButAutomaticUpgrades flag"); + // overrule the NotAutomatic setting if needed as they are both present for compatibility + else if ((FileI->Flags & pkgCache::Flag::ButAutomaticUpgrades) == pkgCache::Flag::ButAutomaticUpgrades) + FileI->Flags &= ~pkgCache::Flag::NotAutomatic; return !_error->PendingError(); } diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 018b05e65..d893c42d7 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1615,7 +1615,8 @@ pkgCache::VerIterator pkgDepCache::Policy::GetCandidateVer(PkgIterator const &Pk /* Stash the highest version of a not-automatic source, we use it if there is nothing better */ - if ((J.File()->Flags & Flag::NotAutomatic) != 0) + if ((J.File()->Flags & Flag::NotAutomatic) != 0 || + (J.File()->Flags & Flag::ButAutomaticUpgrades) != 0) { if (Last.end() == true) Last = I; diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index a66a5198d..324445fa7 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -731,6 +731,7 @@ bool pkgCache::VerIterator::Automatic() const { VerFileIterator Files = FileList(); for (; Files.end() == false; Files++) + // Do not check ButAutomaticUpgrades here as it is kind of automatic… if ((Files.File()->Flags & pkgCache::Flag::NotAutomatic) != pkgCache::Flag::NotAutomatic) return true; return false; diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 799521784..82a69b2ca 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -146,7 +146,7 @@ class pkgCache /*{{{*/ struct Flag { enum PkgFlags {Auto=(1<<0),Essential=(1<<3),Important=(1<<4)}; - enum PkgFFlags {NotSource=(1<<0),NotAutomatic=(1<<1)}; + enum PkgFFlags {NotSource=(1<<0),NotAutomatic=(1<<1),ButAutomaticUpgrades=(1<<2)}; }; protected: diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index a3286391b..4f9d56775 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -16,7 +16,7 @@ 990 = Config file override package files 989 = Start for preference auto-priorities 500 = Default package files - 100 = The status file + 100 = The status file and ButAutomaticUpgrades sources 0 -> 100 = NotAutomatic sources like experimental -inf -> 0 = Never selected @@ -70,9 +70,10 @@ bool pkgPolicy::InitDefaults() PFPriority[I->ID] = 500; if ((I->Flags & pkgCache::Flag::NotSource) == pkgCache::Flag::NotSource) PFPriority[I->ID] = 100; - else - if ((I->Flags & pkgCache::Flag::NotAutomatic) == pkgCache::Flag::NotAutomatic) - PFPriority[I->ID] = 1; + else if ((I->Flags & pkgCache::Flag::ButAutomaticUpgrades) == pkgCache::Flag::ButAutomaticUpgrades) + PFPriority[I->ID] = 100; + else if ((I->Flags & pkgCache::Flag::NotAutomatic) == pkgCache::Flag::NotAutomatic) + PFPriority[I->ID] = 1; } // Apply the defaults.. |