feat(build): align build-offi.sh with build.sh on the fws repository

The official build still injected the local-repo, so it no longer built
the same image as build.sh. It now takes the FWS packages from [fws],
stops when the profile's repositories cannot be read, and checks the
installer translations first.
This commit is contained in:
nocode committed 2026-11-26 14:00:06 +01:00
1 parent 2a71f0e640
commit baabd9568e
1 file changed
+22 -27
+22 -27
View File
@@ -3,8 +3,8 @@
# FWS — Build OFFICIEL versionné de l'ISO (archiso)
#
# IDENTIQUE à build.sh (même bascule conteneur/WSL, --network=host, fusion
# baseline, MÊME injection local-repo → donc même paquet anaconda avec le champ
# Hostname), avec EN PLUS uniquement le RENOMMAGE :
# baseline, MÊMES paquets FWS tirés du dépôt distant [fws] → donc même paquet
# anaconda avec le champ Hostname), avec EN PLUS uniquement le RENOMMAGE :
# - demande la version (major.minor.build) + le nom de variante, le fichier
# VERSION servant de défaut,
# - nomme l'ISO fws-<version>-<nom>.iso (ex. fws-1.5.0-cli.iso),
@@ -202,7 +202,7 @@ if [ -z "$FWS_IN_CONTAINER" ] && ! host_is_arch; then
# On les rend au propriétaire du dépôt pour confort côté hôte.
OWNER="$(stat -c '%u:%g' "$REPO_DIR" 2>/dev/null || true)"
if [ -n "$OWNER" ]; then
for d in out local-repo; do
for d in out; do
[ -e "$REPO_DIR/$d" ] && "${SUDO[@]}" chown -R "$OWNER" "$REPO_DIR/$d" 2>/dev/null || true
done
fi
@@ -240,6 +240,16 @@ fi
WORK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "==> Dossier de travail : $WORK_DIR"
# A broken translations file only shows once the ISO boots: check it now,
# before anything long. A bare Arch container may lack python3: skip then.
if command -v python3 >/dev/null 2>&1; then
echo "==> Vérification des traductions de l'installateur..."
python3 -I "$WORK_DIR/scripts/check-installer-translations.py" \
|| { echo -e "\e[31m[ERR] Traductions de l'installateur invalides (détail ci-dessus).\e[0m" >&2; exit 1; }
else
echo "==> python3 absent : vérification des traductions sautée."
fi
# ============================================================
# Version (major.minor.build) + nom de la variante.
# Déjà demandés sur l'hôte (FWS_ISO_VERSION/FWS_ISO_TAG passés via -e) ; sinon
@@ -341,26 +351,6 @@ echo "==> Vérification des services systemd..."
ls /tmp/fws-build/releng/airootfs/etc/systemd/system/ 2>/dev/null || echo " (aucun service)"
ls /tmp/fws-build/releng/airootfs/etc/systemd/system/multi-user.target.wants/ 2>/dev/null || echo " (aucun symlink)"
# Copie le repo local (fws-pacmanage + fws-dnd + deps Anaconda packagées)
if ls "$WORK_DIR/local-repo/"*.pkg.tar.zst &>/dev/null 2>&1; then
echo "==> Copie du repo local fws-local..."
mkdir -p /tmp/fws-build/local-repo
cp -a "$WORK_DIR/local-repo/"* /tmp/fws-build/local-repo/
echo "==> Injection [fws-local] dans pacman.conf..."
sed -i '/^\[fws-local\]/,/^$/d' /tmp/fws-build/releng/pacman.conf
PACMAN_TMP=$(mktemp)
printf '[fws-local]\nSigLevel = Optional TrustAll\nServer = file:///tmp/fws-build/local-repo\n\n' \
> "$PACMAN_TMP"
cat /tmp/fws-build/releng/pacman.conf >> "$PACMAN_TMP"
mv "$PACMAN_TMP" /tmp/fws-build/releng/pacman.conf
echo "==> Vérification pacman.conf :"
head -5 /tmp/fws-build/releng/pacman.conf
else
echo "==> Aucun repo local détecté."
fi
echo "==> Correction des retours à la ligne Windows (dos2unix)..."
pacman -S --needed --noconfirm dos2unix
find /tmp/fws-build/releng -type f -exec dos2unix {} + 2>/dev/null
@@ -368,11 +358,16 @@ find /tmp/fws-build/releng -type f -exec dos2unix {} + 2>/dev/null
# ── Pré-vol : résolution de TOUS les paquets du profil ──
# « error: target not found » ne doit plus surgir en plein mkarchiso : on
# résout la liste complète (packages.x86_64 fusionné) contre le pacman.conf
# du profil (fws-local injecté inclus) dans une base temporaire. S'il manque
# du profil (dépôt distant [fws] inclus) dans une base temporaire. S'il manque
# un paquet, on échoue ICI avec la liste + le geste correctif.
echo "==> Pré-vol : résolution des paquets du profil..."
PREFLIGHT_DB="$(mktemp -d)"
pacman -Sy --config /tmp/fws-build/releng/pacman.conf --dbpath "$PREFLIGHT_DB" >/dev/null
if ! pacman -Sy --config /tmp/fws-build/releng/pacman.conf --dbpath "$PREFLIGHT_DB" >/dev/null; then
rm -rf "$PREFLIGHT_DB"
echo -e "\e[31mBases des dépôts du profil illisibles (miroir Arch ou dépôt [fws] injoignable ?).\e[0m" >&2
echo "Vérifie l'accès réseau (curl -I https://repo.laxacube.ch/x86_64/fws.db), puis relance." >&2
exit 1
fi
mapfile -t PROFILE_PKGS < <(sed -e 's/#.*//' -e 's/[[:space:]]//g' -e '/^$/d' \
/tmp/fws-build/releng/packages.x86_64)
# -Sp n'installe rien (affiche les URLs) ; LC_ALL=C fige le motif d'erreur.
@@ -384,8 +379,8 @@ rm -rf "$PREFLIGHT_DB"
if [ -n "$MISSING" ]; then
echo -e "\e[31mPaquets introuvables dans les dépôts du profil :\e[0m" >&2
printf ' \e[31m%s\e[0m\n' $MISSING >&2
echo -e "\e[33mDépôt fws-local absent/incomplet ? Lance ./setup-aur.sh (construit" >&2
echo -e "anaconda, fws-pacmanage, fws-dnd, …) puis relance ce script.\e[0m" >&2
echo -e "\e[33mPaquet FWS pas encore publié sur le dépôt [fws] (anaconda, fws-pacmanage," >&2
echo -e "fws-dnd, …) ? Publie-le, ou corrige son nom dans packages.x86_64, puis relance.\e[0m" >&2
exit 1
fi
echo "==> Pré-vol OK : ${#PROFILE_PKGS[@]} paquets résolus."