Mercurial > hg > truffle
diff mxtool/mx.py @ 8183:4b11a0983557
fixed issue with deleting temp files on Windows
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 08 Mar 2013 16:57:46 +0100 |
parents | e0db99483b35 |
children | 3c74a32bb262 |
line wrap: on
line diff
--- a/mxtool/mx.py Fri Mar 08 15:58:08 2013 +0100 +++ b/mxtool/mx.py Fri Mar 08 16:57:46 2013 +0100 @@ -1651,7 +1651,7 @@ if name.startswith('@'): dname = name[1:] d = distribution(dname) - _, tmp = tempfile.mkstemp(suffix='', prefix=basename(d.path), dir=dirname(d.path)) + fd, tmp = tempfile.mkstemp(suffix='', prefix=basename(d.path) + '.', dir=dirname(d.path)) zf = zipfile.ZipFile(tmp, 'w') for p in sorted_deps(d.deps): outputDir = p.output_dir() @@ -1661,6 +1661,7 @@ arcname = join(relpath, f).replace(os.sep, '/') zf.write(join(root, f), arcname) zf.close() + os.close(fd) # Atomic on Unix shutil.move(tmp, d.path) #print time.time(), 'move:', tmp, '->', d.path @@ -1669,7 +1670,7 @@ else: p = project(name) outputDir = p.output_dir() - _, tmp = tempfile.mkstemp(suffix='', prefix=p.name, dir=p.dir) + fd, tmp = tempfile.mkstemp(suffix='', prefix=p.name, dir=p.dir) zf = zipfile.ZipFile(tmp, 'w') for root, _, files in os.walk(outputDir): for f in files: @@ -1677,6 +1678,7 @@ arcname = join(relpath, f).replace(os.sep, '/') zf.write(join(root, f), arcname) zf.close() + os.close(fd) # Atomic on Unix shutil.move(tmp, join(p.dir, p.name + '.jar')) @@ -2184,7 +2186,7 @@ if projToDist.has_key(p.name): dist, distDeps = projToDist[p.name] - _genEclipseBuilder(out, p, 'Create' + dist.name + 'Dist.launch', 'archive @' + dist.name, refresh=False, async=True, logToConsole=True) + _genEclipseBuilder(out, p, 'Create' + dist.name + 'Dist.launch', 'archive @' + dist.name, refresh=False, async=True) out.close('buildSpec') out.open('natures')