Compare commits

...

2 commits

Author SHA1 Message Date
7e89fa354f [FIX] install: propager l'échec au code de sortie (faux ✅ du suivi corrigé)
update_env_version.py (cible « make install_odoo_XX ») calculait un statut
mais ne faisait JAMAIS sys.exit() et IGNORAIT le retour de
update_environment() (l'install réelle : venv/poetry). Résultat : même
quand install_locally.sh échouait (ex. poetry status 127), le script
sortait 0 -> make 0 -> remote « && » continuait (service créé) ->
__ERPLIBRE_EXIT__ 0 -> le suivi d'installation affichait ✅ à tort.

- main() suit un exit_code : install_system() ou update_environment()
  renvoyant une valeur non nulle (os.system : 0 = succès) -> exit_code=1.
- sys.exit(main() or 0) propage réellement l'échec.
- Étapes post-install (pycharm, git_repo_update, generate_config) exécutées
  seulement si l'install a réussi (sinon .venv.erplibre absent -> cascade
  d'erreurs).

Chaîne désormais complète : install_locally.sh exit 1 -> install_locally_
dev.sh exit 1 -> os.system != 0 -> install_erplibre != 0 ->
update_environment != 0 -> main exit_code=1 -> sys.exit(1) -> make échoue
-> remote && stoppe -> __ERPLIBRE_EXIT__ != 0 -> dashboard ❌.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-30 03:49:56 +00:00
0f50c524db [FIX] install: wkhtmltopdf — URL vide sur Ubuntu 26.04 (gdebi sans fichier)
Sur erplibre-ubuntu-2604 (Ubuntu 26.04), wkhtmltopdf ne s'installait pas :
la liste de versions s'arrêtait à 25.10, donc WKHTMLTOX_X64 restait VIDE
-> « sudo gdebi $(basename '') » -> « Usage: gdebi… » -> erreur -> Odoo :
« You need Wkhtmltopdf to print a pdf ».

- Bloc Ubuntu réécrit : 18.04->bionic, 20.04->focal, ELSE->jammy (build le
  plus récent publié par wkhtmltopdf, valable 22.04..26.04 et au-delà).
  Un « else » évite toute URL vide sur une future version.
- Garde-fou : si l'URL est vide malgré tout, on saute proprement
  (wkhtmltopdf est optionnel) au lieu d'appeler gdebi sans fichier.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-30 03:44:40 +00:00
2 changed files with 37 additions and 14 deletions

View file

@ -20,12 +20,16 @@ UBUNTU_VERSION=$(lsb_release -rs)
DEBIAN_VERSION=$(lsb_release -cs)
OS=$(lsb_release -si)
if [[ "${OS}" == "Ubuntu" ]]; then
if [ "25.10" == "${UBUNTU_VERSION}" ] || [ "25.04" == "${UBUNTU_VERSION}" ] || [ "24.04" == "${UBUNTU_VERSION}" ] || [ "24.10" == "${UBUNTU_VERSION}" ] || [ "23.10" == "${UBUNTU_VERSION}" ] || [ "23.04" == "${UBUNTU_VERSION}" ] || [ "22.10" == "${UBUNTU_VERSION}" ] || [ "22.04" == "${UBUNTU_VERSION}" ]; then
WKHTMLTOX_X64=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.jammy_amd64.deb
elif [ "20.04" == "${UBUNTU_VERSION}" ]; then
if [ "20.04" == "${UBUNTU_VERSION}" ]; then
WKHTMLTOX_X64=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
elif [ "18.04" == "${UBUNTU_VERSION}" ]; then
WKHTMLTOX_X64=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb
else
# 22.04+ (jusqu'à 26.04 et au-delà) : wkhtmltopdf ne publie pas de build
# par version ; le .deb « jammy » est le plus récent et fonctionne. Un
# « else » (au lieu d'énumérer les versions) évite une URL VIDE sur une
# version récente (26.04) -> gdebi appelé sans fichier -> échec.
WKHTMLTOX_X64=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.jammy_amd64.deb
fi
elif [[ "${OS}" == "Linuxmint" ]]; then
if [ "22.3" == "${UBUNTU_VERSION}" ]; then
@ -205,15 +209,21 @@ elif [ ${EL_INSTALL_WKHTMLTOPDF} = "True" ]; then
if [ "" == "${INSTALLED}" ]; then
echo -e "\n---- Install wkhtml and place shortcuts on correct place ----"
_url=${WKHTMLTOX_X64}
sudo wget ${_url}
sudo gdebi --n $(basename ${_url})
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "gdebi install wkhtmltopdf installation error."
exit 1
if [ -z "${_url}" ]; then
# Aucune URL (version non mappée) : wkhtmltopdf est OPTIONNEL, on saute
# proprement plutôt que d'appeler gdebi sans fichier (« Usage: gdebi »).
echo "wkhtmltopdf : aucune URL pour cette version, ignoré (optionnel)."
else
sudo wget ${_url}
sudo gdebi --n $(basename ${_url})
retVal=$?
if [[ $retVal -ne 0 ]]; then
echo "gdebi install wkhtmltopdf installation error."
exit 1
fi
sudo ln -fs /usr/local/bin/wkhtmltopdf /usr/bin
sudo ln -fs /usr/local/bin/wkhtmltoimage /usr/bin
fi
sudo ln -fs /usr/local/bin/wkhtmltopdf /usr/bin
sudo ln -fs /usr/local/bin/wkhtmltoimage /usr/bin
else
echo -e "\n---- Already installed wkhtml ----"
fi

View file

@ -709,6 +709,11 @@ def main():
update.validate_version()
_logger.info("Validate environment")
# exit_code : propagé à sys.exit() -> une install qui ÉCHOUE renvoie un
# code non nul (avant, main() ne sortait jamais en erreur : le suivi
# d'installation affichait ✅ même quand poetry/pyenv plantaient).
# Rappel os.system : 0 = succès ; toute autre valeur = échec.
exit_code = 0
status = 0
if (
update.config.install_dev
@ -718,16 +723,22 @@ def main():
status = update.validate_environment()
if update.config.install:
status = update.install_system()
if status not in (0, True, None):
exit_code = 1
if (
update.config.force_install
or update.config.install_dev
or update.config.partial_install
or update.config.is_in_switch
) and not status:
update.update_environment()
rc = update.update_environment()
if rc not in (0, True, None):
exit_code = 1
update.print_log()
if update.config.install_dev:
# Étapes post-install : uniquement si l'installation a RÉUSSI (sinon
# .venv.erplibre est absent -> cascade d'erreurs inutiles).
if update.config.install_dev and exit_code == 0:
# Update pycharm configuration
update.pycharm_update()
@ -736,6 +747,8 @@ def main():
"./.venv.erplibre/bin/python ./script/git/git_repo_update_group.py"
)
os.system("./script/generate_config.sh")
return exit_code
# TODO ignore this if installation fail
# TODO this cause an error at first execution, need to source ./.venv.erplibre/bin/activate and rerun
@ -756,4 +769,4 @@ def die(cond, message, code=1):
if __name__ == "__main__":
main()
sys.exit(main() or 0)