summaryrefslogtreecommitdiff
path: root/DistUpgrade
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-09-22 19:07:42 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-09-22 19:07:42 +0200
commit3c13b603ab6bb720861441a3992bff55831942bf (patch)
tree8f2155c20e1063db508abd81d0b9106635ac9f38 /DistUpgrade
parent1417e173a98b36e10d0e876f668caef090d7b4b7 (diff)
downloadpython-apt-3c13b603ab6bb720861441a3992bff55831942bf.tar.gz
* DistUpgrade/DistUpgradeCache.py:
- add clear() function that is autoMark friendly * DistUpgrade/DistUpgradeControler.py: - bugfixes - pass the old arguments to the new execed child * DistUpgrade/dist-upgrade.py: - remove debug output
Diffstat (limited to 'DistUpgrade')
-rw-r--r--DistUpgrade/DistUpgradeCache.py6
-rw-r--r--DistUpgrade/DistUpgradeControler.py6
-rwxr-xr-xDistUpgrade/dist-upgrade.py3
3 files changed, 8 insertions, 7 deletions
diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py
index 4b6fd680..99f3b585 100644
--- a/DistUpgrade/DistUpgradeCache.py
+++ b/DistUpgrade/DistUpgradeCache.py
@@ -67,10 +67,12 @@ class MyCache(apt.Cache):
if pkg.markedDelete:
self.to_remove.append(pkg.name)
+ def clear(self):
+ self.depcache.Init()
+
def restore_snapshot(self):
""" restore a snapshot """
- for pkg in self:
- pkg.markKeep()
+ self.clear()
for name in self.to_remove:
pkg = self[name]
pkg.markDelete()
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py
index 7d48db69..441952b2 100644
--- a/DistUpgrade/DistUpgradeControler.py
+++ b/DistUpgrade/DistUpgradeControler.py
@@ -557,15 +557,17 @@ class DistUpgradeControler(object):
apt_pkg.Config.FindDir("Dir::Etc::sourceparts"))
# run update
self.doUpdate()
+ self.openCache()
+
# save cachedir and setup new one
cachedir = apt_pkg.Config.Find("Dir::Cache::archives")
cwd = os.getcwd()
backportsdir = os.path.join(os.getcwd(),"backports")
- os.chdir(backportsdir)
if not os.path.exists(backportsdir):
os.mkdir(backportsdir)
if not os.path.exists(os.path.join(backportsdir,"partial")):
os.mkdir(os.path.join(backportsdir,"partial"))
+ os.chdir(backportsdir)
apt_pkg.Config.Set("Dir::Cache::archives",backportsdir)
# mark the backports for upgrade and get them
@@ -623,7 +625,7 @@ class DistUpgradeControler(object):
os.getenv("PATH"))
# now exec self again
- os.execve(sys.argv[0],[sys.argv[0],"--have-backports"], os.environ)
+ os.execve(sys.argv[0],sys.argv+["--have-backports"], os.environ)
# this is the core
def edgyUpgrade(self):
diff --git a/DistUpgrade/dist-upgrade.py b/DistUpgrade/dist-upgrade.py
index 997297c2..7174ce17 100755
--- a/DistUpgrade/dist-upgrade.py
+++ b/DistUpgrade/dist-upgrade.py
@@ -9,9 +9,6 @@ from optparse import OptionParser
if __name__ == "__main__":
- # debug
- print os.environ
-
parser = OptionParser()
parser.add_option("-c", "--cdrom", dest="cdromPath", default=None,
help="Use the given path to search for a cdrom with upgradable packages")