<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/scripts/lib/recipetool/create.py, branch yocto-5.2.4</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=yocto-5.2.4</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=yocto-5.2.4'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2024-08-23T08:51:36+00:00</updated>
<entry>
<title>recipetool: create_npm: reuse license utils</title>
<updated>2024-08-23T08:51:36+00:00</updated>
<author>
<name>Enguerrand de Ribaucourt</name>
<email>enguerrand.de-ribaucourt@savoirfairelinux.com</email>
</author>
<published>2024-08-12T12:28:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=0a0caacfa54dd086b87e31f5e806e5f21d5ffc3f'/>
<id>urn:sha1:0a0caacfa54dd086b87e31f5e806e5f21d5ffc3f</id>
<content type='text'>
create_npm.py duplicated the logic for matching licenses from files and
also finding them. This patch refactors the code to reuse the license
utils. This will make the code more maintainable and also align both
behaviors. For instance, some licenses weren't matched properly because
the duplicate logic did not support the difference in format in the md5
tables for COMMON_LICENSE_DIR and licenses.csv.

This is also faster since the license files were being read twice.
The result is slightly more accurate since the utils have better
implementations, and I was able to reuse the logic for the root PN
package, as well as the base LICENSE variable.

I chose to extract generate_common_licenses_chksums into create.py
since it can be considered a general utility function to allow
other recipetool creators to refer to COMMON_LICENSE_DIR files.

I updated the wording in the code when appropriate.

v3:
 - added commit
 - this replaces the commit that added all the COMMON_LICENSE_DIR md5
   to licenses.csv

(From OE-Core rev: 7bc18bed63b94689890bcde63402d7cc1cedffa9)

Signed-off-by: Enguerrand de Ribaucourt &lt;enguerrand.de-ribaucourt@savoirfairelinux.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>recipetool: create: split guess_license function</title>
<updated>2024-08-23T08:51:36+00:00</updated>
<author>
<name>Enguerrand de Ribaucourt</name>
<email>enguerrand.de-ribaucourt@savoirfairelinux.com</email>
</author>
<published>2024-08-12T12:28:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=69bf37a3dd0470dc153bb7a21bd8f13a64bde2c3'/>
<id>urn:sha1:69bf37a3dd0470dc153bb7a21bd8f13a64bde2c3</id>
<content type='text'>
The npm recipetool handler redefines the license code the could be
unified. In order to do this refactoring, extract the bits we'll
need into separate functions.

guess_license() is renamed to find_licenses() and is split into
find_license_files() and match_licenses().

(From OE-Core rev: f1ec28feaea8ea6a2df894dd4ddba561c8a04ed2)

Signed-off-by: Enguerrand de Ribaucourt &lt;enguerrand.de-ribaucourt@savoirfairelinux.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>recipetool/devtool: Update to work correctly with UNPACKDIR</title>
<updated>2024-05-22T21:26:30+00:00</updated>
<author>
<name>Richard Purdie</name>
<email>richard.purdie@linuxfoundation.org</email>
</author>
<published>2024-05-13T15:02:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=569f8e09f0b077045d112dd569cbc4d47fdae08e'/>
<id>urn:sha1:569f8e09f0b077045d112dd569cbc4d47fdae08e</id>
<content type='text'>
Tweak recipetool and devtool to correctly use UNPACKDIR. This allows some
simplification of the code. This patch makes things basically work but there
are likely deeper improvements that can be made now that WORKDIR != UNPACKDIR.

(From OE-Core rev: d2eeaa88b27a2875c419591d1d91bcc85d7b129c)

Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>scripts: python 3.12 regex</title>
<updated>2024-02-13T13:51:41+00:00</updated>
<author>
<name>Adrian Freihofer</name>
<email>adrian.freihofer@gmail.com</email>
</author>
<published>2024-02-10T13:15:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=605ef6f5a292fe169b1469b0a8996f3d5ae53daf'/>
<id>urn:sha1:605ef6f5a292fe169b1469b0a8996f3d5ae53daf</id>
<content type='text'>
All the regexes throw a warning like this:

WARNING: scripts/lib/recipetool/create_buildsys.py:140:
      SyntaxWarning: invalid escape sequence '\s'
      proj_re = re.compile('project\s*\(([^)]*)\)', re.IGNORECASE)

Python 3 interprets string literals as Unicode strings, and therefore
\s is treated as an escaped Unicode character which is not correct.
Declaring the RegEx pattern as a raw string instead of unicode is
required for Python 3.

(From OE-Core rev: 24b0ba00d4f0b4d9834f7693ecb6032dfc534a80)

Signed-off-by: Adrian Freihofer &lt;adrian.freihofer@siemens.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>recipetool: create: Only include the expected SRC_URI checksums</title>
<updated>2023-12-08T16:58:34+00:00</updated>
<author>
<name>Peter Kjellerstedt</name>
<email>peter.kjellerstedt@axis.com</email>
</author>
<published>2023-12-07T17:48:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=45d2f8d4bc2ca7c16379334a93ea172a538a6bb2'/>
<id>urn:sha1:45d2f8d4bc2ca7c16379334a93ea172a538a6bb2</id>
<content type='text'>
Rather than including all SRC_URI checksums, include the ones that are
expected. These are the same as are output if no checksums are included
when building the recipe.

(From OE-Core rev: c2af83eb5e8573480179b6c0bcce50606b547099)

Signed-off-by: Peter Kjellerstedt &lt;peter.kjellerstedt@axis.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>recipetool: create: Improve identification of licenses</title>
<updated>2023-12-08T16:58:34+00:00</updated>
<author>
<name>Peter Kjellerstedt</name>
<email>peter.kjellerstedt@axis.com</email>
</author>
<published>2023-12-06T20:55:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=decf6e66dfe3d688c93b3ff811077c46cb9883bb'/>
<id>urn:sha1:decf6e66dfe3d688c93b3ff811077c46cb9883bb</id>
<content type='text'>
Rather than having a static list of crunched MD5 checksums for some of
the most common licenses, calculate it for all common licenses. This
should improve the identification of license text variantions.

(From OE-Core rev: 377f9513dc56e9b8e5f5813c1535be0206756949)

Signed-off-by: Peter Kjellerstedt &lt;peter.kjellerstedt@axis.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>recipetool: create_buildsys_python: add pypi support</title>
<updated>2023-12-06T22:55:49+00:00</updated>
<author>
<name>Julien Stephan</name>
<email>jstephan@baylibre.com</email>
</author>
<published>2023-12-04T15:59:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=85a2a6f68af304ace1d767e3e8367627cea898f6'/>
<id>urn:sha1:85a2a6f68af304ace1d767e3e8367627cea898f6</id>
<content type='text'>
Today, we can use devtool/recipetool to create recipes for python projects
using the github url or the direct release tarball of the project, but the
create_buildsys_python plugin doesn't support the pypi class, since we cannot
know from the extracted source if the package is available on pypi or not.

By implementing the new optional process_url callback, we can detect
that the url is a pypi one (i.e 'https://pypi.org/project/&lt;package&gt;')
and retrieve the release tarball location.
Also detect if the url points to a release tarball hosted on
"files.pythonhosted.iorg" (i.e https://files.pythonhosted.org/packages/...)

In both cases, adds the pypi class, remove 'S' and 'SRC_URIxxx'
variables from the created recipe as they will be handled by the pypi class
and add the PYPI_PACKAGE variable

This helps to produce cleaner recipes when package is hosted on pypi.

If the url points to a github url or a release tarball not coming from
"files.pythonhosted.org", the created recipe is the same as before.
One can also use the newly added "--no-pypi" switch to NOT inherit
from pypi class on matching url, to keep legacy behaviour.

To create a recipe for a pypi package, one can now use one of the
new following syntax (using recipetool create / devtool add):

* recipetool create https://pypi.org/project/&lt;package&gt;
* recipetool create https://pypi.org/project/&lt;package&gt;/&lt;version&gt;
* recipetool create https://pypi.org/project/&lt;package&gt; --version &lt;version&gt;

or the old syntax:
* recipetool create https://files.pythonhosted.org/packages/&lt;...&gt;

(From OE-Core rev: 097a43846cd99a7d74d004efc57f583ce78970a4)

Signed-off-by: Julien Stephan &lt;jstephan@baylibre.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>recipetool: create: add new optional process_url callback for plugins</title>
<updated>2023-12-06T22:55:49+00:00</updated>
<author>
<name>Julien Stephan</name>
<email>jstephan@baylibre.com</email>
</author>
<published>2023-12-04T15:59:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=6c06fb0a4395bd98918cbcdb16e93e094e79226e'/>
<id>urn:sha1:6c06fb0a4395bd98918cbcdb16e93e094e79226e</id>
<content type='text'>
Add a new process_url callback that plugins can optionally implement if
they which to handle url.

Plugins can implement this callback for example, to:
* transform the url
* add special variables using extravalues
* add extra classes
* ...

If a plugin handles the url, it must append 'url' to the handled
list and must return the fetchuri

No functional changes expected for plugins non implementing this
optional callback

(From OE-Core rev: 3e5ce351e7dbe283562bf1db1f2ce3b121c49b53)

Signed-off-by: Julien Stephan &lt;jstephan@baylibre.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>recipetool: create: add trailing newlines</title>
<updated>2023-12-06T22:55:49+00:00</updated>
<author>
<name>Julien Stephan</name>
<email>jstephan@baylibre.com</email>
</author>
<published>2023-12-04T15:59:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=86b9510bd3b7d6235fc5f83de66746c7c2dbba82'/>
<id>urn:sha1:86b9510bd3b7d6235fc5f83de66746c7c2dbba82</id>
<content type='text'>
create_recipe() function relies on oe.recipeutils.patch_recipe_lines()
which relies on bb.utils.edit_metadata(). edit_metada expect lines to
have trailing newlines, so add it to each lines before calling
patch_recipe_lines, otherwise edit_metadata will not be able to squash
blank line if there are two consecutive blanks after a removal

(From OE-Core rev: 31b27cc76a1b669e2b126c332608fd772c124d69)

Signed-off-by: Julien Stephan &lt;jstephan@baylibre.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>recipetool: Ignore *.go files while scanning for licenses</title>
<updated>2023-11-06T16:41:11+00:00</updated>
<author>
<name>Lukas Funke</name>
<email>lukas.funke@weidmueller.com</email>
</author>
<published>2023-11-02T15:53:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=f7f304fa3eac4ac02b39497e6aa89217a55bd51d'/>
<id>urn:sha1:f7f304fa3eac4ac02b39497e6aa89217a55bd51d</id>
<content type='text'>
(From OE-Core rev: 1765acc8bdc08e392daa8b77add8b4ce1a9e70b6)

Signed-off-by: Lukas Funke &lt;lukas.funke@weidmueller.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
