* [PATCH 0/2] A couple of recipetool fixes
@ 2016-07-25 8:47 Paul Eggleton
2016-07-25 8:47 ` [PATCH 1/2] lib/oe/recipeutils: fix patch_recipe*() with empty input Paul Eggleton
2016-07-25 8:47 ` [PATCH 2/2] recipetool: record unknown license files Paul Eggleton
0 siblings, 2 replies; 3+ messages in thread
From: Paul Eggleton @ 2016-07-25 8:47 UTC (permalink / raw)
To: openembedded-core
One bug fix and one improvement for recipetool.
The following changes since commit 0a2df616a5c3316704742f1dcf37b450920e0280:
boost: fix CVE-2012-2677 (2016-07-21 07:45:01 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/recipetool-fixes4
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/recipetool-fixes4
Paul Eggleton (2):
lib/oe/recipeutils: fix patch_recipe*() with empty input
recipetool: record unknown license files
meta/lib/oe/recipeutils.py | 2 +-
scripts/lib/recipetool/create.py | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
--
2.5.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] lib/oe/recipeutils: fix patch_recipe*() with empty input
2016-07-25 8:47 [PATCH 0/2] A couple of recipetool fixes Paul Eggleton
@ 2016-07-25 8:47 ` Paul Eggleton
2016-07-25 8:47 ` [PATCH 2/2] recipetool: record unknown license files Paul Eggleton
1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2016-07-25 8:47 UTC (permalink / raw)
To: openembedded-core
If you supplied an empty file to patch_recipe() (or an empty list to
patch_recipe_lines()) then the result was IndexError because the code
checking to see if it needed to add an extra line of padding didn't
check to see if there were in fact any lines before trying to access the
last line.
Fixes [YOCTO #9972].
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/lib/oe/recipeutils.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 0e7abf8..c77664f 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -259,7 +259,7 @@ def patch_recipe_lines(fromlines, values, trailing_newline=True):
changed, tolines = bb.utils.edit_metadata(fromlines, varlist, patch_recipe_varfunc, match_overrides=True)
if remainingnames:
- if tolines[-1].strip() != '':
+ if tolines and tolines[-1].strip() != '':
tolines.append('\n')
for k in remainingnames.keys():
outputvalue(k, tolines)
--
2.5.5
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH 2/2] recipetool: record unknown license files
2016-07-25 8:47 [PATCH 0/2] A couple of recipetool fixes Paul Eggleton
2016-07-25 8:47 ` [PATCH 1/2] lib/oe/recipeutils: fix patch_recipe*() with empty input Paul Eggleton
@ 2016-07-25 8:47 ` Paul Eggleton
1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2016-07-25 8:47 UTC (permalink / raw)
To: openembedded-core
Add a comment to the recipe listing license files that were found but
not able to be identified, so that the user can find and examine them
by hand fairly easily.
Fixes [YOCTO #9882].
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
scripts/lib/recipetool/create.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index f246028..838c23b 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -479,12 +479,15 @@ def create_recipe(args):
licvalues = guess_license(srctree_use)
lic_files_chksum = []
+ lic_unknown = []
if licvalues:
licenses = []
for licvalue in licvalues:
if not licvalue[0] in licenses:
licenses.append(licvalue[0])
lic_files_chksum.append('file://%s;md5=%s' % (licvalue[1], licvalue[2]))
+ if licvalue[0] == 'Unknown':
+ lic_unknown.append(licvalue[1])
lines_before.append('# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is')
lines_before.append('# your responsibility to verify that the values are complete and correct.')
if len(licvalues) > 1:
@@ -493,6 +496,13 @@ def create_recipe(args):
lines_before.append('# these in the LICENSE value using & if the multiple licenses all apply, or | if there')
lines_before.append('# is a choice between the multiple licenses. If in doubt, check the accompanying')
lines_before.append('# documentation to determine which situation is applicable.')
+ if lic_unknown:
+ lines_before.append('#')
+ lines_before.append('# The following license files were not able to be identified and are')
+ lines_before.append('# represented as "Unknown" below, you will need to check them yourself:')
+ for licfile in lic_unknown:
+ lines_before.append('# %s' % licfile)
+ lines_before.append('#')
else:
lines_before.append('# Unable to find any files that looked like license statements. Check the accompanying')
lines_before.append('# documentation and source headers and set LICENSE and LIC_FILES_CHKSUM accordingly.')
--
2.5.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-07-25 8:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-25 8:47 [PATCH 0/2] A couple of recipetool fixes Paul Eggleton
2016-07-25 8:47 ` [PATCH 1/2] lib/oe/recipeutils: fix patch_recipe*() with empty input Paul Eggleton
2016-07-25 8:47 ` [PATCH 2/2] recipetool: record unknown license files Paul Eggleton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox