Преглед изворни кода

Upgrade nodejs to the new LTS

Bob Mottram пре 7 година
родитељ
комит
adb038143d
2 измењених фајлова са 16 додато и 4 уклоњено
  1. 1
    0
      src/freedombone-upgrade
  2. 15
    4
      src/freedombone-utils-nodejs

+ 1
- 0
src/freedombone-upgrade Прегледај датотеку

97
         fi
97
         fi
98
 
98
 
99
         #rebuild_exim_with_socks
99
         #rebuild_exim_with_socks
100
+        nodejs_upgrade
100
         apt-get -yq -t stretch-backports install certbot
101
         apt-get -yq -t stretch-backports install certbot
101
         email_install_tls
102
         email_install_tls
102
         email_disable_chunking
103
         email_disable_chunking

+ 15
- 4
src/freedombone-utils-nodejs Прегледај датотеку

35
 
35
 
36
 # change these versions at your peril. Things will often crash if you don't
36
 # change these versions at your peril. Things will often crash if you don't
37
 # have specifically the correct versions
37
 # have specifically the correct versions
38
-NODEJS_VERSION='6.11.4'
38
+NODEJS_VERSION='8.11.1'
39
 NODEJS_N_VERSION='2.1.7'
39
 NODEJS_N_VERSION='2.1.7'
40
-NPM_VERSION='4.0.5'
40
+NPM_VERSION='5.6.0'
41
 
41
 
42
 # This file keeps track of the apps needing nodejs
42
 # This file keeps track of the apps needing nodejs
43
 # so that it can be removed if tere are no apps which need it
43
 # so that it can be removed if tere are no apps which need it
75
         exit 6389252
75
         exit 6389252
76
     fi
76
     fi
77
     $mesh_install_nodejs_prefix apt-key add /root/node.gpg.key
77
     $mesh_install_nodejs_prefix apt-key add /root/node.gpg.key
78
-    echo "deb https://deb.nodesource.com/node_6.x stretch main" > "$rootdir/etc/apt/sources.list.d/nodesource.list"
79
-    echo "deb-src https://deb.nodesource.com/node_6.x stretch main" >> "$rootdir/etc/apt/sources.list.d/nodesource.list"
78
+    echo "deb https://deb.nodesource.com/node_8.x stretch main" > "$rootdir/etc/apt/sources.list.d/nodesource.list"
79
+    echo "deb-src https://deb.nodesource.com/node_8.x stretch main" >> "$rootdir/etc/apt/sources.list.d/nodesource.list"
80
 
80
 
81
     $mesh_install_nodejs_prefix apt-mark -q unhold nodejs
81
     $mesh_install_nodejs_prefix apt-mark -q unhold nodejs
82
     $mesh_install_nodejs_prefix apt-get update
82
     $mesh_install_nodejs_prefix apt-get update
159
     rm "$rootdir/usr/bin/test_nodejs_install"
159
     rm "$rootdir/usr/bin/test_nodejs_install"
160
 }
160
 }
161
 
161
 
162
+function nodejs_upgrade {
163
+    if [ ! -f /etc/apt/sources.list.d/nodesource.list ]; then
164
+        return
165
+    fi
166
+    if grep -q "node_8.x" /etc/apt/sources.list.d/nodesource.list; then
167
+        return
168
+    fi
169
+    rootdir=
170
+    mesh_install_nodejs
171
+}
172
+
162
 function remove_nodejs {
173
 function remove_nodejs {
163
     if [ ! "$1" ]; then
174
     if [ ! "$1" ]; then
164
         return
175
         return