diff options
| author | alex <alex@pdp7.net> | 2025-07-11 09:11:54 +0200 |
|---|---|---|
| committer | alexpdp7 <alex@corcoles.net> | 2025-07-11 09:13:00 +0200 |
| commit | 0a70428e5cdf5231caa8f4665483f4fc7b43b394 (patch) | |
| tree | 520b4156d5013a03a1f0b4cbb06aa0e31fe2b50d | |
| parent | 82da907d9c0e33843a8b1856e6f6484ab4c48bf5 (diff) | |
Initial add
| -rwxr-xr-x | personal_infra/hack_dnf_problems.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/personal_infra/hack_dnf_problems.py b/personal_infra/hack_dnf_problems.py new file mode 100755 index 00000000..a88f1b5b --- /dev/null +++ b/personal_infra/hack_dnf_problems.py @@ -0,0 +1,38 @@ +#!/usr/bin/python3 + +import itertools +import shlex +import subprocess + +def _(*args): + print(shlex.join(args)) + subprocess.run(args, check=True) + +def clean(): + _("rpm", "--rebuilddb") + _("dnf", "clean", "all") + +def update_disabled(repos): + args = ["dnf", "update", "-y"] + list(itertools.chain(*[("--disablerepo", r) for r in repos])) + _(*args) + +def update_enabled(repos): + args = ["dnf", "update", "-y", "--disablerepo=*"] + list(itertools.chain(*[("--enablerepo", r) for r in repos])) + _(*args) + +clean() + +problematic_repos = ["copr:copr.fedorainfracloud.org:mlampe:emacs-30", "okay", "extras"] + +update_disabled(problematic_repos) + +failed = [] + +for r in problematic_repos: + try: + update_enabled([r]) + except Exception as e: + failed.append(r) + print(f"fail {r}: {e}") + +print(f"failed {failed}") |
