Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2014-12-11 20:57:08 +0300
committerisaacs <i@izs.me>2014-12-11 20:57:08 +0300
commit16d854283ca5bcdb0cb2812fc5745d841652b952 (patch)
tree45e10b00c277bff569e5d4d2e9cee44e287607d0 /scripts
parent818b683dd07335d79a38cef3f262fea8bcfd24ea (diff)
install.sh: Drop support for node <0.8, remove engines bits
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install.sh59
1 files changed, 8 insertions, 51 deletions
diff --git a/scripts/install.sh b/scripts/install.sh
index 74840459e..e6624f061 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -56,7 +56,7 @@ ret=$?
if [ $ret -eq 0 ] && [ -x "$node" ]; then
(exit 0)
else
- echo "npm cannot be installed without nodejs." >&2
+ echo "npm cannot be installed without node.js." >&2
echo "Install node first, and then try again." >&2
echo "" >&2
echo "Maybe node is installed, but not in the PATH?" >&2
@@ -118,11 +118,11 @@ MAKE=NOMAKE
if [ "x$MAKE" = "x" ]; then
make=`which gmake 2>&1`
- if [ $? -eq 0 ] && [ -x $make ]; then
+ if [ $? -eq 0 ] && [ -x "$make" ]; then
(exit 0)
else
make=`which make 2>&1`
- if [ $? -eq 0 ] && [ -x $make ]; then
+ if [ $? -eq 0 ] && [ -x "$make" ]; then
(exit 0)
else
make=NOMAKE
@@ -161,15 +161,11 @@ if [ -z "$t" ]; then
# switch based on node version.
# note that we can only use strict sh-compatible patterns here.
case $node_version in
- 0.[012345].* | v0.[012345].*)
+ 0.[01234567].* | v0.[01234567].*)
echo "You are using an outdated and unsupported version of" >&2
echo "node ($node_version). Please update node and try again." >&2
exit 99
;;
- v0.[678].* | 0.[678].*)
- echo "install npm@1.1"
- t=1.1
- ;;
*)
echo "install npm@latest"
t="latest"
@@ -177,32 +173,9 @@ if [ -z "$t" ]; then
esac
fi
-# the npmca cert
-cacert='
------BEGIN CERTIFICATE-----
-MIIChzCCAfACCQDauvz/KHp8ejANBgkqhkiG9w0BAQUFADCBhzELMAkGA1UEBhMC
-VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMQwwCgYDVQQKEwNucG0x
-IjAgBgNVBAsTGW5wbSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxDjAMBgNVBAMTBW5w
-bUNBMRcwFQYJKoZIhvcNAQkBFghpQGl6cy5tZTAeFw0xMTA5MDUwMTQ3MTdaFw0y
-MTA5MDIwMTQ3MTdaMIGHMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNV
-BAcTB09ha2xhbmQxDDAKBgNVBAoTA25wbTEiMCAGA1UECxMZbnBtIENlcnRpZmlj
-YXRlIEF1dGhvcml0eTEOMAwGA1UEAxMFbnBtQ0ExFzAVBgkqhkiG9w0BCQEWCGlA
-aXpzLm1lMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLI4tIqPpRW+ACw9GE
-OgBlJZwK5f8nnKCLK629Pv5yJpQKs3DENExAyOgDcyaF0HD0zk8zTp+ZsLaNdKOz
-Gn2U181KGprGKAXP6DU6ByOJDWmTlY6+Ad1laYT0m64fERSpHw/hjD3D+iX4aMOl
-y0HdbT5m1ZGh6SJz3ZqxavhHLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAC4ySDbC
-l7W1WpLmtLGEQ/yuMLUf6Jy/vr+CRp4h+UzL+IQpCv8FfxsYE7dhf/bmWTEupBkv
-yNL18lipt2jSvR3v6oAHAReotvdjqhxddpe5Holns6EQd1/xEZ7sB1YhQKJtvUrl
-ZNufy1Jf1r0ldEGeA+0ISck7s+xSh9rQD2Op
------END CERTIFICATE-----
-'
-
-echo "$cacert" > "$TMP/cafile.crt"
-cacert="$TMP/cafile.crt"
-
# need to echo "" after, because Posix sed doesn't treat EOF
# as an implied end of line.
-url=`(curl -SsL --cacert "$cacert" https://registry.npmjs.org/npm/$t; echo "") \
+url=`(curl -SsL https://registry.npmjs.org/npm/$t; echo "") \
| sed -e 's/^.*tarball":"//' \
| sed -e 's/".*$//'`
@@ -210,7 +183,7 @@ ret=$?
if [ "x$url" = "x" ]; then
ret=125
# try without the -e arg to sed.
- url=`(curl -SsL --cacert "$cacert" https://registry.npmjs.org/npm/$t; echo "") \
+ url=`(curl -SsL https://registry.npmjs.org/npm/$t; echo "") \
| sed 's/^.*tarball":"//' \
| sed 's/".*$//'`
ret=$?
@@ -227,28 +200,12 @@ fi
echo "fetching: $url" >&2
cd "$TMP" \
- && curl -SsL --cacert "$cacert" "$url" \
+ && curl -SsL "$url" \
| $tar -xzf - \
- && rm "$cacert" \
&& cd "$TMP"/* \
- && (req=`"$node" bin/read-package-json.js package.json engines.node`
- if [ -d node_modules ]; then
- "$node" node_modules/semver/bin/semver -v "$node_version" -r "$req"
- ret=$?
- else
- "$node" bin/semver.js -v "$node_version" -r "$req"
- ret=$?
- fi
- if [ $ret -ne 0 ]; then
- echo "You need node $req to run this program." >&2
- echo "node --version reports: $node_version" >&2
- echo "Please upgrade node before continuing." >&2
- exit $ret
- fi) \
&& (ver=`"$node" bin/read-package-json.js package.json version`
isnpm10=0
if [ $ret -eq 0 ]; then
- req=`"$node" bin/read-package-json.js package.json engines.node`
if [ -d node_modules ]; then
if "$node" node_modules/semver/bin/semver -v "$ver" -r "1"
then
@@ -288,7 +245,7 @@ cd "$TMP" \
&& (if [ "x$configures" = "x" ]; then
(exit 0)
else
- echo "./configure "$configures
+ echo "./configure $configures"
echo "$configures" > npmrc
fi) \
&& (if [ "$make" = "NOMAKE" ]; then