From 1229eb0ea9a45b399609d05f1958384fd0f9a535 Mon Sep 17 00:00:00 2001 From: Andrew Tonner Date: Thu, 19 Jan 2017 21:14:46 -0800 Subject: [PATCH] if the originals for any symlinked dirs (which are just copies under msys/mingw) have been updated, delete the copies and make links again --- SheepShaver/src/Windows/build_on_msys.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/SheepShaver/src/Windows/build_on_msys.py b/SheepShaver/src/Windows/build_on_msys.py index 48308cbf..87ef7fee 100644 --- a/SheepShaver/src/Windows/build_on_msys.py +++ b/SheepShaver/src/Windows/build_on_msys.py @@ -222,15 +222,33 @@ def install(make_args, show_build_environment, use_precompiled_dyngen, build_jit sheepshaver_dir = os.path.abspath(os.path.join(script_path, "..", "..")) print "SHEEPSHAVER_DIR: %s" % sheepshaver_dir - link_inputs = get_symlink_filenames(prefix="BasiliskII/src/") + link_input_prefix = "BasiliskII/src/" + link_output_prefix = "SheepShaver/src/" + link_inputs = get_symlink_filenames(prefix=link_input_prefix) print "Tracking %d link inputs" % len(link_inputs) sys.stdout.flush() + stale_or_missing_dir_contents_files = False + for link_input_proper in link_inputs: + link_input = os.path.join(root_dir, link_input_proper) + if os.path.isdir(link_input): + assert link_input_proper.startswith(link_input_prefix) + link_output_proper = link_output_prefix + link_input_proper[len(link_input_prefix):] + link_input_mtime = dep_tracker.get_inputs_modified_time([link_input]) + link_output = os.path.join(root_dir, link_output_proper) + if os.path.isdir(link_output): + link_output_mtime = dep_tracker.get_inputs_modified_time([link_output]) + if link_output_mtime is None or link_output_mtime < link_input_mtime: + shutil.rmtree(link_output) + stale_or_missing_dir_contents_files = True + else: + stale_or_missing_dir_contents_files = True + # TODO: fix make links step rather than just eating the exception with dep_tracker.rebuilding_if_needed("sheepshaver_top_makefile", ["SheepShaver/Makefile"] + link_inputs, base_dir=root_dir) as needs_rebuild: - if needs_rebuild: + if needs_rebuild or stale_or_missing_dir_contents_files: try: run([make_bin, "links"], cwd=sheepshaver_dir, env=our_env) except subprocess.CalledProcessError: