2020-07-12 18:24:00 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
|
|
. ./env_var.sh
|
2026-07-27 23:57:04 -04:00
|
|
|
|
|
|
|
|
# Verbosité de l'installation (git-repo). Silencieuse par défaut ;
|
|
|
|
|
# EL_VERBOSE=1 rétablit les logs détaillés (repo sync, git daemon).
|
|
|
|
|
if [ "${EL_VERBOSE:-0}" = "1" ]; then
|
|
|
|
|
REPO_VERBOSE="-v"; DAEMON_VERBOSE="--verbose"
|
|
|
|
|
else
|
|
|
|
|
REPO_VERBOSE="-q"; DAEMON_VERBOSE=""
|
|
|
|
|
fi
|
2020-07-12 18:24:00 -04:00
|
|
|
#EL_MANIFEST_PROD="./default.xml"
|
|
|
|
|
#EL_MANIFEST_DEV="./manifest/default.dev.xml"
|
|
|
|
|
|
[IMP] install: support Fedora, Debian, Ubuntu and Arch
Adds a Fedora dependency installer, rewrites the Arch one on pacman rather
than an AUR helper absent from cloud images, and repairs the Debian path:
apt lock timeout, PostGIS best-effort, Ubuntu 26.04, Node 22.
--- FR ---
Ajoute un installeur de dépendances Fedora, réécrit celui d'Arch sur pacman
plutôt qu'un assistant AUR absent des images cloud, et répare le chemin
Debian : attente du verrou apt, PostGIS best-effort, Ubuntu 26.04, Node 22.
Assisted-by: Claude Opus 4.8
Assisted-by: Claude Opus 5
2026-08-07 03:22:26 -04:00
|
|
|
# Update git-repo : local git daemon serving the repo over git://127.0.0.1:9418.
|
|
|
|
|
# Kill any leftover daemon from a previous (interrupted) run first: otherwise the
|
|
|
|
|
# stale server keeps port 9418, the new daemon fails to bind ("Address already in
|
|
|
|
|
# use"), and the cleanup kill below fails on an already-dead PID -> script exit 1.
|
|
|
|
|
# Match on the stable arguments, not "git daemon": « git daemon » execs into
|
|
|
|
|
# « git-daemon » (hyphen, /usr/lib/git-core/git-daemon), so "git daemon" (space)
|
|
|
|
|
# never matches the actual running process.
|
|
|
|
|
if pkill -f "daemon --base-path=. --export-all" 2>/dev/null; then
|
|
|
|
|
sleep 1 # let the kernel release port 9418 before we rebind
|
|
|
|
|
fi
|
|
|
|
|
|
2026-07-27 23:57:04 -04:00
|
|
|
git daemon --base-path=. --export-all --reuseaddr --informative-errors ${DAEMON_VERBOSE} &
|
2020-07-12 18:24:00 -04:00
|
|
|
DAEMON_PID=$!
|
[IMP] install: support Fedora, Debian, Ubuntu and Arch
Adds a Fedora dependency installer, rewrites the Arch one on pacman rather
than an AUR helper absent from cloud images, and repairs the Debian path:
apt lock timeout, PostGIS best-effort, Ubuntu 26.04, Node 22.
--- FR ---
Ajoute un installeur de dépendances Fedora, réécrit celui d'Arch sur pacman
plutôt qu'un assistant AUR absent des images cloud, et répare le chemin
Debian : attente du verrou apt, PostGIS best-effort, Ubuntu 26.04, Node 22.
Assisted-by: Claude Opus 4.8
Assisted-by: Claude Opus 5
2026-08-07 03:22:26 -04:00
|
|
|
# Always stop the daemon we started, whatever happens next (success or error),
|
|
|
|
|
# without ever failing the script if it is already gone.
|
|
|
|
|
trap 'kill "${DAEMON_PID}" 2>/dev/null || true' EXIT
|
2020-07-12 18:24:00 -04:00
|
|
|
|
2024-08-25 15:54:24 -04:00
|
|
|
if [ -L "$EL_MANIFEST_DEV" ]; then
|
|
|
|
|
MANIFEST_TARGET=$(readlink -f "$EL_MANIFEST_DEV")
|
|
|
|
|
else
|
|
|
|
|
MANIFEST_TARGET="$EL_MANIFEST_DEV"
|
|
|
|
|
fi
|
|
|
|
|
|
2026-02-12 00:52:32 -05:00
|
|
|
if command -v nproc >/dev/null 2>&1; then
|
|
|
|
|
JOBS="$(nproc --all)"
|
|
|
|
|
else
|
|
|
|
|
JOBS="$(sysctl -n hw.ncpu)"
|
|
|
|
|
fi
|
|
|
|
|
|
2025-05-05 04:43:13 -04:00
|
|
|
# Generate local manifest
|
|
|
|
|
.venv.erplibre/bin/python ./script/git/git_merge_repo_manifest.py --output .repo/local_manifests/erplibre_manifest.xml --with_OCA
|
|
|
|
|
|
2026-08-10 03:10:50 -04:00
|
|
|
# Révision du manifeste : un NOM DE BRANCHE, jamais un SHA nu.
|
|
|
|
|
#
|
|
|
|
|
# « repo init -b <sha> » échoue sur un espace de travail NEUF : repo doit y
|
|
|
|
|
# cloner .repo/manifests et ne sait pas résoudre un commit en révision de
|
|
|
|
|
# manifeste. Il abandonne sur « unparseable HEAD », puis repo sync sur
|
|
|
|
|
# « manifest not found ». Mesuré : -b main réussit, -b <sha> échoue.
|
|
|
|
|
# Le piège est qu'un .repo DÉJÀ initialisé accepte le SHA — le défaut reste
|
|
|
|
|
# donc invisible sur toute machine ayant réussi un init une fois, et ne frappe
|
|
|
|
|
# que les installations neuves : les 4 VM du 2026-08-07 ont toutes échoué là.
|
|
|
|
|
MANIFEST_REV=$(git symbolic-ref --quiet --short HEAD || true)
|
|
|
|
|
if [ -z "${MANIFEST_REV}" ]; then
|
|
|
|
|
# HEAD détaché : prendre une branche qui contient ce commit plutôt que de
|
|
|
|
|
# retomber sur le SHA, qui ne marcherait pas.
|
|
|
|
|
MANIFEST_REV=$(git branch --contains HEAD --format='%(refname:short)' 2>/dev/null | grep -v '[()]' | head -1)
|
|
|
|
|
fi
|
|
|
|
|
if [ -z "${MANIFEST_REV}" ]; then
|
|
|
|
|
echo "Erreur : impossible de déterminer une branche pour repo init." >&2
|
|
|
|
|
echo " HEAD est détaché et aucune branche ne contient ce commit." >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
.venv.erplibre/bin/repo init -u git://127.0.0.1:9418/ -b "${MANIFEST_REV}" -m ${MANIFEST_TARGET} "$@"
|
2026-07-27 23:57:04 -04:00
|
|
|
.venv.erplibre/bin/repo sync -c -j "$JOBS" ${REPO_VERBOSE} -m ${MANIFEST_TARGET}
|
2020-07-12 18:24:00 -04:00
|
|
|
|
[IMP] install: support Fedora, Debian, Ubuntu and Arch
Adds a Fedora dependency installer, rewrites the Arch one on pacman rather
than an AUR helper absent from cloud images, and repairs the Debian path:
apt lock timeout, PostGIS best-effort, Ubuntu 26.04, Node 22.
--- FR ---
Ajoute un installeur de dépendances Fedora, réécrit celui d'Arch sur pacman
plutôt qu'un assistant AUR absent des images cloud, et répare le chemin
Debian : attente du verrou apt, PostGIS best-effort, Ubuntu 26.04, Node 22.
Assisted-by: Claude Opus 4.8
Assisted-by: Claude Opus 5
2026-08-07 03:22:26 -04:00
|
|
|
# Daemon cleanup handled by the EXIT trap above (tolerant of an already-dead PID).
|