Compare commits
2 commits
c9b51998a4
...
7e89fa354f
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e89fa354f | |||
| 0f50c524db |
2 changed files with 37 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue