From c4c1197922edb4f82390f7e0f125be34863d24d3 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 1 Dec 2011 12:03:16 +0100 Subject: * apt/progress/base.py: - write exception text to stderr to avoid hidding exceptions like "pre-configure failed" from libapt (thanks to Jean-Baptiste Lallement) --- apt/progress/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apt/progress') diff --git a/apt/progress/base.py b/apt/progress/base.py index 97375431..4943978c 100644 --- a/apt/progress/base.py +++ b/apt/progress/base.py @@ -27,6 +27,7 @@ import fcntl import os import re import select +import sys import apt_pkg @@ -196,7 +197,8 @@ class InstallProgress(object): os._exit(os.spawnlp(os.P_WAIT, "dpkg", "dpkg", "--status-fd", str(self.write_stream.fileno()), "-i", obj)) - except Exception: + except Exception as e: + sys.stderr.write("%s\n" % e) os._exit(apt_pkg.PackageManager.RESULT_FAILED) self.child_pid = pid -- cgit v1.2.3 From c8bfdda85fbd2df250fbc6d3faeb2bd5875a77d6 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 1 Dec 2011 13:32:42 +0100 Subject: py3 fixes/clean --- apt/progress/base.py | 2 ++ tests/test_debfile.py | 4 ++-- tests/test_utils.py | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'apt/progress') diff --git a/apt/progress/base.py b/apt/progress/base.py index 4943978c..c2a9a9c8 100644 --- a/apt/progress/base.py +++ b/apt/progress/base.py @@ -192,12 +192,14 @@ class InstallProgress(object): # and the execution continues in the # parent code leading to very confusing bugs try: + raise Exception("foo") os._exit(obj.do_install(self.write_stream.fileno())) except AttributeError: os._exit(os.spawnlp(os.P_WAIT, "dpkg", "dpkg", "--status-fd", str(self.write_stream.fileno()), "-i", obj)) except Exception as e: + os.write(self.writefd, "pmerror:::%s" % e) sys.stderr.write("%s\n" % e) os._exit(apt_pkg.PackageManager.RESULT_FAILED) diff --git a/tests/test_debfile.py b/tests/test_debfile.py index 501b8f61..56410153 100644 --- a/tests/test_debfile.py +++ b/tests/test_debfile.py @@ -131,12 +131,12 @@ Description: testpackage for gdebi - contains usr/bin/binary for file reading self.assertTrue(raised) def test_multiarch_deb(self): - print apt_pkg.get_architectures() if apt_pkg.get_architectures() != ["amd64", "i386"]: logging.warn("skipping test because running on a non-multiarch system") return deb = apt.debfile.DebPackage("./data/test_debs/multiarch-test1_i386.deb") - print deb.missing_deps() + res = deb.check() + # FIXME: do something sensible with the multiarch test diff --git a/tests/test_utils.py b/tests/test_utils.py index 23511f32..26ee0bff 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -7,7 +7,6 @@ # notice and this notice are preserved. import sys -sys.path.insert(0, "..") import apt_pkg import apt.utils import datetime -- cgit v1.2.3 From 1c6b01aa63e440444f00ec9e3f527e1c65a63787 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 1 Dec 2011 13:55:04 +0100 Subject: apt/progress/base.py: fix silly leftover from last commit --- apt/progress/base.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'apt/progress') diff --git a/apt/progress/base.py b/apt/progress/base.py index c2a9a9c8..4943978c 100644 --- a/apt/progress/base.py +++ b/apt/progress/base.py @@ -192,14 +192,12 @@ class InstallProgress(object): # and the execution continues in the # parent code leading to very confusing bugs try: - raise Exception("foo") os._exit(obj.do_install(self.write_stream.fileno())) except AttributeError: os._exit(os.spawnlp(os.P_WAIT, "dpkg", "dpkg", "--status-fd", str(self.write_stream.fileno()), "-i", obj)) except Exception as e: - os.write(self.writefd, "pmerror:::%s" % e) sys.stderr.write("%s\n" % e) os._exit(apt_pkg.PackageManager.RESULT_FAILED) -- cgit v1.2.3