diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-09-06 10:57:30 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-06 10:35:04 +0100 |
commit | e6a94d2091ec5d42f25102334a8492a731b8dec3 (patch) | |
tree | 2429269042e5d96cc2163a59872eb03e9a750fb8 | |
parent | 1435b49ea7d0f9d4cc4a665fb2aa83d1eea7900f (diff) | |
download | bitbake-contrib-e6a94d2091ec5d42f25102334a8492a731b8dec3.tar.gz |
fetch2/npm: support subdir= parameter
"npmpkg" can be a default, but it should respect the subdir parameter as
with other FetchMethods. This allows us to have more than one npm://
entry in SRC_URI without nasty hacks.
Fix required in order to support [YOCTO #9537].
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/fetch2/npm.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bb/fetch2/npm.py b/lib/bb/fetch2/npm.py index 9b2d9e162..134bd3522 100644 --- a/lib/bb/fetch2/npm.py +++ b/lib/bb/fetch2/npm.py @@ -138,7 +138,12 @@ class Npm(FetchMethod): workobj = json.load(datafile) dldir = "%s/%s" % (os.path.dirname(ud.localpath), ud.pkgname) - self._unpackdep(ud, ud.pkgname, workobj, "%s/npmpkg" % destdir, dldir, d) + if 'subdir' in ud.parm: + unpackdir = '%s/%s' % (destdir, ud.parm.get('subdir')) + else: + unpackdir = '%s/npmpkg' % destdir + + self._unpackdep(ud, ud.pkgname, workobj, unpackdir, dldir, d) def _parse_view(self, output): ''' |