From b47aedc93286ae51ffe77ea71d7587e1406e25d3 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 20 Jun 2024 14:02:56 +0200 Subject: [PATCH] helpers: remove god forsaken clumsy node_update cron job >_> --- helpers/helpers.v1.d/nodejs | 62 +---------------------------------- helpers/helpers.v2.1.d/nodejs | 60 --------------------------------- hooks/conf_regen/01-yunohost | 2 ++ 3 files changed, 3 insertions(+), 121 deletions(-) diff --git a/helpers/helpers.v1.d/nodejs b/helpers/helpers.v1.d/nodejs index be79cef66..de6d7a43e 100644 --- a/helpers/helpers.v1.d/nodejs +++ b/helpers/helpers.v1.d/nodejs @@ -83,7 +83,7 @@ ynh_use_nodejs() { # ynh_install_nodejs will install the version of node provided as argument by using n. # # usage: ynh_install_nodejs --nodejs_version=nodejs_version -# | arg: -n, --nodejs_version= - Version of node to install. When possible, your should prefer to use major version number (e.g. 8 instead of 8.10.0). The crontab will then handle the update of minor versions when needed. +# | arg: -n, --nodejs_version= - Version of node to install. When possible, your should prefer to use major version number (e.g. 8 instead of 8.10.0). # # `n` (Node version management) uses the `PATH` variable to store the path of the version of node it is going to use. # That's how it changes the version @@ -149,9 +149,6 @@ ynh_install_nodejs() { # Store nodejs_version into the config of this app ynh_app_setting_set --app=$app --key=nodejs_version --value=$nodejs_version - # Build the update script and set the cronjob - ynh_cron_upgrade_node - ynh_use_nodejs } @@ -180,62 +177,5 @@ ynh_remove_nodejs() { ynh_secure_remove --file="$n_install_dir" ynh_secure_remove --file="/usr/local/n" sed --in-place "/N_PREFIX/d" /root/.bashrc - rm --force /etc/cron.daily/node_update fi } - -# Set a cron design to update your node versions -# -# [internal] -# -# This cron will check and update all minor node versions used by your apps. -# -# usage: ynh_cron_upgrade_node -# -# Requires YunoHost version 2.7.12 or higher. -ynh_cron_upgrade_node() { - # Build the update script - cat >"$n_install_dir/node_update.sh" <"/etc/cron.daily/node_update" <> $n_install_dir/node_update.log -EOF - - chmod +x "/etc/cron.daily/node_update" -} diff --git a/helpers/helpers.v2.1.d/nodejs b/helpers/helpers.v2.1.d/nodejs index f668e1675..e8eecb829 100644 --- a/helpers/helpers.v2.1.d/nodejs +++ b/helpers/helpers.v2.1.d/nodejs @@ -94,9 +94,6 @@ ynh_nodejs_install() { # Store nodejs_version into the config of this app ynh_app_setting_set --key=nodejs_version --value=$nodejs_version - # Build the update script and set the cronjob - _ynh_cron_upgrade_node - _ynh_load_nodejs_in_path_and_other_tweaks } @@ -126,62 +123,5 @@ ynh_nodejs_remove() { ynh_safe_rm "$n_install_dir" ynh_safe_rm "/usr/local/n" sed --in-place "/N_PREFIX/d" /root/.bashrc - rm --force /etc/cron.daily/node_update fi } - -# Set a cron design to update your node versions -# -# [internal] -# -# This cron will check and update all minor node versions used by your apps. -# -# usage: _ynh_cron_upgrade_node -# -# Requires YunoHost version 2.7.12 or higher. -_ynh_cron_upgrade_node() { - # Build the update script - cat >"$n_install_dir/node_update.sh" <"/etc/cron.daily/node_update" <> $n_install_dir/node_update.log -EOF - - chmod +x "/etc/cron.daily/node_update" -} diff --git a/hooks/conf_regen/01-yunohost b/hooks/conf_regen/01-yunohost index 1d7a449e4..3d7bfa023 100755 --- a/hooks/conf_regen/01-yunohost +++ b/hooks/conf_regen/01-yunohost @@ -162,6 +162,8 @@ EOF mkdir -p ${pending_dir}/etc/dpkg/origins/ cp dpkg-origins ${pending_dir}/etc/dpkg/origins/yunohost + # Remove legacy hackish/clumsy nodejs autoupdate which ends up filling up space with ambiguous upgrades >_> + touch "/etc/cron.daily/node_update" } do_post_regen() {