diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-12-13 12:10:56 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-18 19:48:00 +0000 |
commit | 04d2a394ea1011e88d7920cf78b0ab6ea547fcb5 (patch) | |
tree | a7cb26c186aa6fd79747bef1049836ff982d2b9f /scripts/lib/devtool/standard.py | |
parent | 70c8d7c07bde64ef756a85e0ce415bef6ce111ed (diff) | |
download | poky-04d2a394ea1011e88d7920cf78b0ab6ea547fcb5.tar.gz |
devtool/upgrade: correctly handle recipes where S is a subdir of upstream tree
'devtool modify' writes additional settings to workspace .bbappend so that this
can be handled correctly, but 'devtool upgrade' does not. This adds the missing
settings.
In particular, local files should not anymore mysteriously disappear from
SRC_URIs on upgrades.
(From OE-Core rev: 0817aa5537a8d7cc9591c53dfaa1d225f4c327f7)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/standard.py')
-rw-r--r-- | scripts/lib/devtool/standard.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index e3b74ab8f0..f46ce34ad1 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -765,6 +765,16 @@ def get_staging_kbranch(srcdir): | |||
765 | staging_kbranch = "".join(branch.split('\n')[0]) | 765 | staging_kbranch = "".join(branch.split('\n')[0]) |
766 | return staging_kbranch | 766 | return staging_kbranch |
767 | 767 | ||
768 | def get_real_srctree(srctree, s, workdir): | ||
769 | # Check that recipe isn't using a shared workdir | ||
770 | s = os.path.abspath(s) | ||
771 | workdir = os.path.abspath(workdir) | ||
772 | if s.startswith(workdir) and s != workdir and os.path.dirname(s) != workdir: | ||
773 | # Handle if S is set to a subdirectory of the source | ||
774 | srcsubdir = os.path.relpath(s, workdir).split(os.sep, 1)[1] | ||
775 | srctree = os.path.join(srctree, srcsubdir) | ||
776 | return srctree | ||
777 | |||
768 | def modify(args, config, basepath, workspace): | 778 | def modify(args, config, basepath, workspace): |
769 | """Entry point for the devtool 'modify' subcommand""" | 779 | """Entry point for the devtool 'modify' subcommand""" |
770 | import bb | 780 | import bb |
@@ -923,14 +933,7 @@ def modify(args, config, basepath, workspace): | |||
923 | 933 | ||
924 | # Need to grab this here in case the source is within a subdirectory | 934 | # Need to grab this here in case the source is within a subdirectory |
925 | srctreebase = srctree | 935 | srctreebase = srctree |
926 | 936 | srctree = get_real_srctree(srctree, rd.getVar('S'), rd.getVar('WORKDIR')) | |
927 | # Check that recipe isn't using a shared workdir | ||
928 | s = os.path.abspath(rd.getVar('S')) | ||
929 | workdir = os.path.abspath(rd.getVar('WORKDIR')) | ||
930 | if s.startswith(workdir) and s != workdir and os.path.dirname(s) != workdir: | ||
931 | # Handle if S is set to a subdirectory of the source | ||
932 | srcsubdir = os.path.relpath(s, workdir).split(os.sep, 1)[1] | ||
933 | srctree = os.path.join(srctree, srcsubdir) | ||
934 | 937 | ||
935 | bb.utils.mkdirhier(os.path.dirname(appendfile)) | 938 | bb.utils.mkdirhier(os.path.dirname(appendfile)) |
936 | with open(appendfile, 'w') as f: | 939 | with open(appendfile, 'w') as f: |