Last active
March 28, 2024 03:52
-
-
Save paride/c904bcdaa82bec8b1126bedad42e5c10 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import sys | |
import yaml | |
# Use LibYAML is available, otherwise this is going to be super slow | |
try: | |
from yaml import CSafeLoader as SafeLoader | |
except ImportError: | |
print("Expect slowness!") | |
from yaml import SafeLoader | |
def parse_excuses(excuses_file): | |
blocked_by_tests = [] | |
with open(excuses_file, "r", encoding="UTF-8") as f: | |
excuses = yaml.load(f, Loader=SafeLoader)["sources"] | |
for excuse in excuses: | |
# We only want non-candidates | |
if excuse["is-candidate"]: | |
continue | |
# We only want packages blocked by tests | |
if "autopkgtest" not in excuse["reason"]: | |
continue | |
# Among blocked-by-tests packages, look regressions in testing, | |
# to exclude packages with tests in RUNNING state. | |
verdict = excuse["policy_info"]["autopkgtest"]["verdict"] | |
if verdict in ("REJECTED_PERMANENTLY", "REJECTED_TEMPORARILY"): | |
package = excuse["source"] | |
blocked_by_tests.append(package) | |
print(*blocked_by_tests, sep="\n") | |
if __name__ == "__main__": | |
if len(sys.argv) != 2: | |
print(f"Usage: {sys.argv[0]} /path/to/update_excuses.yaml") | |
print( | |
f"Or: {sys.argv[0]} <(curl -sS https://ubuntu-archive-team.ubuntu.com/proposed-migration/noble/update_excuses.yaml.xz | xzcat)" | |
) | |
sys.exit(1) | |
parse_excuses(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To generate the list:
list1
wget -O - -q https://ubuntu-archive-team.ubuntu.com/proposed-migration/update_output_notest.txt | sed -n -E -e'/trying:.*glib2.0/ { s, -[-a-z0-9.+]+/[a-z0-9]+,,g; s/trying: //; s/ /\n/g; p; q }'
and save the output tolist2
comm -12 <(sort -u list1) <(sort -u list2)