refactor: Build-Skripte haerten (Virt-Assert, Terra-Pinning, Totcode)
This commit is contained in:
1 parent
cb683976a1
commit
d2d686c7a3
3 files changed
+49
-14
No files matched your search
+42
-2
@@ -21,10 +21,50 @@ dnf5 install -y --nogpgcheck \
|
|||||||
# repomd.xml (bekannte Incidents). Ein hickup dort darf weder den Image-
|
# repomd.xml (bekannte Incidents). Ein hickup dort darf weder den Image-
|
||||||
# noch den ISO-Build (BIB-Depsolve liest alle aktiven Repos) killen -
|
# noch den ISO-Build (BIB-Depsolve liest alle aktiven Repos) killen -
|
||||||
# der Greeter ist zu dem Zeitpunkt laengst installiert.
|
# der Greeter ist zu dem Zeitpunkt laengst installiert.
|
||||||
|
# WICHTIG: Pinning pro Section (nicht file-weit) - sonst bleiben z.B.
|
||||||
|
# debuginfo/source-Sections ungepinnt und koennen shadowen.
|
||||||
|
python3 - <<'PYEOF'
|
||||||
|
import glob
|
||||||
|
|
||||||
|
for path in sorted(glob.glob("/etc/yum.repos.d/terra*.repo")):
|
||||||
|
with open(path) as f:
|
||||||
|
lines = f.readlines()
|
||||||
|
out, cur_opts = [], {}
|
||||||
|
sections = [] # (header_idx, [option lines])
|
||||||
|
cur = None
|
||||||
|
for line in lines:
|
||||||
|
s = line.strip()
|
||||||
|
if s.startswith("[") and s.endswith("]"):
|
||||||
|
if cur is not None:
|
||||||
|
sections.append(cur)
|
||||||
|
cur = {"header": line, "opts": []}
|
||||||
|
elif cur is not None:
|
||||||
|
cur["opts"].append(line)
|
||||||
|
else:
|
||||||
|
out.append(("raw", line))
|
||||||
|
continue
|
||||||
|
if cur is not None:
|
||||||
|
sections.append(cur)
|
||||||
|
changed = False
|
||||||
|
for sec in sections:
|
||||||
|
has_pin = any(l.split("=")[0].strip() == "includepkgs" for l in sec["opts"] if "=" in l)
|
||||||
|
has_skip = any(l.split("=")[0].strip() == "skip_if_unavailable" for l in sec["opts"] if "=" in l)
|
||||||
|
if not has_pin:
|
||||||
|
sec["opts"].insert(0, "includepkgs=noctalia-greeter*\n")
|
||||||
|
changed = True
|
||||||
|
if not has_skip:
|
||||||
|
sec["opts"].insert(0, "skip_if_unavailable=True\n")
|
||||||
|
changed = True
|
||||||
|
with open(path, "w") as f:
|
||||||
|
for kind, line in out:
|
||||||
|
f.write(line)
|
||||||
|
for sec in sections:
|
||||||
|
f.write(sec["header"])
|
||||||
|
f.writelines(sec["opts"])
|
||||||
|
print(f"{'angepasst' if changed else 'bereits gepinnt'}: {path}")
|
||||||
|
PYEOF
|
||||||
for repo in /etc/yum.repos.d/terra*.repo; do
|
for repo in /etc/yum.repos.d/terra*.repo; do
|
||||||
[[ -e "${repo}" ]] || continue
|
[[ -e "${repo}" ]] || continue
|
||||||
grep -q '^includepkgs=' "${repo}" || sed -i '/^\[/a includepkgs=noctalia-greeter*' "${repo}"
|
|
||||||
grep -q '^skip_if_unavailable=' "${repo}" || sed -i '/^\[/a skip_if_unavailable=True' "${repo}"
|
|
||||||
echo "--- ${repo} ---"
|
echo "--- ${repo} ---"
|
||||||
cat "${repo}"
|
cat "${repo}"
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -24,4 +24,11 @@ dnf5 install -y \
|
|||||||
jq \
|
jq \
|
||||||
libnotify
|
libnotify
|
||||||
|
|
||||||
|
# Fail-fast wie in 40-multimedia.sh: --skip-unavailable duerfte stille
|
||||||
|
# Luecken reissen (jq/libnotify sind harte Skript-Abhaengigkeiten).
|
||||||
|
for pkg in distrobox toolbox just micro fuse fuse3 jq libnotify; do
|
||||||
|
rpm -q "${pkg}" >/dev/null 2>&1 || { echo "FEHLER: ${pkg} fehlt (Repo-Luecke?)"; exit 1; }
|
||||||
|
done
|
||||||
|
echo "Virt/Tools-Stack OK"
|
||||||
|
|
||||||
dnf5 clean all
|
dnf5 clean all
|
||||||
@@ -31,15 +31,3 @@ done
|
|||||||
echo "Freeworld-Stack OK"
|
echo "Freeworld-Stack OK"
|
||||||
|
|
||||||
dnf5 clean all
|
dnf5 clean all
|
||||||
|
|
||||||
#echo "Installing rocm"
|
|
||||||
#dnf5 install -y \
|
|
||||||
# rocm-clinfo \
|
|
||||||
# rocm-hip \
|
|
||||||
# rocm-opencl \
|
|
||||||
# rocblas \
|
|
||||||
# hipblas \
|
|
||||||
# rocm-runtime
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in new issue
Block a user