fix(build): survive filesystems that reject colons in package names

makepkg names epoch packages "<name>-<epoch>:<ver>-<rel>-<arch>", but
local-repo lives on an NTFS mount where ":" is refused: the first epoch
package (libxmlrpc) killed setup-aur.sh mid-run with EINVAL. Publish under
an epoch-less filename — pacman reads the epoch from the package and from
the repo database — probe the filesystem once at startup, and fail loudly
when a published file is not readable.

Ghost dirents left behind by those failed copies also matter: "ls <glob>"
then reports an error, and build.sh concluded the repo was empty, so the
ISO would have shipped without the FWS packages; repo-add died on them.
Detection now uses stat instead. The AUR package check was dead too, its
declaration having been parsed into a single word.
This commit is contained in:
BlackAngelTV committed 2026-11-13 11:17:14 +01:00
1 parent caa0b17262
commit 69c165e95c
2 files changed
+95 -10

No files matched your search

+29 -5
View File
@@ -306,10 +306,20 @@ ls "$SDDIR" 2>/dev/null | head -25 || echo " (aucun service)"
ls "$SDDIR/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
# « ls glob » renvoie un statut d'échec dès qu'une entrée FANTÔME traîne dans
# local-repo (nom refusé par NTFS, laissé à moitié créé par un cp raté) : on
# testait alors « aucun repo » et l'ISO partait sans les paquets FWS. On sonde
# donc un fichier réellement stat-able, et on copie de même, un par un.
_localrepo_has=0
for _f in "$WORK_DIR/local-repo/"*.pkg.tar.*; do
if [ -e "$_f" ]; then _localrepo_has=1; break; fi
done
if [ "$_localrepo_has" = 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/
for _f in "$WORK_DIR/local-repo/"*; do
if [ -e "$_f" ]; then cp -a "$_f" /tmp/fws-build/local-repo/; fi
done
echo "==> Injection [fws-local] dans pacman.conf..."
sed -i '/^\[fws-local\]/,/^$/d' /tmp/fws-build/releng/pacman.conf
@@ -344,11 +354,25 @@ for _d in "$WORK_DIR"/pkgbuilds/*/; do
[ -f "$_d/PKGBUILD" ] || continue
_local_pkgs+=("$(basename "$_d")")
done
# shellcheck disable=SC2207
_local_pkgs+=($(sed -n 's/^AUR_PACKAGES=(\(.*\))[[:space:]]*$//p' "$WORK_DIR/setup-aur.sh" 2>/dev/null))
# Liste AUR lue dans setup-aur.sh, sa seule source de vérité. L'extraction
# passe par bash : la déclaration est un tableau entre parenthèses, qu'un sed
# ramenait en UN SEUL mot — la comparaison ci-dessous ne matchait donc jamais
# packages.x86_64, et ce garde-fou ne vérifiait rien, en silence.
_aur_decl="$(awk '/^AUR_PACKAGES=\(/{f=1} f{print} f && /\)/{exit}' "$WORK_DIR/setup-aur.sh" 2>/dev/null)"
if [ -n "$_aur_decl" ]; then
# shellcheck disable=SC2207
_local_pkgs+=($(bash -c 'eval "$1"; printf "%s\n" "${AUR_PACKAGES[@]}"' _ "$_aur_decl" 2>/dev/null))
fi
# Présence testée par stat : « ls glob » renvoie un statut d'échec dès qu'une
# entrée fantôme traîne dans local-repo, et déclarerait absents des paquets
# pourtant présents.
for _p in "${_local_pkgs[@]}"; do
grep -qx "$_p" /tmp/fws-build/releng/packages.x86_64 || continue
ls "$WORK_DIR/local-repo/$_p"-[0-9]*.pkg.tar.* >/dev/null 2>&1 || _missing+=("$_p")
_found=0
for _f in "$WORK_DIR/local-repo/$_p"-[0-9]*.pkg.tar.*; do
if [ -e "$_f" ]; then _found=1; break; fi
done
[ "$_found" = 1 ] || _missing+=("$_p")
done
if [ "${#_missing[@]}" -gt 0 ]; then
echo -e "\e[31m[ERR] Ces paquets sont demandés par packages.x86_64 mais absents de local-repo :\e[0m" >&2