summaryrefslogtreecommitdiff
path: root/DistUpgrade
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-08-29 12:08:03 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-08-29 12:08:03 +0200
commit908a5b52764aa2073efa52feb2ee8b9c19c31279 (patch)
treef1677849dfdb5537fc992ca06b9583f2c7f26fba /DistUpgrade
parent9ae9f5c1136d645d7caeae8789f2c3a32e06c6cf (diff)
downloadpython-apt-908a5b52764aa2073efa52feb2ee8b9c19c31279.tar.gz
* move the logging to /var/log/dist-upgrade/{main,apt,term}.log
Diffstat (limited to 'DistUpgrade')
-rw-r--r--DistUpgrade/DistUpgradeControler.py15
-rw-r--r--DistUpgrade/DistUpgradeViewGtk.py6
-rwxr-xr-xDistUpgrade/dist-upgrade.py4
3 files changed, 19 insertions, 6 deletions
diff --git a/DistUpgrade/DistUpgradeControler.py b/DistUpgrade/DistUpgradeControler.py
index 3a775099..c01b0f97 100644
--- a/DistUpgrade/DistUpgradeControler.py
+++ b/DistUpgrade/DistUpgradeControler.py
@@ -1,6 +1,6 @@
# DistUpgradeControler.py
#
-# Copyright (c) 2004,2005 Canonical
+# Copyright (c) 2004-2006 Canonical
#
# Author: Michael Vogt <michael.vogt@ubuntu.com>
#
@@ -37,9 +37,20 @@ from gettext import gettext as _
import gettext
from DistUpgradeCache import MyCache
+
+class DistUpgradePolicy(object):
+ """ this is a abstract polciy object that allows to implement different upgrade
+ types (e.g. one for full net upgrades, one for only CDROM upgrades
+ """
+ def __init__(self):
+ pass
+
+
class DistUpgradeControler(object):
+ """ this is the controler that does most of the work """
+
def __init__(self, distUpgradeView):
gettext.bindtextdomain("update-manager",os.path.join(os.getcwd(),"mo"))
gettext.textdomain("update-manager")
@@ -61,7 +72,7 @@ class DistUpgradeControler(object):
# turn on debuging in the cache
apt_pkg.Config.Set("Debug::pkgProblemResolver","true")
- fd = os.open("/var/log/dist-upgrade-apt.log",
+ fd = os.open("/var/log/dist-upgrade/apt.log",
os.O_RDWR|os.O_CREAT|os.O_TRUNC)
os.dup2(fd,1)
os.dup2(fd,2)
diff --git a/DistUpgrade/DistUpgradeViewGtk.py b/DistUpgrade/DistUpgradeViewGtk.py
index 8f9eb62c..d6e69c31 100644
--- a/DistUpgrade/DistUpgradeViewGtk.py
+++ b/DistUpgrade/DistUpgradeViewGtk.py
@@ -337,8 +337,8 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp):
logging.error("not handled expection:\n%s" % "\n".join(lines))
self.error(_("A fatal error occured"),
_("Please report this as a bug and include the "
- "files /var/log/dist-upgrade.log and "
- "/var/log/dist-upgrade-apt.log "
+ "files /var/log/dist-upgrade/main.log and "
+ "/var/log/dist-upgrade/apt.log "
"in your report. The upgrade aborts now.\n"
"Your original sources.list was saved in "
"/etc/apt/sources.list.distUpgrade."),
@@ -355,7 +355,7 @@ class DistUpgradeViewGtk(DistUpgradeView,SimpleGladeApp):
self._term.connect("contents-changed", self._term_content_changed)
self._terminal_lines = []
try:
- self._terminal_log = open("/var/log/dist-upgrade-term.log","w")
+ self._terminal_log = open("/var/log/dist-upgrade/term.log","w")
except IOError:
# if something goes wrong (permission denied etc), use stdout
self._terminal_log = sys.stdout
diff --git a/DistUpgrade/dist-upgrade.py b/DistUpgrade/dist-upgrade.py
index 632de54d..a59e3d07 100755
--- a/DistUpgrade/dist-upgrade.py
+++ b/DistUpgrade/dist-upgrade.py
@@ -8,8 +8,10 @@ import sys
if __name__ == "__main__":
+ if not os.path.exists("/var/log/dist-upgrade"):
+ os.path.mkdir("/var/log/dist-upgrade")
logging.basicConfig(level=logging.DEBUG,
- filename="/var/log/dist-upgrade.log",
+ filename="/var/log/dist-upgrade/main.log",
format='%(asctime)s %(levelname)s %(message)s',
filemode='w')