From b639a0b9e593eef0412d473560c616eb15364c6e Mon Sep 17 00:00:00 2001 From: Luca Falavigna Date: Mon, 29 Apr 2013 13:38:34 +0000 Subject: [PATCH] Allow to specify a custom unpack directory in UnpackedSource class --- dak/make_changelog.py | 2 +- daklib/contents.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dak/make_changelog.py b/dak/make_changelog.py index 8f7453c9..1f1b1ca3 100755 --- a/dak/make_changelog.py +++ b/dak/make_changelog.py @@ -213,7 +213,7 @@ def export_files(session, archive, clpool, progress=False): for p in unpack.keys(): package = os.path.splitext(os.path.basename(p))[0].split('_') try: - unpacked = UnpackedSource(p) + unpacked = UnpackedSource(p, clpool) tempdir = unpacked.get_root_directory() stats['unpack'] += 1 if progress: diff --git a/daklib/contents.py b/daklib/contents.py index 07734075..e5abcac6 100644 --- a/daklib/contents.py +++ b/daklib/contents.py @@ -394,11 +394,12 @@ class UnpackedSource(object): UnpackedSource extracts a source package into a temporary location and gives you some convinient function for accessing it. ''' - def __init__(self, dscfilename): + def __init__(self, dscfilename, tmpbasedir=None): ''' The dscfilename is a name of a DSC file that will be extracted. ''' - temp_directory = mkdtemp(dir = Config()['Dir::TempPath']) + basedir = tmpbasedir if tmpbasedir else Config()['Dir::TempPath'] + temp_directory = mkdtemp(dir = basedir) self.root_directory = os.path.join(temp_directory, 'root') command = ('dpkg-source', '--no-copy', '--no-check', '-q', '-x', dscfilename, self.root_directory) -- 2.39.5