]> git.wh0rd.org - home.git/commitdiff
update-vapier-nodejs: load base ver from Chromium DEPS
authorMike Frysinger <vapier@gentoo.org>
Sun, 24 Jun 2018 15:12:19 +0000 (11:12 -0400)
committerMike Frysinger <vapier@gentoo.org>
Sun, 24 Jun 2018 15:12:19 +0000 (11:12 -0400)
.bin/update-vapier-nodejs

index 4065953e62c948666b961b7af1df17cc27ba697b..f29a3b80a6dfa4e347eff01b18aa60a2818d6470 100755 (executable)
@@ -11,10 +11,13 @@ fi
 cd nodejs
 
 URL_GS_BASE='https://storage.googleapis.com/chromium-nodejs'
-URL_HASH_NODE='https://chromium.googlesource.com/chromium/src/+/master/third_party/node/linux/node-linux-x64.tar.gz.sha1?format=TEXT'
-URL_HASH_MOD='https://chromium.googlesource.com/chromium/src/+/master/third_party/node/node_modules.tar.gz.sha1?format=TEXT'
-# TODO: Find source of truth for this.
-VER="8.9.1"
+URL_CHROMIUM_BASE='https://chromium.googlesource.com/chromium/src/+/master'
+URL_DEPS="${URL_CHROMIUM_BASE}/DEPS?format=TEXT"
+URL_HASH_NODE="${URL_CHROMIUM_BASE}/third_party/node/linux/node-linux-x64.tar.gz.sha1?format=TEXT"
+URL_HASH_MOD="${URL_CHROMIUM_BASE}/third_party/node/node_modules.tar.gz.sha1?format=TEXT"
+
+hash=$(curl -s "${URL_DEPS}" | base64 -d)
+VER=$(echo "${hash}" | grep -o 'chromium-nodejs/[0-9.]*' | sort -u | cut -d/ -f2)
 
 hash=$(curl -s "${URL_HASH_NODE}" | base64 -d)
 dir='node-linux-x64'