From ada94aec188d091b174c6d39d6d2ec420f3ce944 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 30 May 2020 17:30:38 +0200 Subject: [PATCH 1/6] Update n to upstream version (6.5.1) --- data/helpers.d/nodejs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/data/helpers.d/nodejs b/data/helpers.d/nodejs index 3ad0c400f..61e02c8ad 100644 --- a/data/helpers.d/nodejs +++ b/data/helpers.d/nodejs @@ -16,8 +16,8 @@ ynh_install_n () { ynh_print_info --message="Installation of N - Node.js version management" # Build an app.src for n mkdir --parents "../conf" - echo "SOURCE_URL=https://github.com/tj/n/archive/v4.1.0.tar.gz -SOURCE_SUM=3983fa3f00d4bf85ba8e21f1a590f6e28938093abe0bb950aeea52b1717471fc" > "../conf/n.src" + echo "SOURCE_URL=https://github.com/tj/n/archive/v6.5.1.tar.gz +SOURCE_SUM=5833f15893b9951a9ed59487e87b6c181d96b83a525846255872c4f92f0d25dd" > "../conf/n.src" # Download and extract n ynh_setup_source --dest_dir="$n_install_dir/git" --source_id=n # Install n @@ -125,7 +125,10 @@ ynh_install_nodejs () { test -x /usr/bin/npm && mv /usr/bin/npm /usr/bin/npm_n # If n is not previously setup, install it - if ! test $(n --version > /dev/null 2>&1) + if ! type n > /dev/null 2>&1 + then + ynh_install_n + elif dpkg --compare-version "$($n_install_dir/bin/n --version | cut -d" " -f2)" lt "6.5.1" then ynh_install_n fi From faedbc534fac871a6e0c417c2c7165c5a6c47a0c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 31 May 2020 18:02:29 +0200 Subject: [PATCH 2/6] Update nodejs --- data/helpers.d/nodejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/helpers.d/nodejs b/data/helpers.d/nodejs index 61e02c8ad..5cb5c4fae 100644 --- a/data/helpers.d/nodejs +++ b/data/helpers.d/nodejs @@ -125,7 +125,7 @@ ynh_install_nodejs () { test -x /usr/bin/npm && mv /usr/bin/npm /usr/bin/npm_n # If n is not previously setup, install it - if ! type n > /dev/null 2>&1 + if ! type $(n --version > /dev/null 2>&1) then ynh_install_n elif dpkg --compare-version "$($n_install_dir/bin/n --version | cut -d" " -f2)" lt "6.5.1" From 66bc921c4a466411edbd2dbc2d18ec23d5203c0d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 3 Jun 2020 19:11:56 +0200 Subject: [PATCH 3/6] fix stupid mistake --- data/helpers.d/nodejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/helpers.d/nodejs b/data/helpers.d/nodejs index 5cb5c4fae..ba9225293 100644 --- a/data/helpers.d/nodejs +++ b/data/helpers.d/nodejs @@ -125,7 +125,7 @@ ynh_install_nodejs () { test -x /usr/bin/npm && mv /usr/bin/npm /usr/bin/npm_n # If n is not previously setup, install it - if ! type $(n --version > /dev/null 2>&1) + if ! test $(n --version > /dev/null 2>&1) then ynh_install_n elif dpkg --compare-version "$($n_install_dir/bin/n --version | cut -d" " -f2)" lt "6.5.1" From 63e6abdf1e81be4e5681e2a7034f66eda3da3811 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 4 Jun 2020 11:23:51 +0200 Subject: [PATCH 4/6] add n_version variable --- data/helpers.d/nodejs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/helpers.d/nodejs b/data/helpers.d/nodejs index ba9225293..f1a4b3788 100644 --- a/data/helpers.d/nodejs +++ b/data/helpers.d/nodejs @@ -1,5 +1,6 @@ #!/bin/bash +n_version=6.5.1 n_install_dir="/opt/node_n" node_version_path="$n_install_dir/n/versions/node" # N_PREFIX is the directory of n, it needs to be loaded as a environment variable. @@ -16,7 +17,7 @@ ynh_install_n () { ynh_print_info --message="Installation of N - Node.js version management" # Build an app.src for n mkdir --parents "../conf" - echo "SOURCE_URL=https://github.com/tj/n/archive/v6.5.1.tar.gz + echo "SOURCE_URL=https://github.com/tj/n/archive/v${n_version}.tar.gz SOURCE_SUM=5833f15893b9951a9ed59487e87b6c181d96b83a525846255872c4f92f0d25dd" > "../conf/n.src" # Download and extract n ynh_setup_source --dest_dir="$n_install_dir/git" --source_id=n @@ -128,7 +129,7 @@ ynh_install_nodejs () { if ! test $(n --version > /dev/null 2>&1) then ynh_install_n - elif dpkg --compare-version "$($n_install_dir/bin/n --version | cut -d" " -f2)" lt "6.5.1" + elif dpkg --compare-version "$($n_install_dir/bin/n --version | cut -d" " -f2)" lt $n_version then ynh_install_n fi From c62527a0afe8a3e7d1774eacb2bc658c0f3cd197 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 4 Jun 2020 15:04:02 +0200 Subject: [PATCH 5/6] Update data/helpers.d/nodejs Co-authored-by: Kayou --- data/helpers.d/nodejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/helpers.d/nodejs b/data/helpers.d/nodejs index f1a4b3788..7ba692f96 100644 --- a/data/helpers.d/nodejs +++ b/data/helpers.d/nodejs @@ -129,7 +129,7 @@ ynh_install_nodejs () { if ! test $(n --version > /dev/null 2>&1) then ynh_install_n - elif dpkg --compare-version "$($n_install_dir/bin/n --version | cut -d" " -f2)" lt $n_version + elif dpkg --compare-versions "$($n_install_dir/bin/n --version)" lt $n_version then ynh_install_n fi From 2ab56428f882fb32d4d603abf4329638ab14be39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 5 Jun 2020 11:27:43 +0200 Subject: [PATCH 6/6] Update data/helpers.d/nodejs Co-authored-by: Kayou --- data/helpers.d/nodejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/helpers.d/nodejs b/data/helpers.d/nodejs index 7ba692f96..75472c278 100644 --- a/data/helpers.d/nodejs +++ b/data/helpers.d/nodejs @@ -126,7 +126,7 @@ ynh_install_nodejs () { test -x /usr/bin/npm && mv /usr/bin/npm /usr/bin/npm_n # If n is not previously setup, install it - if ! test $(n --version > /dev/null 2>&1) + if ! $n_install_dir/bin/n --version > /dev/null 2>&1 then ynh_install_n elif dpkg --compare-versions "$($n_install_dir/bin/n --version)" lt $n_version