From: Torsten Werner Date: Thu, 24 Mar 2011 21:43:17 +0000 (+0100) Subject: Create temp directory at the preferred location. X-Git-Url: https://git.decadent.org.uk/gitweb/?p=dak.git;a=commitdiff_plain;h=f74884ed707584673bc2066427fa94f3b348d065 Create temp directory at the preferred location. Signed-off-by: Torsten Werner --- diff --git a/dak/make_changelog.py b/dak/make_changelog.py index 398c3526..ac5581d0 100755 --- a/dak/make_changelog.py +++ b/dak/make_changelog.py @@ -160,7 +160,7 @@ def display_changes(uploads, index): print upload[index] prev_upload = upload[0] -def export_files(session, pool, clpool, temppath): +def export_files(session, pool, clpool): """ Export interesting files from source packages. """ @@ -282,7 +282,7 @@ def main(): if export: if cnf.exportpath: exportpath = os.path.join(Cnf['Dir::Export'], cnf.exportpath) - export_files(session, Cnf['Dir::Pool'], exportpath, Cnf['Dir::TempPath']) + export_files(session, Cnf['Dir::Pool'], exportpath) else: utils.fubar('No changelog export path defined') elif binnmu: diff --git a/daklib/contents.py b/daklib/contents.py index a5950524..f3077aab 100755 --- a/daklib/contents.py +++ b/daklib/contents.py @@ -441,7 +441,8 @@ class UnpackedSource(object): ''' The dscfilename is a name of a DSC file that will be extracted. ''' - self.root_directory = os.path.join(mkdtemp(), 'root') + temp_directory = mkdtemp(dir = Config()['Dir::TempPath']) + self.root_directory = os.path.join(temp_directory, 'root') command = ('dpkg-source', '--no-copy', '--no-check', '-q', '-x', dscfilename, self.root_directory) check_call(command, preexec_fn = subprocess_setup) diff --git a/tests/fixtures/dak.conf b/tests/fixtures/dak.conf index 6f68238d..3a728f78 100644 --- a/tests/fixtures/dak.conf +++ b/tests/fixtures/dak.conf @@ -22,6 +22,7 @@ Dir { Root "tests/fixtures/ftp/"; Pool "/srv/ftp-master.debian.org/ftp/pool/"; + TempPath "/tmp"; }; DB