[oe-commits] [openembedded-core] 01/03: npm: get npm package name from npm pack
git at git.openembedded.org
git at git.openembedded.org
Mon May 20 11:32:14 UTC 2019
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit d281e98e578527e02e931f131d4ad872d016382c
Author: Jean-Marie LEMETAYER <jean-marie.lemetayer at savoirfairelinux.com>
AuthorDate: Fri May 17 17:14:08 2019 +0200
npm: get npm package name from npm pack
Fixes [YOCTO #12534]
When using npm packages with exotic names, like "JSONSelect" (with
uppercase) or "@angular/cli" (with at sign and slash), there are three
different names:
- the recipe name ("jsonselect" or "angular-cli")
- the npm module name ("JSONSelect" or "@angular/cli")
- the npm pack name ("JSONSelect" or "angular-cli")
The commit fa9c077068a2acea04389fa2b44eb2e93548fce2 allow to have
different recipe name and npm module name by setting the NPMPN variable.
This commit allows to have yet another npm pack name. The pack filename
is now dynamically retrieved from the 'npm pack' command.
Signed-off-by: Jean-Marie LEMETAYER <jean-marie.lemetayer at savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/classes/npm.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass
index 6dbae6b..3dd2d13 100644
--- a/meta/classes/npm.bbclass
+++ b/meta/classes/npm.bbclass
@@ -53,8 +53,8 @@ npm_do_install() {
# be created in this directory
export HOME=${WORKDIR}
mkdir -p ${D}${libdir}/node_modules
- npm pack .
- npm install --prefix ${D}${prefix} -g --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry ${NPMPN}-${PV}.tgz
+ local NPM_PACKFILE=$(npm pack .)
+ npm install --prefix ${D}${prefix} -g --arch=${NPM_ARCH} --target_arch=${NPM_ARCH} --production --no-registry ${NPM_PACKFILE}
mv ${D}${libdir}/node_modules ${D}${libdir}/node
if [ -d ${D}${prefix}/etc ] ; then
# This will be empty
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list