summaryrefslogtreecommitdiff
path: root/DistUpgrade
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-01-09 13:47:57 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2006-01-09 13:47:57 +0100
commitb58767216ae4752239ff32cad4d57017d1ea6114 (patch)
tree977e2f3ee1fba94a6fddfff2b281b6414cfb1fd0 /DistUpgrade
parent1a75430ab1bb49b25466b7d495f2ac50f7febc05 (diff)
downloadpython-apt-b58767216ae4752239ff32cad4d57017d1ea6114.tar.gz
* fixes in the logging code
Diffstat (limited to 'DistUpgrade')
-rw-r--r--DistUpgrade/DistUpgradeControler.py15
-rwxr-xr-xDistUpgrade/dist-upgrade.py2
2 files changed, 11 insertions, 6 deletions
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py
index c20de699..546c3897 100644
--- a/DistUpgrade/DistUpgradeControler.py
+++ b/DistUpgrade/DistUpgradeControler.py
@@ -37,8 +37,8 @@ class MyCache(apt.Cache):
def __init__(self, progress=None):
apt.Cache.__init__(self, progress)
# turn on debuging
- apt.Config.Set("Debug::pkgProblemResolver","true")
- fd = os.open(os.path.expanduser("~/dist-upgrade-apt.log", os.O_RDWR|os.O_CREAT)
+ apt_pkg.Config.Set("Debug::pkgProblemResolver","true")
+ fd = os.open(os.path.expanduser("~/dist-upgrade-apt.log"=, os.O_RDWR|os.O_CREAT)
os.dup2(fd,1)
os.dup2(fd,2)
@@ -277,10 +277,13 @@ class DistUpgradeControler(object):
changes = self.cache.getChanges()
# debuging output
logging.debug("About to apply the following changes")
- for pkg in caches:
- if cache[pkg].markedInstall: logging.debug("Inst: %s" % pkg.name)
- elif cache[pkg].markedUpgrade: logging.debug("Up: %s" % pkg.name)
- elif cache[pkg].markedDelete: logging.debug("Del: %s" % pkg.name)
+ for pkg in self.cache:
+ if self.cache[pkg].markedInstall:
+ logging.debug("Inst: %s" % pkg.name)
+ elif self.cache[pkg].markedUpgrade:
+ logging.debug("Up: %s" % pkg.name)
+ elif self.cache[pkg].markedDelete:
+ logging.debug("Del: %s" % pkg.name)
# ask the user if he wants to do the changes
res = self._view.confirmChanges(changes,self.cache.requiredDownload)
return res
diff --git a/DistUpgrade/dist-upgrade.py b/DistUpgrade/dist-upgrade.py
index 132d92df..fa04adec 100755
--- a/DistUpgrade/dist-upgrade.py
+++ b/DistUpgrade/dist-upgrade.py
@@ -3,6 +3,7 @@
from DistUpgradeViewGtk import GtkDistUpgradeView
from DistUpgradeControler import DistUpgradeControler
import logging
+import os
if __name__ == "__main__":
@@ -11,6 +12,7 @@ if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG,
filename=os.path.expanduser("~/dist-upgrade.log"),
+ format='%(levelname)s %(message)s',
filemode='w')
app.run()