diff options
Diffstat (limited to 'DistUpgrade')
| -rw-r--r-- | DistUpgrade/Changelog | 3 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeCache.py | 2 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeControler.py | 13 | ||||
| -rw-r--r-- | DistUpgrade/DistUpgradeViewGtk.py | 4 |
4 files changed, 21 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..9a03f288 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,28 @@ 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 + # DONT'T ERROR, write a line with mirror here + 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 +133,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 " diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py index d8c55763..3236ba14 100644 --- a/DistUpgrade/DistUpgradeViewGtk.py +++ b/DistUpgrade/DistUpgradeViewGtk.py @@ -196,6 +196,10 @@ class GtkInstallProgressAdapter(InstallProgress): def fork(self): pid = self.term.forkpty(envv=self.env) + if pid == 0: + # HACK to work around bug in python/vte and unregister the logging + # atexit func in the child + sys.exitfunc = lambda: True return pid def statusChange(self, pkg, percent, status): |
