Skip to content

Instantly share code, notes, and snippets.

@paride
Last active March 28, 2024 03:52
Show Gist options
  • Save paride/c904bcdaa82bec8b1126bedad42e5c10 to your computer and use it in GitHub Desktop.
Save paride/c904bcdaa82bec8b1126bedad42e5c10 to your computer and use it in GitHub Desktop.
#!/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])
@paride
Copy link
Author

paride commented Mar 27, 2024

To generate the list:

  1. run that script and save the output to list1
  2. run 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 to list2
  3. comm -12 <(sort -u list1) <(sort -u list2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment