diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2023-04-13 10:36:15 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2023-04-13 10:36:15 -0700 |
commit | 961117f0946067e19c77c1050ab90e634a0fccdd (patch) | |
tree | 5280cb482dfcd664a9622692d168b6da0b29b98a | |
parent | leaf-packages: pylint (diff) | |
download | qa-scripts-961117f0946067e19c77c1050ab90e634a0fccdd.tar.gz qa-scripts-961117f0946067e19c77c1050ab90e634a0fccdd.tar.bz2 qa-scripts-961117f0946067e19c77c1050ab90e634a0fccdd.zip |
leaf-packages.py: make quieter
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-x | leaf-packages.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/leaf-packages.py b/leaf-packages.py index 448f7cf..1454eb8 100755 --- a/leaf-packages.py +++ b/leaf-packages.py @@ -9,6 +9,7 @@ import subprocess import sys METHOD="pkgcore" +VERBOSE=int(os.getenv('VERBOSE') or os.getenv('V') or 0) # V=1..N to use def main() -> None: if len(sys.argv) > 1: @@ -38,7 +39,9 @@ def update_for(ebuild: str, zero_in_degree: dict, repo: str) -> None: Reverse dependencies of the ebuild will be searched in the specified repository only. """ - print(f"Processing {ebuild} ...", file=sys.stderr) + # This spams infra cronjobs, only enable if there is a problem + if VERBOSE >= 1: + print(f"Processing {ebuild} ...", file=sys.stderr) proc = subprocess.run(f'pquery --first --restrict-revdep ={ebuild} ' f'--repo {repo} --raw --unfiltered', capture_output=True, text=True, shell=True) @@ -89,7 +92,8 @@ def update_for_deps_of(ebuild: str, zero_in_degree: dict) -> None: capture_output=True, text=True, shell=True) return proc.stdout.splitlines() - #print(f"Processing {ebuild} ...", file=sys.stderr) + if VERBOSE >= 2: + print(f"Processing {ebuild} ...", file=sys.stderr) # Get dependency specifications in the ebuild; # equivalent to dep_graph[ebuild] in the examples above |