diff options
| author | Sebastian Heinlein <sebi@sebi-pc> | 2006-09-26 10:47:19 +0200 |
|---|---|---|
| committer | Sebastian Heinlein <sebi@sebi-pc> | 2006-09-26 10:47:19 +0200 |
| commit | dd3fbec4f2bb0ecbf237b058f85175c5d0befce9 (patch) | |
| tree | e00d94e7c77b45f8ac9792a9c80a68e2a2391d7c /DistUpgrade/DistUpgradeCache.py | |
| parent | 4de7b5c16a98fcc5e6d9ff4d32ca289c44a5192b (diff) | |
| parent | 90a9b9f0faf09a401693f7cfcbd362ff62559929 (diff) | |
| download | python-apt-dd3fbec4f2bb0ecbf237b058f85175c5d0befce9.tar.gz | |
* merge with mvo
Diffstat (limited to 'DistUpgrade/DistUpgradeCache.py')
| -rw-r--r-- | DistUpgrade/DistUpgradeCache.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py index 680e7d9e..8427bb3d 100644 --- a/DistUpgrade/DistUpgradeCache.py +++ b/DistUpgrade/DistUpgradeCache.py @@ -1,6 +1,7 @@ import warnings warnings.filterwarnings("ignore", "apt API not stable yet", FutureWarning) +warnings.filterwarnings("ignore", "apt API not stable yet", FutureWarning) import apt import apt_pkg import os @@ -66,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() @@ -155,7 +158,7 @@ class MyCache(apt.Cache): except SystemError, e: # FIXME: change the text to something more useful view.error(_("Could not calculate the upgrade"), - _("A unresolvable problem occured while " + _("A unresolvable problem occurred while " "calculating the upgrade.\n\n" "Please report this bug against the 'update-manager' " "package and include the files in /var/log/dist-upgrade/ " @@ -259,7 +262,7 @@ class MyCache(apt.Cache): "ubuntu-desktop, kubuntu-desktop or " "edubuntu-desktop package and it was not " "possible to detect which version of " - "ubuntu you are runing.\n " + "ubuntu you are running.\n " "Please install one of the packages " "above first using synaptic or " "apt-get before proceeding.")) @@ -315,3 +318,8 @@ class MyCache(apt.Cache): if foreign: foreign_pkgs.add(pkg.name) return foreign_pkgs + +if __name__ == "__main__": + import DistUpgradeConfigParser + c = MyCache(DistUpgradeConfigParser.DistUpgradeConfig(".")) + c.clear() |
