From 8ca43939eb2f608cf0250d90894b470e785713b9 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Sun, 31 May 2009 01:03:54 +0200 Subject: Extract the package name from the status message --- apt/progress/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py index 47d2a861..fddc7486 100644 --- a/apt/progress/__init__.py +++ b/apt/progress/__init__.py @@ -399,10 +399,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 -- cgit v1.2.3 From 81a030505cb46a35f670150929fad5862cd12767 Mon Sep 17 00:00:00 2001 From: Sebastian Heinlein Date: Sun, 31 May 2009 01:05:48 +0200 Subject: Do not store the the Deb path and package name as an attribute of the progress class. Furthermore allow to specify more than one file. --- apt/progress/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apt/progress/__init__.py b/apt/progress/__init__.py index fddc7486..6b170fc7 100644 --- a/apt/progress/__init__.py +++ b/apt/progress/__init__.py @@ -367,13 +367,11 @@ class DpkgInstallProgress(InstallProgress): def run(self, debfile): """Start installing the given Debian package.""" - 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() -- cgit v1.2.3