diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-04-18 12:55:03 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-04-18 12:55:03 +0200 |
| commit | 4514e8883fc10cb6e8b29fe78ede8bef41858a59 (patch) | |
| tree | ef7f04a2714fdf88656036f7fcf26458dfa43678 /DistUpgrade | |
| parent | a34c35a2528041e658e541692adaa8b542a2e086 (diff) | |
| download | python-apt-4514e8883fc10cb6e8b29fe78ede8bef41858a59.tar.gz | |
* improved logging
* DistUpgrade/Changelog: added
Diffstat (limited to 'DistUpgrade')
| -rw-r--r-- | DistUpgrade/Changelog | 3 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeCache.py | 2 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeControler.py | 12 |
3 files changed, 16 insertions, 1 deletions
diff --git a/DistUpgrade/Changelog b/DistUpgrade/Changelog new file mode 100644 index 00000000..df5bb506 --- /dev/null +++ b/DistUpgrade/Changelog @@ -0,0 +1,3 @@ +2006-04-18: + - add logging to the sources.list modification code + - general logging improvements (thanks to Xavier Poinsard)
\ No newline at end of file diff --git a/DistUpgrade/DistUpgradeCache.py b/DistUpgrade/DistUpgradeCache.py index 2adab2ad..ff3802fa 100644 --- a/DistUpgrade/DistUpgradeCache.py +++ b/DistUpgrade/DistUpgradeCache.py @@ -215,7 +215,7 @@ class MyCache(apt.Cache): logging.debug("Marking '%s' for upgrade" % key) self[key].markUpgrade() except SystemError, e: - logging.debug("Can't mark '%s' for upgrade" % key) + logging.debug("Can't mark '%s' for upgrade (%s)" % (key,e)) return False # check if we have a meta-pkg, if not, try to guess which one to pick if not metaPkgInstalled(): diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py index 17ba46ee..d0fde352 100644 --- a/DistUpgrade/DistUpgradeControler.py +++ b/DistUpgrade/DistUpgradeControler.py @@ -59,6 +59,8 @@ class DistUpgradeControler(object): def updateSourcesList(self): + logging.debug("updateSourcesList()") + # this must map, i.e. second in "from" must be the second in "to" # (but they can be different, so in theory we could exchange # component names here) @@ -79,6 +81,10 @@ class DistUpgradeControler(object): # look over the stuff we have foundToDist = False for entry in self.sources: + # ignore invalid records (but update disabled ones) + if entry.invalid: + continue + logging.debug("examining: '%s'" % entry) # check if it's a mirror (or offical site) validMirror = False for mirror in valid_mirrors: @@ -87,22 +93,27 @@ class DistUpgradeControler(object): if entry.dist in toDists: # so the self.sources.list is already set to the new # distro + logging.debug("entry '%s' is already set to new dist" % entry) foundToDist = True elif entry.dist in fromDists: foundToDist = True entry.dist = toDists[fromDists.index(entry.dist)] + logging.debug("entry '%s' updated to new dist" % entry) else: # disable all entries that are official but don't # point to the "from" dist entry.disabled = True + logging.debug("entry '%s' was disabled (unknown dist)" % entry) # it can only be one valid mirror, so we can break here break # disable anything that is not from a official mirror if not validMirror: entry.disabled = True + logging.debug("entry '%s' was disabled (unknown mirror)" % entry) if not foundToDist: # FIXME: offer to write a new self.sources.list entry + logging.error("No valid entry found") return self._view.error(_("No valid entry found"), _("While scaning your repository " "information no valid entry for " @@ -121,6 +132,7 @@ class DistUpgradeControler(object): sourceslist = apt_pkg.GetPkgSourceList() sourceslist.ReadMainList() except SystemError: + logging.error("Repository information invalid after updating (we broke it!)") self._view.error(_("Repository information invalid"), _("Upgrading the repository information " "resulted in a invalid file. Please " |
