diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-12-13 12:10:56 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-01-06 17:33:23 +0000 |
commit | 45f3a4fd63503262499f98dd501bdb8da07a174f (patch) | |
tree | 14aabd4f6802a8da014a1a34cf631fddf0d3b502 /scripts/lib/devtool/standard.py | |
parent | 24cdd5bb636b9557cf4ae5be712096ca998ceda6 (diff) | |
download | poky-45f3a4fd63503262499f98dd501bdb8da07a174f.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: 22f210f9f4dfc9e13fdc229147fd1677db5a35ec)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 0817aa5537a8d7cc9591c53dfaa1d225f4c327f7)
Signed-off-by: Steve Sakoman <steve@sakoman.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 c98bfe8195..4bbf9dd5a5 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: |