Skip to content

Commit

Permalink
reduce shipit fetcher update logs (#1081)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: facebookincubator/zstrong#1081

Reviewed By: bigfootjon

Differential Revision: D66702321

fbshipit-source-id: 6b16249fb48357a452d82067fb6a468b5d10bc13
  • Loading branch information
ahornby authored and facebook-github-bot committed Dec 4, 2024
1 parent db30b90 commit 7eff2a9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions build/fbcode_builder/getdeps/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))]

Expand All @@ -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
Expand Down

0 comments on commit 7eff2a9

Please sign in to comment.