From 1d7319ae0614ca5cd152f3c9bfd87a2410d94b5a Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Wed, 20 Sep 2017 12:18:18 +0200 Subject: [PATCH] differentiate node package name from slackware package name as strange things like @angular/cli appear --- npm2tgz | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/npm2tgz b/npm2tgz index ca458fb..e1e8ad2 100755 --- a/npm2tgz +++ b/npm2tgz @@ -58,17 +58,19 @@ if [ "x$1" == "x" ] || [ "x$1" == "x--help" ] || [ "x$1" == "x-h" ]; then exit 1 fi -PRGNAM=$1 +NODE_PKG=$1 + +PRGNAM=$(echo $NODE_PKG | tr / _ | tr -d @) PKG=/tmp/$TAG/pkg-$PRGNAM [ -e $PKG ] && rm -fr $PKG mkdir -p $PKG -DESTDIR=$PKG npm install -g $PRGNAM +DESTDIR=$PKG npm install -g $NODE_PKG -VERSION=$(grep -io "\"version\": \"\(.*\)\"" $PKG${NPMROOT}/$PRGNAM/package.json | sed 's|^[ ]*"version": "\(.*\)"|\1|g') -DESCRIPTION=$(grep -i "\"description\": \"\(.*\)\"," $PKG${NPMROOT}/$PRGNAM/package.json | sed 's|^[ ]*"description": "\(.*\)",$|\1|g') -HOMEPAGE=$(grep -i "\"homepage\": \"\(.*\)\"," $PKG${NPMROOT}/$PRGNAM/package.json | sed 's|^[ ]*"homepage": "\(.*\)",$|\1|g') +VERSION=$(grep -io "\"version\": \"\(.*\)\"" $PKG${NPMROOT}/$NODE_PKG/package.json | sed 's|^[ ]*"version": "\(.*\)"|\1|g') +DESCRIPTION=$(grep -i "\"description\": \"\(.*\)\"," $PKG${NPMROOT}/$NODE_PKG/package.json | sed 's|^[ ]*"description": "\(.*\)",$|\1|g') +HOMEPAGE=$(grep -i "\"homepage\": \"\(.*\)\"," $PKG${NPMROOT}/$NODE_PKG/package.json | sed 's|^[ ]*"homepage": "\(.*\)",$|\1|g') mkdir -p $PKG/install cat < $PKG/install/slack-desc