|
47 | 47 |
|
48 | 48 |
|
49 | 49 | def print_verbose(*args, mapping=None, values=None): |
50 | | - if bool(os.environ.get("RULES_PYTHON_BOOTSTRAP_VERBOSE")): |
51 | | - if mapping is not None: |
52 | | - for key, value in sorted((mapping or {}).items()): |
53 | | - print( |
54 | | - "bootstrap: stage 1:", |
55 | | - *args, |
56 | | - f"{key}={value!r}", |
57 | | - file=sys.stderr, |
58 | | - flush=True, |
59 | | - ) |
60 | | - elif values is not None: |
61 | | - for i, v in enumerate(values): |
62 | | - print( |
63 | | - "bootstrap: stage 1:", |
64 | | - *args, |
65 | | - f"[{i}] {v!r}", |
66 | | - file=sys.stderr, |
67 | | - flush=True, |
68 | | - ) |
69 | | - else: |
70 | | - print("bootstrap: stage 1:", *args, file=sys.stderr, flush=True) |
| 50 | + if not bool(os.environ.get("RULES_PYTHON_BOOTSTRAP_VERBOSE")): |
| 51 | + return |
| 52 | + if mapping is not None: |
| 53 | + for key, value in sorted((mapping or {}).items()): |
| 54 | + print( |
| 55 | + "bootstrap: stage 1:", |
| 56 | + *args, |
| 57 | + f"{key}={value!r}", |
| 58 | + file=sys.stderr, |
| 59 | + flush=True, |
| 60 | + ) |
| 61 | + elif values is not None: |
| 62 | + for i, v in enumerate(values): |
| 63 | + print( |
| 64 | + "bootstrap: stage 1:", |
| 65 | + *args, |
| 66 | + f"[{i}] {v!r}", |
| 67 | + file=sys.stderr, |
| 68 | + flush=True, |
| 69 | + ) |
| 70 | + else: |
| 71 | + print("bootstrap: stage 1:", *args, file=sys.stderr, flush=True) |
71 | 72 |
|
72 | 73 |
|
73 | 74 |
|
@@ -180,7 +181,7 @@ def extract_zip(zip_path, dest_dir): |
180 | 181 | elif attrs != 0: # Rumor has it these can be 0 for zips created on Windows. |
181 | 182 | # Add the write bit to ensure the files can be deleted during cleanup and |
182 | 183 | # overwritten by subsequent invocations. |
183 | | - os.chmod(file_path, (attrs & 0o7777) | stat.S_IWRITE) |
| 184 | + os.chmod(file_path, attrs & 0o7777) |
184 | 185 |
|
185 | 186 |
|
186 | 187 | # Create the runfiles tree by extracting the zip file |
|
0 commit comments