Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 01/21] devtool: correctly handle non-standard source tree locations in upgrades
@ 2021-07-14 12:25 Alexander Kanavin
  2021-07-14 12:25 ` [PATCH 02/21] tcmode-default.inc: do not set PREFERRED_VERSION for toolchain items Alexander Kanavin
                   ` (19 more replies)
  0 siblings, 20 replies; 31+ messages in thread
From: Alexander Kanavin @ 2021-07-14 12:25 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

When S is set to a sub-directory of upstream source, the license
checks and the bbappend writing (specifically, setting EXTERNALSRC)
need to operate on that sub-directory.

'devtool modify' already has similar logic, and it was copied from there
and adjusted.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
 scripts/lib/devtool/upgrade.py | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index c6d98299da..da1456a01a 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -521,6 +521,15 @@ def upgrade(args, config, basepath, workspace):
         else:
             srctree = standard.get_default_srctree(config, pn)
 
+        # Check that recipe isn't using a shared workdir
+        s = os.path.abspath(rd.getVar('S'))
+        workdir = os.path.abspath(rd.getVar('WORKDIR'))
+        srctree_s = srctree
+        if s.startswith(workdir) and s != workdir and os.path.dirname(s) != workdir:
+            # Handle if S is set to a subdirectory of the source
+            srcsubdir = os.path.relpath(s, workdir).split(os.sep, 1)[1]
+            srctree_s = os.path.join(srctree, srcsubdir)
+
         # try to automatically discover latest version and revision if not provided on command line
         if not args.version and not args.srcrev:
             version_info = oe.recipeutils.get_recipe_upstream_version(rd)
@@ -550,12 +559,12 @@ def upgrade(args, config, basepath, workspace):
         try:
             logger.info('Extracting current version source...')
             rev1, srcsubdir1 = standard._extract_source(srctree, False, 'devtool-orig', False, config, basepath, workspace, args.fixed_setup, rd, tinfoil, no_overrides=args.no_overrides)
-            old_licenses = _extract_licenses(srctree, (rd.getVar('LIC_FILES_CHKSUM') or ""))
+            old_licenses = _extract_licenses(srctree_s, (rd.getVar('LIC_FILES_CHKSUM') or ""))
             logger.info('Extracting upgraded version source...')
             rev2, md5, sha256, srcbranch, srcsubdir2 = _extract_new_source(args.version, srctree, args.no_patch,
                                                     args.srcrev, args.srcbranch, args.branch, args.keep_temp,
                                                     tinfoil, rd)
-            new_licenses = _extract_licenses(srctree, (rd.getVar('LIC_FILES_CHKSUM') or ""))
+            new_licenses = _extract_licenses(srctree_s, (rd.getVar('LIC_FILES_CHKSUM') or ""))
             license_diff = _generate_license_diff(old_licenses, new_licenses)
             rf, copied = _create_new_recipe(args.version, md5, sha256, args.srcrev, srcbranch, srcsubdir1, srcsubdir2, config.workspace_path, tinfoil, rd, license_diff, new_licenses, srctree, args.keep_failure)
         except bb.process.CmdError as e:
@@ -564,7 +573,7 @@ def upgrade(args, config, basepath, workspace):
             _upgrade_error(e, rf, srctree, args.keep_failure)
         standard._add_md5(config, pn, os.path.dirname(rf))
 
-        af = _write_append(rf, srctree, args.same_dir, args.no_same_dir, rev2,
+        af = _write_append(rf, srctree_s, args.same_dir, args.no_same_dir, rev2,
                         copied, config.workspace_path, rd)
         standard._add_md5(config, pn, af)
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2021-07-22 19:32 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-14 12:25 [PATCH 01/21] devtool: correctly handle non-standard source tree locations in upgrades Alexander Kanavin
2021-07-14 12:25 ` [PATCH 02/21] tcmode-default.inc: do not set PREFERRED_VERSION for toolchain items Alexander Kanavin
2021-07-14 12:55   ` [OE-core] " Richard Purdie
2021-07-14 13:40     ` Alexander Kanavin
2021-07-20 17:11       ` Denys Dmytriyenko
2021-07-14 14:01   ` Bruce Ashfield
2021-07-14 14:04     ` Alexander Kanavin
2021-07-14 17:07       ` Khem Raj
2021-07-14 12:25 ` [PATCH 03/21] llvm: make upgradable via devtool Alexander Kanavin
2021-07-14 17:18   ` [OE-core] " Khem Raj
2021-07-14 12:25 ` [PATCH 04/21] llvm: update 12.0.0 -> 12.0.1 Alexander Kanavin
2021-07-14 12:25 ` [PATCH 05/21] systemd: update 248.3 -> 249 Alexander Kanavin
2021-07-17 22:58   ` [OE-core] " Alexandre Belloni
2021-07-18  0:44     ` Khem Raj
2021-07-22 19:32       ` Alexander Kanavin
2021-07-14 12:25 ` [PATCH 06/21] xserver-xorg: update 1.20.11 -> 1.20.12 Alexander Kanavin
2021-07-14 12:25 ` [PATCH 07/21] libmodulemd: update 2.12.1 -> 2.13.0 Alexander Kanavin
2021-07-14 12:25 ` [PATCH 08/21] bluez5: upgrade 5.59 -> 5.60 Alexander Kanavin
2021-07-14 12:25 ` [PATCH 09/21] createrepo-c: upgrade 0.17.3 -> 0.17.4 Alexander Kanavin
2021-07-14 12:25 ` [PATCH 10/21] ethtool: upgrade 5.12 -> 5.13 Alexander Kanavin
2021-07-14 12:25 ` [PATCH 11/21] gtk+3: upgrade 3.24.29 -> 3.24.30 Alexander Kanavin
2021-07-14 12:25 ` [PATCH 12/21] harfbuzz: upgrade 2.8.1 -> 2.8.2 Alexander Kanavin
2021-07-14 12:25 ` [PATCH 13/21] iproute2: upgrade 5.12.0 -> 5.13.0 Alexander Kanavin
2021-07-14 12:25 ` [PATCH 14/21] libgit2: upgrade 1.1.0 -> 1.1.1 Alexander Kanavin
2021-07-14 12:26 ` [PATCH 15/21] mpg123: upgrade 1.28.0 -> 1.28.2 Alexander Kanavin
2021-07-14 12:26 ` [PATCH 16/21] mtools: upgrade 4.0.31 -> 4.0.32 Alexander Kanavin
2021-07-14 12:26 ` [PATCH 17/21] ruby: upgrade 3.0.1 -> 3.0.2 Alexander Kanavin
2021-07-14 12:26 ` [PATCH 18/21] stress-ng: upgrade 0.12.11 -> 0.12.12 Alexander Kanavin
2021-07-14 12:26 ` [PATCH 19/21] webkitgtk: upgrade 2.32.1 -> 2.32.2 Alexander Kanavin
2021-07-14 12:26 ` [PATCH 20/21] xwayland: upgrade 21.1.1 -> 21.1.2 Alexander Kanavin
2021-07-14 12:26 ` [PATCH 21/21] tcl: fix upstream version check Alexander Kanavin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox