diff options
| author | Julian Andres Klode <jak@debian.org> | 2010-01-17 15:41:44 +0100 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2010-01-17 15:41:44 +0100 |
| commit | a1f06a125e59bf06ea8fccea9b584097221c0032 (patch) | |
| tree | 578f5367e8f5649384482c2cae71f8502b541049 | |
| parent | ef77bd9cc237bd3ddae8e22fd325b412ad46ab00 (diff) | |
| download | python-apt-a1f06a125e59bf06ea8fccea9b584097221c0032.tar.gz | |
apt/progress/base.py: Fix some parsing of dpkg status fd.
| -rw-r--r-- | apt/progress/base.py | 12 | ||||
| -rw-r--r-- | debian/changelog | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/apt/progress/base.py b/apt/progress/base.py index 4df26f26..64bb22dc 100644 --- a/apt/progress/base.py +++ b/apt/progress/base.py @@ -223,13 +223,18 @@ class InstallProgress(object): return elif line.startswith('status'): try: - (base, pkgname, status, status_str) = line.split(": ", 3) + (base, pkgname, status, status_str) = line.split(":", 3) except ValueError: - (base, pkgname, status) = line.split(": ", 2) + (base, pkgname, status) = line.split(":", 2) elif line.startswith('processing'): - (status, status_str, pkgname) = line.split(": ", 2) + (status, status_str, pkgname) = line.split(":", 2) self.processing(pkgname.strip(), status_str.strip()) + # Always strip the status message + pkgname = pkgname.strip() + status_str = status_str.strip() + status = status.strip() + if status == 'pmerror' or status == 'error': self.error(pkgname, status_str) elif status == 'conffile-prompt' or status == 'pmconffile': @@ -237,6 +242,7 @@ class InstallProgress(object): if match: self.conffile(match.group(1), match.group(2)) elif status == "pmstatus": + # FIXME: Float comparison if float(percent) != self.percent or status_str != self.status: self.status_change(pkgname, float(percent), status_str.strip()) self.percent = float(percent) diff --git a/debian/changelog b/debian/changelog index 646b9efe..5001f1fe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ python-apt (0.7.93) UNRELEASED; urgency=low * aptsources: - Make all classes subclasses of object. - distro.py: Support Python 3, decode lsb_release results using utf-8. + * apt/progress/base.py: + - Fix some parsing of dpkg status fd. [ Colin Watson ] * apt/progress/__init__.py: |
