From 31ce18571271e98df60765d112b95d3a5773fe30 Mon Sep 17 00:00:00 2001 From: Dimazhan Date: Thu, 15 Mar 2018 23:32:49 +0700 Subject: [PATCH] cjdns: store node sources to openwrt download dir --- cjdns/patches/100-nodejs.patch | 41 ++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 cjdns/patches/100-nodejs.patch diff --git a/cjdns/patches/100-nodejs.patch b/cjdns/patches/100-nodejs.patch new file mode 100644 index 0000000..66c1c0a --- /dev/null +++ b/cjdns/patches/100-nodejs.patch @@ -0,0 +1,41 @@ +diff --git a/node_build/node.sh b/node_build/node.sh +index f6b9291..b98ecd8 100755 +--- a/node_build/node.sh ++++ b/node_build/node.sh +@@ -125,19 +125,23 @@ getNode() { + "$INSTALL_PATH" -d "$NODEDIR/nodejs" + + cd "$NODEDIR/nodejs" +- node_dl="node-${DLVER}.tar.gz" +- if cmdExists wget; then +- printf '\n%s %s ' '==>' "Downloading $NODEURL with wget..." +- wget -q "$NODEURL" -O "$node_dl" || die "failed to download $NODEURL"; +- elif cmdExists curl; then +- printf '%s %s ' '==>' "Downloading $NODEURL with curl..." +- curl -s "$NODEURL" > "$node_dl" || die "failed to download $NODEURL"; +- elif cmdExists fetch; then +- printf '%s %s ' '==>' "Downloading $NODEURL with fetch..." +- fetch "$NODEURL" -o "$node_dl" || die "failed to download $NODEURL"; +- else +- die 'wget, curl or fetch is required download node.js but you have none!' +- fi ++ DL_DIR=$(cat ../../../../../.config | grep CONFIG_DOWNLOAD_FOLDER | cut -d\" -f2) ++ [ "$DL_DIR" = "" ] && DL_DIR="../../../../../dl" ++ node_dl="${DL_DIR}/node-$DLVER-$PLATFORM-$march.tar.gz" ++ if [ ! -f "$node_dl" ]; then ++ if cmdExists wget; then ++ printf '\n%s %s ' '==>' "Downloading $NODEURL with wget..." ++ wget -q "$NODEURL" -O "$node_dl" || die "failed to download $NODEURL"; ++ elif cmdExists curl; then ++ printf '%s %s ' '==>' "Downloading $NODEURL with curl..." ++ curl -s "$NODEURL" > "$node_dl" || die "failed to download $NODEURL"; ++ elif cmdExists fetch; then ++ printf '%s %s ' '==>' "Downloading $NODEURL with fetch..." ++ fetch "$NODEURL" -o "$node_dl" || die "failed to download $NODEURL"; ++ else ++ die 'wget, curl or fetch is required download node.js but you have none!' ++ fi ++ fi + [ -f "$node_dl" ] || die 'Failed to download node.js' + printf '%s\n' 'DONE!' +