From ba6c0cab8fd516c414c3f5cb76bebc0d93b50e30 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 1 Jul 2019 20:12:58 +0300 Subject: [PATCH] Use the same directory names for dist so that ccache works. Closes #5583. --- mesonbuild/scripts/dist.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mesonbuild/scripts/dist.py b/mesonbuild/scripts/dist.py index 47fde2379..1a62c7068 100644 --- a/mesonbuild/scripts/dist.py +++ b/mesonbuild/scripts/dist.py @@ -144,11 +144,15 @@ def create_dist_hg(dist_name, src_root, bld_root, dist_sub, dist_scripts): return (xzname, ) -def check_dist(packagename, meson_command): +def check_dist(packagename, meson_command, privdir): print('Testing distribution package %s' % packagename) - unpackdir = tempfile.mkdtemp() - builddir = tempfile.mkdtemp() - installdir = tempfile.mkdtemp() + unpackdir = os.path.join(privdir, 'dist-unpack') + builddir = os.path.join(privdir, 'dist-build') + installdir = os.path.join(privdir, 'dist-install') + for p in (unpackdir, builddir, installdir): + if os.path.exists(p): + shutil.rmtree(p) + os.mkdir(p) ninja_bin = detect_ninja() try: tf = tarfile.open(packagename) @@ -200,7 +204,7 @@ def run(args): return 1 error_count = 0 for name in names: - rc = check_dist(name, meson_command) # Check only one. + rc = check_dist(name, meson_command, priv_dir) # Check only one. if rc == 0: create_hash(name) error_count += rc