X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-dev.git/blobdiff_plain/9c1aebc784ae680f2c856c06e2314680da040634..19687e3e1589b1c644ae4ba4b82cba3646fafd88:/invirtibuilder diff --git a/invirtibuilder b/invirtibuilder index 2882272..9260b1e 100755 --- a/invirtibuilder +++ b/invirtibuilder @@ -267,7 +267,7 @@ def makeReadable(workdir): os.chmod(workdir, 0755) @contextlib.contextmanager -def packageWorkdir(package, commit): +def packageWorkdir(package, commit, build_id): """Checkout the package in a temporary working directory. This context manager returns that working directory. The requested @@ -277,7 +277,7 @@ def packageWorkdir(package, commit): When the context wrapped with this context manager is exited, the working directory is automatically deleted. """ - workdir = tempfile.mkdtemp() + workdir = tempfile.mkdtemp(prefix=("b%d-" % build_id)) try: p_archive = subprocess.Popen( ['git', 'archive', @@ -371,7 +371,7 @@ def build(): # do the build ourselves else: db.failed_stage = 'checking out package source' - with packageWorkdir(package, commit) as workdir: + with packageWorkdir(package, commit, db.build_id) as workdir: db.failed_stage = 'preparing source package' packagedir = os.path.join(workdir, package)