summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-09-05 10:58:41 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-09-05 10:58:41 +0200
commite655589f378d67eb14d7547dd97d56d857cf938c (patch)
treea2c7cef91390c0a02f3fc014c2b814afb7934dbe
parentb6ac0674bd17821a971a4b0e2e2a916eda4d1eb2 (diff)
downloadpython-apt-e655589f378d67eb14d7547dd97d56d857cf938c.tar.gz
* DistUpgrade/DistUpgradeCache.py, DistUpgrade.cfg, README:
- added "RemoveEssentialOk" to control if certain essential package are removed
-rw-r--r--DistUpgrade/DistUpgrade.cfg1
-rw-r--r--DistUpgrade/DistUpgradeCache.py4
-rw-r--r--DistUpgrade/README2
3 files changed, 6 insertions, 1 deletions
diff --git a/DistUpgrade/DistUpgrade.cfg b/DistUpgrade/DistUpgrade.cfg
index f063840d..02a77564 100644
--- a/DistUpgrade/DistUpgrade.cfg
+++ b/DistUpgrade/DistUpgrade.cfg
@@ -9,6 +9,7 @@ MetaPkgs=ubuntu-desktop, kubuntu-desktop, edubuntu-desktop, xubuntu-desktop
BaseMetaPkgs=ubuntu-minimal
PostUpgradePurge=xorg-common, libgl1-mesa
Demotions=demoted.cfg
+RemoveEssentialOk=sysvinit
# information about the individual meta-pkgs
[ubuntu-desktop]
diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py
index 37dd96db..1f53b6be 100644
--- a/DistUpgrade/DistUpgradeCache.py
+++ b/DistUpgrade/DistUpgradeCache.py
@@ -197,11 +197,13 @@ class MyCache(apt.Cache):
""" this function tests if the current changes don't violate
our constrains (blacklisted removals etc)
"""
+ removeEssentialOk = self.config.getlist("Distro","RemoveEssentialOk")
for pkg in self.getChanges():
if pkg.markedDelete and self._inRemovalBlacklist(pkg.name):
logging.debug("The package '%s' is marked for removal but it's in the removal blacklist", pkg.name)
return False
- if pkg.markedDelete and pkg._pkg.Essential == True:
+ if pkg.markedDelete and (pkg._pkg.Essential == True and
+ not pkg.name in removeEssentialOk):
logging.debug("The package '%s' is marked for removal but it's a ESSENTIAL package", pkg.name)
return False
return True
diff --git a/DistUpgrade/README b/DistUpgrade/README
index 9d408f43..60c761d6 100644
--- a/DistUpgrade/README
+++ b/DistUpgrade/README
@@ -30,6 +30,8 @@ PostUpgrade{Install,Remove,Purge}:
ForcedObsoletes:
Obsolete packages that the user is asked about after the upgrade (marking
happens *after* the cache.commit())
+RemoveEssentialOk:
+ Those packages are ok to remove even though they are essential
[$meta-pkg]
KeyDependencies: