summaryrefslogtreecommitdiff
path: root/DistUpgrade/DistUpgradeCache.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-09-26 21:53:00 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-09-26 21:53:00 +0200
commite4113f9d48f57c82a7b012a8784ca0b1e4a1d230 (patch)
tree5ada2c7867bf049990c20dfa262fcd11a9bb2f26 /DistUpgrade/DistUpgradeCache.py
parentb7c39558155861ae5807e35cc3b6ba932a207c36 (diff)
downloadpython-apt-e4113f9d48f57c82a7b012a8784ca0b1e4a1d230.tar.gz
* DistUpgrade/DistUpgradeCache.py:
- implemented "KeepInstalledSection"
Diffstat (limited to 'DistUpgrade/DistUpgradeCache.py')
-rw-r--r--DistUpgrade/DistUpgradeCache.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py
index 190a17b9..1d5fad53 100644
--- a/DistUpgrade/DistUpgradeCache.py
+++ b/DistUpgrade/DistUpgradeCache.py
@@ -119,6 +119,7 @@ class MyCache(apt.Cache):
and self[pkgname].isInstalled
and self[pkgname].markedDelete):
self[pkgname].markInstall()
+
# first the global list
for pkgname in self.config.getlist("Distro","KeepInstalledPkgs"):
keepInstalled(self, pkgname)
@@ -128,9 +129,19 @@ class MyCache(apt.Cache):
self[key].markedInstall):
for pkgname in self.config.getlist(key,"KeepInstalledPkgs"):
keepInstalled(self, pkgname)
-
-
-
+ # now the keepInstalledSection code
+ for section in self.config.getlist("Distro","KeepInstalledSection"):
+ for pkg in self:
+ if pkg.markedDelete and pkg.section == section:
+ keepInstalled(self, pkgname)
+ # the the per-metapkg rules
+ for key in self.metapkgs:
+ if self.has_key(key) and (self[key].isInstalled or
+ self[key].markedInstall):
+ for section in self.config.getlist(key,"KeepInstalledSection"):
+ for pkg in self:
+ if pkg.markedDelete and pkg.section == section:
+ keepInstalled(self, pkgname)
def postUpgradeRule(self):