From: Andrey Zhizhikin <andrey.z@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Andrey Zhizhikin <andrey.z@gmail.com>
Subject: [PATCH] scripts/oe-setup-layers: add option to skip revs in json
Date: Wed, 6 Dec 2023 10:25:36 +0100 [thread overview]
Message-ID: <20231206092536.2874022-1-andrey.z@gmail.com> (raw)
Current script implementation uses revisions recorded in JSON file to
replicate previously recorded setup. While this is useful for complete
layer setup reproducibility, this does not allow the setup "upgrade" where
this script can be used to use remote branch information and latest HEAD,
have the setup restored, and then saved using updated revisions.
Add new '--skip-revs' parameter which can be used to obtain the updated
layer setup.
Following set of operations could be executed to achieve this:
1. Restore initial layer setup using remote branch HEAD instead of recorded
revisions by specifying --skip-revs.
2. After layer setup is created, JSON file containing updated revisions is
retrieved via `bitbake-layers create-layers-setup`
3. Updated JSON file can be checked in to bootstrap repository and used
later without '--skip-revs' to replicated updated setup.
Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
---
scripts/oe-setup-layers | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/scripts/oe-setup-layers b/scripts/oe-setup-layers
index 6d49688a32..a4941450d3 100755
--- a/scripts/oe-setup-layers
+++ b/scripts/oe-setup-layers
@@ -69,6 +69,13 @@ def _do_checkout(args, json):
remotes = r_remote['remotes']
print('\nSetting up source {}, revision {}, branch {}'.format(r_name, desc, branch))
+ if args['skip_revs']:
+ if branch and (branch != 'HEAD'):
+ print('\nSkip revision option used, remote {} branch {} HEAD will be used instead of {}'.format(r_name, branch, rev))
+ rev = branch
+ else:
+ print('\nBranch info is missing in json, --skip-revs option is not used')
+
if not _is_repo_git_repo(repodir):
cmd = 'git init -q {}'.format(repodir)
print("Running '{}'".format(cmd))
@@ -108,6 +115,7 @@ except subprocess.CalledProcessError as e:
parser.add_argument('--destdir', default=defaultdest, help='Where to check out the layers (default is {defaultdest}).'.format(defaultdest=defaultdest))
parser.add_argument('--jsondata', default=__file__+".json", help='File containing the layer data in json format (default is {defaultjson}).'.format(defaultjson=__file__+".json"))
+parser.add_argument('--skip-revs', action='store_true', help='Skip revisions recorded in json manifest, and use latest revision on branch to restore setup')
args = parser.parse_args()
--
2.34.1
next reply other threads:[~2023-12-06 9:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-06 9:25 Andrey Zhizhikin [this message]
2023-12-06 10:07 ` [OE-core] [PATCH] scripts/oe-setup-layers: add option to skip revs in json Alexander Kanavin
2023-12-06 11:51 ` Andrey Zhizhikin
2023-12-06 12:25 ` Alexander Kanavin
2023-12-06 12:38 ` Jermain Horsman
2024-01-31 14:30 ` Alexander Kanavin
[not found] ` <17AF75010791E9CF.16460@lists.openembedded.org>
2024-02-06 14:54 ` Alexander Kanavin
2024-02-06 19:02 ` Alexandre Belloni
2024-02-06 19:04 ` Alexander Kanavin
2024-02-06 19:23 ` Jermain Horsman
2024-02-06 21:14 ` Alexandre Belloni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231206092536.2874022-1-andrey.z@gmail.com \
--to=andrey.z@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox