From bf17713ea0b6bff421d305e8ae91cbb68f46ff8a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 5 Dec 2005 15:17:38 +0100 Subject: * better handling of the sources.list convertation --- DistUpgrade/DistUpgrade.py | 9 ++++++++- SoftwareProperties/aptsources.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/DistUpgrade/DistUpgrade.py b/DistUpgrade/DistUpgrade.py index efe4879b..3241699a 100644 --- a/DistUpgrade/DistUpgrade.py +++ b/DistUpgrade/DistUpgrade.py @@ -53,10 +53,17 @@ class DistUpgradeControler(object): def updateSourcesList(self, fromDist, to): sources = SourcesList() sources.backup() + + fromDists = [fromDist, + fromDist+"-security", + fromDist+"-updates", + fromDist+"-backports" + ] + for entry in sources: # check if it's a mirror (or offical site) if sources.is_mirror("http://archive.ubuntu.com/ubuntu",entry.uri): - if entry.dist == fromDist: + if entry.dist in fromDists: entry.dist = to else: # disable all entries that are official but don't diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py index 504a490b..1c8273f2 100644 --- a/SoftwareProperties/aptsources.py +++ b/SoftwareProperties/aptsources.py @@ -233,7 +233,7 @@ class SourcesList: is given, the current date/time is used (and returned) """ already_backuped = set() if backup_ext == None: - backup_ext = time.strftime("%d%m%y.%H%M") + backup_ext = time.strftime("%y%m%d.%H%M") for source in self.list: if not source.file in already_backuped: shutil.copy(source.file,"%s.%s" % (source.file,backup_ext)) -- cgit v1.2.3