* [PATCH 0/2] recipetool npm fixes
@ 2016-04-27 13:06 Paul Eggleton
2016-04-27 13:06 ` [PATCH 1/2] recipetool: create: fix picking up false npm package directories Paul Eggleton
2016-04-27 13:06 ` [PATCH 2/2] recipetool: create: fix falling back to declared license for npm packages Paul Eggleton
0 siblings, 2 replies; 3+ messages in thread
From: Paul Eggleton @ 2016-04-27 13:06 UTC (permalink / raw)
To: openembedded-core
The following changes since commit e2dbe5eb869b8336b91023b83d7ca866197efa73:
license.bbclass: make sure that image manifest dir exists (2016-04-22 16:28:47 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/recipetool-npm-fixes
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/recipetool-npm-fixes
Paul Eggleton (2):
recipetool: create: fix picking up false npm package directories
recipetool: create: fix falling back to declared license for npm
packages
meta/lib/oe/package.py | 2 +-
scripts/lib/recipetool/create.py | 2 +-
scripts/lib/recipetool/create_npm.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
--
2.5.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] recipetool: create: fix picking up false npm package directories
2016-04-27 13:06 [PATCH 0/2] recipetool npm fixes Paul Eggleton
@ 2016-04-27 13:06 ` Paul Eggleton
2016-04-27 13:06 ` [PATCH 2/2] recipetool: create: fix falling back to declared license for npm packages Paul Eggleton
1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2016-04-27 13:06 UTC (permalink / raw)
To: openembedded-core
It is possible for a Node.js module to have node_modules subdirectories
that contain no package.json file (e.g. iotivity-node has such a
directory). It appears these should simply be ignored, or else with the
way the current code works we will get errors later.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/lib/oe/package.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index 2887689..252e32d 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -149,7 +149,7 @@ def npm_split_package_dirs(pkgdir):
if os.path.exists(pkgfile):
with open(pkgfile, 'r') as f:
data = json.loads(f.read())
- packages[pkgname] = (relpth, data)
+ packages[pkgname] = (relpth, data)
# We want the main package for a module sorted *after* its subpackages
# (so that it doesn't otherwise steal the files for the subpackage), so
# this is a cheap way to do that whilst still having an otherwise
--
2.5.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] recipetool: create: fix falling back to declared license for npm packages
2016-04-27 13:06 [PATCH 0/2] recipetool npm fixes Paul Eggleton
2016-04-27 13:06 ` [PATCH 1/2] recipetool: create: fix picking up false npm package directories Paul Eggleton
@ 2016-04-27 13:06 ` Paul Eggleton
1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2016-04-27 13:06 UTC (permalink / raw)
To: openembedded-core
Fix two problems falling back to the "license" field from package.json
when no license file is present:
1) The function that was supposed to return the license field value was
always explicitly returning None, and this was never noticed (because
the test cases never exercised the fallback as they provided license
files for each module).
2) Fix the main package not falling back because it had a default of an
empty list, which evaluates to '' instead of 'Unknown'.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
scripts/lib/recipetool/create.py | 2 +-
scripts/lib/recipetool/create_npm.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index bb9fb9b..aade40b 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -854,7 +854,7 @@ def split_pkg_licenses(licvalues, packages, outlines, fallback_licenses=None, pn
pkglicenses[pn].append(license)
outlicenses = {}
for pkgname in packages:
- license = ' '.join(list(set(pkglicenses.get(pkgname, ['Unknown']))))
+ license = ' '.join(list(set(pkglicenses.get(pkgname, ['Unknown'])))) or 'Unknown'
if license == 'Unknown' and pkgname in fallback_licenses:
license = fallback_licenses[pkgname]
outlines.append('LICENSE_%s = "%s"' % (pkgname, license))
diff --git a/scripts/lib/recipetool/create_npm.py b/scripts/lib/recipetool/create_npm.py
index b3ffcdb..cc4fb42 100644
--- a/scripts/lib/recipetool/create_npm.py
+++ b/scripts/lib/recipetool/create_npm.py
@@ -45,7 +45,7 @@ class NpmRecipeHandler(RecipeHandler):
license = data['license']
if isinstance(license, dict):
license = license.get('type', None)
- return None
+ return license
def _shrinkwrap(self, srctree, localfilesdir, extravalues, lines_before):
try:
--
2.5.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-27 13:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-27 13:06 [PATCH 0/2] recipetool npm fixes Paul Eggleton
2016-04-27 13:06 ` [PATCH 1/2] recipetool: create: fix picking up false npm package directories Paul Eggleton
2016-04-27 13:06 ` [PATCH 2/2] recipetool: create: fix falling back to declared license for npm packages Paul Eggleton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox