summaryrefslogtreecommitdiff
path: root/DistUpgrade/DistUpgradeCache.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-02-02 15:50:23 +0000
committerMichael Vogt <michael.vogt@ubuntu.com>2006-02-02 15:50:23 +0000
commit0f3e83010710cf3493c0c9f2bab16e5f028c114c (patch)
treecbc4290f4582fc81eb4147f75502357d4e0cb348 /DistUpgrade/DistUpgradeCache.py
parent442066f04db10be923c15455d16155358a6d5321 (diff)
downloadpython-apt-0f3e83010710cf3493c0c9f2bab16e5f028c114c.tar.gz
* make the Config-File more usable
Diffstat (limited to 'DistUpgrade/DistUpgradeCache.py')
-rw-r--r--DistUpgrade/DistUpgradeCache.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py
index c7cb89f3..45d892c7 100644
--- a/DistUpgrade/DistUpgradeCache.py
+++ b/DistUpgrade/DistUpgradeCache.py
@@ -5,6 +5,7 @@ import os
import re
import logging
from gettext import gettext as _
+from DistUpgradeConfigParser import DistUpgradeConfigParser
class MyCache(apt.Cache):
# init
@@ -12,6 +13,9 @@ class MyCache(apt.Cache):
apt.Cache.__init__(self, progress)
self.to_install = []
self.to_remove = []
+
+ self.config = DistUpgradeConfigParser()
+
# turn on debuging
apt_pkg.Config.Set("Debug::pkgProblemResolver","true")
fd = os.open(os.path.expanduser("~/dist-upgrade-apt.log"), os.O_RDWR|os.O_CREAT|os.O_TRUNC)
@@ -161,14 +165,12 @@ class MyCache(apt.Cache):
return metapkg_found
# now check for ubuntu-desktop, kubuntu-desktop, edubuntu-desktop
- metapkgs = {"ubuntu-desktop": ["gdm","gnome-panel", "ubuntu-artwork"],
- "kubuntu-desktop": ["kdm", "kicker",
- "kubuntu-artwork-usplash"],
- "edubuntu-desktop": ["edubuntu-artwork", "tuxpaint"]
- }
+ metapkgs = self.config.getlist("Distro","MetaPkgs")
# we never go without ubuntu-base
- self["ubuntu-base"].markInstall()
+ for pkg in self.config.getlist("Distro","BaseMetaPkgs"):
+ self[pkg].markInstall()
+
# every meta-pkg that is installed currently, will be marked
# install (that result in a upgrade and removes a markDelete)
for key in metapkgs:
@@ -182,7 +184,7 @@ class MyCache(apt.Cache):
logging.debug("no {ubuntu,edubuntu,kubuntu}-desktop pkg installed")
for key in metapkgs:
deps_found = True
- for pkg in metapkgs[key]:
+ for pkg in self.config.getlist(key,"KeyDependencies"):
deps_found &= self.has_key(pkg) and self[pkg].isInstalled
if deps_found:
logging.debug("guessing '%s' as missing meta-pkg" % key)
@@ -208,8 +210,6 @@ class MyCache(apt.Cache):
"above first using synaptic or "
"apt-get before proceeding."))
return False
-
- # FIXME: check for ubuntu-desktop, kubuntu-dekstop, edubuntu-desktop
return True
def _inRemovalBlacklist(self, pkgname):