summaryrefslogtreecommitdiff
path: root/apt/progress
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-06-12 19:36:08 +0200
committerJulian Andres Klode <jak@debian.org>2009-06-12 19:36:08 +0200
commit9a968fbe949fc6f13a8a7074197156f3682b7682 (patch)
tree42f20c7db17970a97cac85c1c5aeeee1f6ab9e44 /apt/progress
parent395b33f9f8e93223f933c625bacbf1e2d23c6673 (diff)
parent81a030505cb46a35f670150929fad5862cd12767 (diff)
downloadpython-apt-9a968fbe949fc6f13a8a7074197156f3682b7682.tar.gz
apt/progress.py: Extract the package name from the status message (Closes: #532660)
Diffstat (limited to 'apt/progress')
-rw-r--r--apt/progress/__init__.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py
index 47d2a861..a6287dc4 100644
--- a/apt/progress/__init__.py
+++ b/apt/progress/__init__.py
@@ -367,13 +367,15 @@ class DpkgInstallProgress(InstallProgress):
def run(self, debfile):
"""Start installing the given Debian package."""
- self.debfile = debfile
- self.debname = os.path.basename(debfile).split("_")[0]
+ if apt_pkg._COMPAT_0_7: # Deprecated stuff
+ self.debfile = debfile
+ self.debname = os.path.basename(debfile).split("_")[0]
+
pid = self.fork()
if pid == 0:
# child
res = os.system("/usr/bin/dpkg --status-fd %s -i %s" % \
- (self.writefd, self.debfile))
+ (self.writefd, debfile))
os._exit(os.WEXITSTATUS(res))
self.child_pid = pid
res = self.wait_child()
@@ -399,10 +401,11 @@ class DpkgInstallProgress(InstallProgress):
print "got garbage from dpkg: '%s'" % self.read
self.read = ""
break
+ pkg_name = statusl[1].strip()
status = statusl[2].strip()
#print status
if status == "error":
- self.error(self.debname, status)
+ self.error(pkg_name, status)
elif status == "conffile-prompt":
# we get a string like this:
# 'current-conffile' 'new-conffile' useredited distedited