summaryrefslogtreecommitdiff
path: root/DistUpgrade/DistUpgradeCache.py
diff options
context:
space:
mode:
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):