From c438a7d23c8484d27e5b74bf2ad0eb8f5422751f Mon Sep 17 00:00:00 2001 From: Alex Hornby Date: Tue, 3 Dec 2024 18:01:58 -0800 Subject: [PATCH] reduce shipit fetcher update logs (#1081) Summary: Pull Request resolved: https://github.com/facebookincubator/zstrong/pull/1081 Reviewed By: bigfootjon Differential Revision: D66702321 fbshipit-source-id: 6b16249fb48357a452d82067fb6a468b5d10bc13 --- build/fbcode_builder/getdeps/fetcher.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build/fbcode_builder/getdeps/fetcher.py b/build/fbcode_builder/getdeps/fetcher.py index ccc7d5e..c769c11 100644 --- a/build/fbcode_builder/getdeps/fetcher.py +++ b/build/fbcode_builder/getdeps/fetcher.py @@ -366,10 +366,8 @@ def copy_if_different(src_name, dest_name) -> bool: if exc.errno != errno.ENOENT: raise target = os.readlink(src_name) - print("Symlinking %s -> %s" % (dest_name, target)) os.symlink(target, dest_name) else: - print("Copying %s -> %s" % (src_name, dest_name)) shutil.copy2(src_name, dest_name) return True @@ -474,7 +472,7 @@ def st_dev(path): raise Exception( "%s doesn't exist; check your sparse profile!" % dir_to_mirror ) - + update_count = 0 for root, dirs, files in os.walk(dir_to_mirror): dirs[:] = [d for d in dirs if root_dev == st_dev(os.path.join(root, d))] @@ -488,6 +486,13 @@ def st_dev(path): full_file_list.add(target_name) if copy_if_different(full_name, target_name): change_status.record_change(target_name) + if update_count < 10: + print("Updated %s -> %s" % (full_name, target_name)) + elif update_count == 10: + print("...") + update_count += 1 + if update_count: + print("Updated %s for %s" % (update_count, fbsource_subdir)) # Compare the list of previously shipped files; if a file is # in the old list but not the new list then it has been