]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
devtool: add support for git submodules
authorJulien Stephan <jstephan@baylibre.com>
Wed, 22 Nov 2023 11:08:16 +0000 (12:08 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 1 Dec 2023 11:48:13 +0000 (11:48 +0000)
commit900129cbdf25297a42ab5dbd02d1adbea405c935
tree8b6bb79c7510189251fba9ac81a2c9708c4f0b28
parent241da68805d177d4ec4b302c8a997645cc645286
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

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>
meta/lib/oe/patch.py
meta/lib/oe/recipeutils.py
scripts/lib/devtool/__init__.py
scripts/lib/devtool/standard.py
scripts/lib/devtool/upgrade.py
scripts/lib/recipetool/append.py