projects
/
apt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* ftparchive/writer.cc:
[apt.git]
/
apt-pkg
/
policy.cc
diff --git
a/apt-pkg/policy.cc
b/apt-pkg/policy.cc
index a3286391bc7ff6146ce04f76b4821e18fb4ff957..5427271b6108b5e67a808fbd458691e26dc88889 100644
(file)
--- 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
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
0 -> 100 = NotAutomatic sources like experimental
-inf -> 0 = Never selected
@@
-45,6
+45,8
@@
using namespace std;
file matches the V0 policy engine. */
pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner)
{
file matches the V0 policy engine. */
pkgPolicy::pkgPolicy(pkgCache *Owner) : Pins(0), PFPriority(0), Cache(Owner)
{
+ if (Owner == 0 || &(Owner->Head()) == 0)
+ return;
PFPriority = new signed short[Owner->Head().PackageFileCount];
Pins = new Pin[Owner->Head().PackageCount];
PFPriority = new signed short[Owner->Head().PackageFileCount];
Pins = new Pin[Owner->Head().PackageCount];
@@
-70,9
+72,10
@@
bool pkgPolicy::InitDefaults()
PFPriority[I->ID] = 500;
if ((I->Flags & pkgCache::Flag::NotSource) == pkgCache::Flag::NotSource)
PFPriority[I->ID] = 100;
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..
}
// Apply the defaults..
@@
-327,7
+330,7
@@
bool ReadPinFile(pkgPolicy &Plcy,string File)
if (File.empty() == true)
File = _config->FindFile("Dir::Etc::Preferences");
if (File.empty() == true)
File = _config->FindFile("Dir::Etc::Preferences");
- if (FileExists(File) == false)
+ if (
Real
FileExists(File) == false)
return true;
FileFd Fd(File,FileFd::ReadOnly);
return true;
FileFd Fd(File,FileFd::ReadOnly);