]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/binary.py
Revert "for the time we test, modify the path to a non-world-visible one"
[dak.git] / daklib / binary.py
index a2601a7205799afd91cc4a79b7e2bdab20d0453c..042cd266070a300f6e62644f8c709866cf6e7de1 100755 (executable)
@@ -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()