]> git.decadent.org.uk Git - dak.git/commitdiff
Use UnpackedSource in make-changelog.
authorTorsten Werner <twerner@debian.org>
Wed, 23 Mar 2011 13:52:41 +0000 (14:52 +0100)
committerTorsten Werner <twerner@debian.org>
Wed, 23 Mar 2011 13:52:41 +0000 (14:52 +0100)
Signed-off-by: Torsten Werner <twerner@debian.org>
dak/make_changelog.py

index 0a76bcc1118d7f80cef661a461a6fae6bf6053c6..f55f1dd8d380673f1bfe26dad39dd6e9555f8442 100755 (executable)
@@ -52,12 +52,12 @@ Generate changelog entry between two suites
 import os
 import sys
 import apt_pkg
-from commands import getstatusoutput
 from glob import glob
 from shutil import rmtree
 from daklib.dbconn import *
 from daklib import utils
 from daklib.config import Config
+from daklib.contents import UnpackedSource
 from daklib.regexes import re_no_epoch
 
 ################################################################################
@@ -202,14 +202,11 @@ def export_files(session, pool, clpool, temppath):
                         pass
                     os.link(os.path.join(path, file), os.path.join(path, link))
 
-    tempdir = utils.temp_dirname(parent=temppath)
-    os.rmdir(tempdir)
-
     for p in unpack.keys():
         package = os.path.splitext(os.path.basename(p))[0].split('_')
-        cmd = 'dpkg-source --no-check --no-copy -x %s %s' % (p, tempdir)
-        (result, output) = getstatusoutput(cmd)
-        if not result:
+        try:
+            unpacked = UnpackedSource(p)
+            tempdir = unpacked.get_root_directory()
             stats['unpack'] += 1
             for file in files:
                 for f in glob(os.path.join(tempdir, 'debian', '*%s' % file)):
@@ -227,13 +224,12 @@ def export_files(session, pool, clpool, temppath):
                             pass
                         os.link(version, suite)
                         stats['created'] += 1
-        else:
+            unpacked.cleanup()
+        except:
             print 'make-changelog: unable to unpack %s_%s: %s' \
                    % (package[0], package[1], output)
             stats['errors'] += 1
 
-        rmtree(tempdir)
-
     for root, dirs, files in os.walk(clpool):
         if len(files):
             if root.split('/')[-1] not in sources.keys():