Commit Graph

13 Commits

Author SHA1 Message Date
Adrian Freihofer
605ef6f5a2 scripts: python 3.12 regex
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 <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-13 13:51:41 +00:00
Joshua Watt
3e5ce0275a scripts: convert-overrides: Allow command-line customizations
Adds argument parsing to the conversion script so that the fields that
the script uses to do conversions can be customized on the command line.
The intention is to allows easier customization without having to fork
the script, and allow automated checking on 3rd party layers via CI
without false positives

(From OE-Core rev: b9551f9180bf9f13fb1c480b5b7892fdc831ffcd)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-11-14 16:19:42 +00:00
Chen Qi
62372aedfe convert-overrides.py: also convert comments without a leading whitespace
Currently lines like below are converted.
  e.g.
  # IMAGE_INSTALL_append = " A"

But lines without a leading whitespace are not converted.
  e.g.
  #IMAGE_INSTALL_append = " A"

We should be converting both.

(From OE-Core rev: 1994e3844c1aa6b595c0c18040e4f8240fa04438)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-12 06:26:15 +01:00
Martin Jansa
1c240f9209 convert-overrides.py: allow dots before override in vars_re and shortvars_re
e.g. VIRTUAL-RUNTIME_com.webos.service.flowmanager_armv4 weren't replaced
with VIRTUAL-RUNTIME_com.webos.service.flowmanager:armv4 or when package
name contains a dot like in:
RDEPENDS:gstreamer1.0-meta-base:remove

(From OE-Core rev: 41bff44bd26c09573eb3139bb6735e5ecfda18b7)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-05 08:53:40 +01:00
Richard Purdie
34cc76ff05 image/image_types: Convert CONVERSION_CMD/COMPRESS_CMD to new override syntax
For consistency, use override syntax for these variables as well since
it is more consistent with the rest of the image code. We may be able to use
these as proper overrides in due course.

(From OE-Core rev: 52674c4b1fdf79829095031b2e342d44fb0dc181)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-04 20:45:41 +01:00
Richard Purdie
ea984415f6 meta: Convert IMAGE_TYPEDEP to use override syntax
The IMAGE_TYPEDEP variable would make more sense to match the form of the
other image override variables, convert it to use the overrides format.

(From OE-Core rev: 8573f6b2a7af9867da0b21936ffd2cd2a417de1d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-04 20:45:41 +01:00
Denys Dmytriyenko
b26e9eed52 convert-overrides.py: handle few more cases of overrides
Add task-configure and few more supported values of TARGET_OS override.

(From OE-Core rev: 1172f9593902f28ddd8da47de6bd51cda9a0f86a)

Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-04 20:45:41 +01:00
Richard Purdie
54b9a58c20 convert-overrides: Allow script to handle patch/diffs
It is handy to be able to have the script convert a single patch file
and it turns out to be straightforward to make it do this.

(From OE-Core rev: 21df7acc969f47d615d1701ee71f19571de94949)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-02 15:44:11 +01:00
Martin Jansa
926fae24e1 convert-overrides.py: allow specifying multiple target dirs
(From OE-Core rev: e6aa4b1f6f4f174cba027ee096db174541815ff0)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-30 11:31:09 +01:00
Martin Jansa
812ca4cc91 convert-overrides.py: 0.9.1 include '(' as delimiter for shortvars
(From OE-Core rev: ffe91649fafa84f814e32c9979e6a2de40a1bb25)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-30 11:31:09 +01:00
Martin Jansa
b4d63248f0 convert-overrides.py: remove base_dep_prepend and autotools_dep_prepend exception
* the functions were renamed in:
  https://git.openembedded.org/openembedded-core/commit/?id=9d002acae720b0a8e96a6734424a142b86880461

(From OE-Core rev: 43b7cbfb46701a130c248842426370372c88553b)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-30 10:55:13 +01:00
Martin Jansa
1a1bb6ce51 convert-overrides.py: show processed file and version of this script
* on bigger layer this script takes couple minutes without showing any progress
* add a version to reference it in the conversion commit (to easily figure out
  if it's worth re-converting the layer).

(From OE-Core rev: 39edf868deafe79ffd2ea57620af70840ec4c208)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-30 10:55:13 +01:00
Richard Purdie
82c1581e48 scripts/contrib: Add override conversion script
This adds a script I've developed to migrate metadata to use the new override
syntax. It is a bit rough but since its for a single use with validation, it
doesn't need to be perfect. It is run simply as:

scripts/contrib/convert-overrides.py <directory>

It is setup and has been tested to work with OE-Core, Bitbake, yocto-docs,
meta-yocto, meta-gplv2 and meta-mingw. For OE-Core, it converts around 10,100
lines with about 34 manual fixes needed.

For other layers it would need updating for override names and exclusions for
functions/variable names with "append", "prepend" or "remove" in them.

(From OE-Core rev: e8fc67f6f6baf54ccdf548b947c35dea926842c3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-07-30 00:11:51 +01:00