From c2172227d8c1b7f5875c027ad597af1a81c51495 Mon Sep 17 00:00:00 2001 From: Joerg Jaspert Date: Thu, 26 Feb 2009 00:28:19 +0100 Subject: [PATCH] Revert "Merge branch 'merge'" This reverts commit 16f020f22ddc10b88ee076f2ac86d33cbc7769e5. Signed-off-by: Joerg Jaspert --- daklib/binary.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/daklib/binary.py b/daklib/binary.py index a2601a72..042cd266 100755 --- a/daklib/binary.py +++ b/daklib/binary.py @@ -133,8 +133,6 @@ class Binary(object): rejected = not self.valid_deb() self.__unpack() - result = False - if not rejected and self.tmpdir: cwd = os.getcwd() try: @@ -149,17 +147,18 @@ class Binary(object): data = tarfile.open(os.path.join(self.tmpdir, "data.tar.bz2" ), "r:bz2") if bootstrap_id: - result = DBConn().insert_content_paths(bootstrap_id, [ tarinfo.name for tarinfo in data if not tarinfo.isdir()]) + return DBConn().insert_content_paths(bootstrap_id, [ tarinfo.name for tarinfo in data if not tarinfo.isdir()]) else: pkg = deb822.Packages.iter_paragraphs( control.extractfile('./control') ).next() - result = DBConn().insert_pending_content_paths(pkg, [ tarinfo.name for tarinfo in data if not tarinfo.isdir()]) + return DBConn().insert_pending_content_paths(pkg, [ tarinfo.name for tarinfo in data if not tarinfo.isdir()]) except: traceback.print_exc() - result = False - os.chdir( cwd ) - return result + return False + + finally: + os.chdir( cwd ) if __name__ == "__main__": Binary( "/srv/ftp.debian.org/queue/accepted/halevt_0.1.3-2_amd64.deb" ).scan_package() -- 2.39.5