Lines Matching +full:shebang +full:- +full:regex
3 # Use of this source code is governed by a BSD-style license that can be
34 # Regex that matches ANSI escape sequences
35 ANSI_ESCAPE = re.compile(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])")
73 # List of times recorded by `record_time` which will be printed if --timing-info is provided.
104 "--color",
110 "--verbose",
111 "-v",
117 "--very-verbose",
118 "-vv",
124 "--timing-info",
148 def find_scripts(path: Path, shebang: str):
150 if file.is_file() and file.open(errors="ignore").read(512).startswith(f"#!{shebang}"):
208 # Run with --askpass but no askpass set, succeeds only if passwordless sudo
210 (ret, _) = subprocess.getstatusoutput("SUDO_ASKPASS=false sudo --askpass true")
215 "mingw64": "x86_64-pc-windows-gnu",
216 "msvc64": "x86_64-pc-windows-msvc",
217 "armhf": "armv7-unknown-linux-gnueabihf",
218 "aarch64": "aarch64-unknown-linux-gnu",
219 "riscv64": "riscv64gc-unknown-linux-gnu",
220 "x86_64": "x86_64-unknown-linux-gnu",
228 The format is: <arch><sub>-<vendor>-<sys>-<abi>, However, we will treat <arch><sub> as a single
240 if "-" in shorthand:
250 parts = triple.split("-")
264 return cls.from_str("armv7-unknown-linux-gnueabihf")
266 return cls.from_str(f"{arch}-unknown-linux-gnu")
271 rustc_info = subprocess.check_output(["rustc", "-vV"], text=True)
283 return f"all-{shorthand}"
299 return f"{self.arch}-{self.vendor}-{self.sys}-{self.abi}"
305 attempts -= 1
316 def strip_ansi_escape_sequences(line: str) -> str:
333 debian_packages = [f"python3-{p}" for p in missing_packages]
335 print("Missing python dependencies. Please re-run ./tools/install-deps")
343 Records wall-time of how long this context lasts.
345 The results will be printed at the end of script executation if --timing-info is specified.
351 global_time_records.append((title, datetime.datetime.now() - start_time))