diff options
author | Julien Stephan <jstephan@baylibre.com> | 2023-11-22 12:08:16 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-01 11:48:25 +0000 |
commit | 89f16624842a91e063dc9e6b98787d44c55e4900 (patch) | |
tree | c22ebb7b7f5ff89d3ed8431e8dcace59678b9ed3 /scripts/lib/recipetool | |
parent | 17427db136491f13b0c9f187906ce9e3f6c85b29 (diff) | |
download | poky-89f16624842a91e063dc9e6b98787d44c55e4900.tar.gz |
devtool: add support for git submodules
Adding the support of submodules required a lot of changes on the
internal data structures:
* initial_rev/startcommit used as a starting point for looking at new
/ updated commits was replaced by a dictionary where the keys are the
submodule name ("." for main repo) and the values are the
initial_rev/startcommit
* the extractPatches function now extracts patch for the main repo and
for all submodules and stores them in a hierarchical way describing the
submodule path
* store initial_rev/commit also for all submodules inside the recipe
bbappend file
* _export_patches now returns dictionaries that contains the 'patchdir'
parameter (if any). This parameter is used to add the correct
'patchdir=' parameter on the recipe
Also, recipe can extract a secondary git tree inside the workdir.
By default, at the end of the do_patch function, there is a hook in
devtool that commits everything that was modified to have a clean
repository. It uses the command: "git add .; git commit ..."
The issue here is that, it adds the secondary git tree as a submodule
but in a wrong way. Doing "git add <git dir>" declares a submodule but do
not adds a url associated to it, and all following "git submodule foreach"
commands will fail.
So detect that a git tree was extracted inside S and correctly add it
using "git submodule add <url> <path>", so that it will be considered as a
regular git submodule
(From OE-Core rev: 900129cbdf25297a42ab5dbd02d1adbea405c935)
Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/recipetool')
-rw-r--r-- | scripts/lib/recipetool/append.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/lib/recipetool/append.py b/scripts/lib/recipetool/append.py index 9dbb1cc4b5..4b6a7112c2 100644 --- a/scripts/lib/recipetool/append.py +++ b/scripts/lib/recipetool/append.py | |||
@@ -299,7 +299,7 @@ def appendfile(args): | |||
299 | if st.st_mode & stat.S_IXUSR: | 299 | if st.st_mode & stat.S_IXUSR: |
300 | perms = '0755' | 300 | perms = '0755' |
301 | install = {args.newfile: (args.targetpath, perms)} | 301 | install = {args.newfile: (args.targetpath, perms)} |
302 | oe.recipeutils.bbappend_recipe(rd, args.destlayer, {args.newfile: sourcepath}, install, wildcardver=args.wildcard_version, machine=args.machine) | 302 | oe.recipeutils.bbappend_recipe(rd, args.destlayer, {args.newfile: {'path' : sourcepath}}, install, wildcardver=args.wildcard_version, machine=args.machine) |
303 | tinfoil.modified_files() | 303 | tinfoil.modified_files() |
304 | return 0 | 304 | return 0 |
305 | else: | 305 | else: |
@@ -353,7 +353,7 @@ def appendsrc(args, files, rd, extralines=None): | |||
353 | logger.warning('{0!r} is already in SRC_URI, not adding'.format(source_uri)) | 353 | logger.warning('{0!r} is already in SRC_URI, not adding'.format(source_uri)) |
354 | else: | 354 | else: |
355 | extralines.append('SRC_URI += {0}'.format(source_uri)) | 355 | extralines.append('SRC_URI += {0}'.format(source_uri)) |
356 | copyfiles[newfile] = srcfile | 356 | copyfiles[newfile] = {'path' : srcfile} |
357 | 357 | ||
358 | oe.recipeutils.bbappend_recipe(rd, args.destlayer, copyfiles, None, wildcardver=args.wildcard_version, machine=args.machine, extralines=extralines) | 358 | oe.recipeutils.bbappend_recipe(rd, args.destlayer, copyfiles, None, wildcardver=args.wildcard_version, machine=args.machine, extralines=extralines) |
359 | tinfoil.modified_files() | 359 | tinfoil.modified_files() |