subtree updates

meta-arm: 5712422011..1cad3c3813:
  Jon Mason (3):
        arm/pyhsslms: update to 2.0.0
        arm/trusted-firmware-m: update to 2.0.0
        arm/opencsd: update to 1.4.2

  Ross Burton (2):
        arm-bsp/documentation: upgrade Sphinx slightly
        arm/fvp-base-a-aem: upgrade to 11.24.11

  Vikas Katariya (2):
        arm-bsp/n1sdp: Downgrade to 6.1 linux yocto kernel
        arm-bsp/linux-yocto: Remove EOL Linux yocto kernel 6.5

meta-openembedded: 098dc606f9..4dbbef7a39:
  Alex Kiernan (1):
        thin-provisioning-tools: Drop musl fixes (fixed upstream)

  Derek Straka (9):
        python3-web3: update to version 6.14.0
        python3-engineio: update to version 4.8.2
        python3-marshmallow: update to version 3.20.2
        python3-apispec: update to version 6.4.0
        python3-protobuf: update to version 4.25.1
        python3-eth-hash: update to version 0.6.0
        python3-google-auth: update to version 2.26.2
        python3-socketio: update to version 5.11.0
        python3-google-api-python-client: update to version 2.113.0

  Fabio Estevam (1):
        v4l-utils: Update to 1.26.1

  Jörg Sommer (1):
        i2cdev: Fix MUSL build

  Khem Raj (7):
        thunar: inherit gtk-doc
        libxklavier: inherit gtk-doc
        libwnck: inherit gtk-doc
        schroedinger: inherit gtk-doc
        gst-shark: inherit gtk-doc
        evolution-data-server: Use inherit_defer for native class
        opencl-icd: Rename rdepends to virtual-opencl-icd

  Markus Volk (2):
        flatpak: fix gtk-doc build
        gvfs: drop gnome-keyring rdepend

  Peter Marko (1):
        grpc: correct dependencies

  Randy MacLeod (1):
        rng-tools: move from oe-core to meta-oe

  Ross Burton (9):
        libuser: fix gtk-doc configure call
        libuser: remove obsolete GTKDOC_DOCDIR assignment
        gtksourceview4: remove check for target gtk-doc
        gtksourceview4: remove obsolete workaround for build failures
        telepathy-glib: inherit gtk-doc
        glade: inherit gtk-doc, fix FILES
        libgxim: inherit gtk-doc
        gmime: inherit gtk-doc
        raptor2: inherit gtk-doc

  Wang Mingyu (3):
        frr: use update-alternatives for ietf-interfaces.yang
        libsmi: use update-alternatives for ietf-interfaces.yang
        frr: Fix install conflict when enable multilib.

  alperak (1):
        adcli: use https protocol for fetching

poky: 61182659c2..7af374c90c:
  Alexander Kanavin (3):
        glib-2.0: ensure GI_DATA_ENABLED is set
        gobject-introspection-data.bbclass: move do_compile() tweak to g-i class
        python: update 3.11.5 -> 3.12.1

  Alexander Sverdlin (2):
        linux-firmware: upgrade 20231030 -> 20231211
        linux-firmware: package PowerVR firmware

  André Draszik (1):
        linux-firmware: split out rockchip/dptx firmware

  Changhyeok Bae (1):
        iw: upgrade 5.19 -> 6.7

  Etienne Cordonnier (3):
        package.py: fix Darwin support
        chrpath.bbclass: fix Darwin support
        siteinfo.bbclass: add support for darwin19 and darwin21

  Fabio Estevam (2):
        mesa: Upgrade 23.3.2 -> 23.3.3
        libdrm: Upgrade to 2.4.120

  Joe Slater (1):
        init-ifupdown: add predictable interface names

  Kai Kang (1):
        xserver-xorg: 21.1.9 -> 21.1.11

  Khem Raj (3):
        webkitgtk: Workaround for clang compiler segfault
        mdadm: Disable 10ddf-fail-spare and 10ddf-fail-stop-readd testcases
        openssl: Fix build on riscv

  Ola x Nilsson (2):
        insane.bbclass: Check for adjtime in check_32_bit_symbols
        insane.bbclass: Python code cleanup in check_32bit_symbols

  Petr Vorel (1):
        iputils: update to 20240117

  Randy MacLeod (2):
        rng-tools: move to meta-oe
        rng-tools: Revert "rng-tools: move to meta-oe"

  Richard Purdie (13):
        bitbake: ast/BBHandler: Add inherit_defer support
        allarch: Fix allarch corner case
        rootfs: Fix MULTILIB_RE_ALLOW to be inherit order independent
        rootfs-postcommands: Try and improve ordering constraints
        classes/recipes: Switch to use inherit_defer
        libtool: Update patches to mark as backports
        libtool: Update nios2 patch to match upstream merged version
        libtool: Update prefixmap and clang patches to match upstream submission
        libtool: Update cleanup sysroot handling patch
        libtool: Update patch offsets
        libtool: Update further patch status to backport
        reproducible: Fix race with externalsrc/devtool over lockfile
        build-appliance-image: Update to master head revision

  Ross Burton (4):
        musl: doesn't support riscv32
        libunwind: merge .inc and .bb
        libunwind: refresh patches
        libunwind: clean up configuration

  Simone Weiß (1):
        classes-global/insane: Add check for "virtual/" in RPROVIDES and RDEPENDS

  Tim Orling (1):
        python3-alabaster: upgrade 0.7.13 -> 0.7.16

  Trevor Woerner (1):
        bmaptool: add 3 fixes

  Vyacheslav Yurkov (9):
        recipetool: Don't fail on local go modules
        classes: go-vendor: Reference local modules
        classes: go-vendor: Handle modules from the same repo
        classes: go-vendor: Unlink vendor dir later
        recipetool: Proceed even with a missing license file
        recipetool: Disregard version in URL for replaced modules
        oeqa/selftest/recipetool: Move create_go test to a proper class
        oeqa/selftest/recipetool: Move helper function to the class scope
        oeqa/selftest/recipetool: Add test coverage for local go modules

  Wang Mingyu (22):
        mpg123: upgrade 1.32.3 -> 1.32.4
        bind: upgrade 9.18.20 -> 9.18.21
        iproute2: upgrade 6.6.0 -> 6.7.0
        kexec-tools: upgrade 2.0.27 -> 2.0.28
        libbsd: upgrade 0.11.7 -> 0.11.8
        libxmlb: upgrade 0.3.14 -> 0.3.15
        nghttp2: upgrade 1.57.0 -> 1.58.0
        ofono: upgrade 2.2 -> 2.3
        python3-numpy: upgrade 1.26.2 -> 1.26.3
        vte: upgrade 0.74.1 -> 0.74.2
        python3-cython: upgrade 3.0.7 -> 3.0.8
        python3-git: upgrade 3.1.40 -> 3.1.41
        python3-hypothesis: upgrade 6.92.2 -> 6.92.9
        python3-jinja2: upgrade 3.1.2 -> 3.1.3
        python3-markdown: upgrade 3.5 -> 3.5.2
        python3-more-itertools: upgrade 10.1.0 -> 10.2.0
        python3-pycryptodome: upgrade 3.19.1 -> 3.20.0
        python3-pycryptodomex: upgrade 3.19.1 -> 3.20.0
        python3-trove-classifiers: upgrade 2023.11.29 -> 2024.1.8
        stress-ng: upgrade 0.17.03 -> 0.17.04
        virglrenderer: upgrade 1.0.0 -> 1.0.1
        xz: upgrade 5.4.4 -> 5.4.5

Change-Id: I9581526d3addb54889dd73268e672c2d84345f3e
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/poky/scripts/lib/recipetool/create_go.py b/poky/scripts/lib/recipetool/create_go.py
index 21dcb41..c560831 100644
--- a/poky/scripts/lib/recipetool/create_go.py
+++ b/poky/scripts/lib/recipetool/create_go.py
@@ -504,8 +504,9 @@
 
         return inline_fcn, commit
 
-    def __go_handle_dependencies(self, go_mod, localfilesdir, extravalues, d):
+    def __go_handle_dependencies(self, go_mod, srctree, localfilesdir, extravalues, d):
 
+        import re
         src_uris = []
         src_revs = []
 
@@ -525,6 +526,27 @@
 
             return src_rev
 
+        # we first go over replacement list, because we are essentialy
+        # interested only in the replaced path
+        if go_mod['Replace']:
+            for replacement in go_mod['Replace']:
+                oldpath = replacement['Old']['Path']
+                path = replacement['New']['Path']
+                version = ''
+                if 'Version' in replacement['New']:
+                    version = replacement['New']['Version']
+
+                if os.path.exists(os.path.join(srctree, path)):
+                    # the module refers to the local path, remove it from requirement list
+                    # because it's a local module
+                    go_mod['Require'][:] = [v for v in go_mod['Require'] if v.get('Path') != oldpath]
+                else:
+                    # Replace the path and the version, so we don't iterate replacement list anymore
+                    for require in go_mod['Require']:
+                        if require['Path'] == oldpath:
+                            require.update({'Path': path, 'Version': version})
+                            break
+
         for require in go_mod['Require']:
             path = require['Path']
             version = require['Version']
@@ -534,18 +556,9 @@
             src_uris.append(inline_fcn)
             src_revs.append(generate_src_rev(path, version, commithash))
 
-        if go_mod['Replace']:
-            for replacement in go_mod['Replace']:
-                oldpath = replacement['Old']['Path']
-                path = replacement['New']['Path']
-                version = replacement['New']['Version']
-
-                inline_fcn, commithash = self.__generate_srcuri_inline_fcn(
-                    path, version, oldpath)
-                src_uris.append(inline_fcn)
-                src_revs.append(generate_src_rev(path, version, commithash))
-
-        pn, _ = determine_from_url(go_mod['Module']['Path'])
+        # strip version part from module URL /vXX
+        baseurl = re.sub(r'/v(\d+)$', '', go_mod['Module']['Path'])
+        pn, _ = determine_from_url(baseurl)
         go_mods_basename = "%s-modules.inc" % pn
 
         go_mods_filename = os.path.join(localfilesdir, go_mods_basename)
@@ -626,7 +639,9 @@
                 lic_files_chksum.append(
                     'file://src/${GO_IMPORT}/vendor/%s;md5=%s' % (licvalue[1], licvalue[2]))
 
-        pn, _ = determine_from_url(go_mod['Module']['Path'])
+        # strip version part from module URL /vXX
+        baseurl = re.sub(r'/v(\d+)$', '', go_mod['Module']['Path'])
+        pn, _ = determine_from_url(baseurl)
         licenses_basename = "%s-licenses.inc" % pn
 
         licenses_filename = os.path.join(localfilesdir, licenses_basename)
@@ -672,6 +687,13 @@
 
         localfilesdir = tempfile.mkdtemp(prefix='recipetool-go-')
         extravalues.setdefault('extrafiles', {})
+
+        # Use an explicit name determined from the module name because it
+        # might differ from the actual URL for replaced modules
+        # strip version part from module URL /vXX
+        baseurl = re.sub(r'/v(\d+)$', '', go_mod['Module']['Path'])
+        pn, _ = determine_from_url(baseurl)
+
         # go.mod files with version < 1.17 may not include all indirect
         # dependencies. Thus, we have to upgrade the go version.
         if go_version_major == 1 and go_version_minor < 17:
@@ -689,18 +711,18 @@
             # Write additional $BPN-modules.inc file
             self.__go_mod_vendor(go_mod, srctree, localfilesdir, extravalues, d)
             lines_before.append("LICENSE += \" & ${GO_MOD_LICENSES}\"")
-            lines_before.append("require ${BPN}-licenses.inc")
+            lines_before.append("require %s-licenses.inc" % (pn))
 
             self.__rewrite_src_uri(lines_before, ["file://modules.txt"])
 
-            self.__go_handle_dependencies(go_mod, localfilesdir, extravalues, d)
-            lines_before.append("require ${BPN}-modules.inc")
+            self.__go_handle_dependencies(go_mod, srctree, localfilesdir, extravalues, d)
+            lines_before.append("require %s-modules.inc" % (pn))
 
         # Do generic license handling
         handle_license_vars(srctree, lines_before, handled, extravalues, d)
         self.__rewrite_lic_uri(lines_before)
 
-        lines_before.append("GO_IMPORT = \"{}\"".format(go_import))
+        lines_before.append("GO_IMPORT = \"{}\"".format(baseurl))
         lines_before.append("SRCREV_FORMAT = \"${BPN}\"")
 
     def __update_lines_before(self, updated, newlines, lines_before):
@@ -720,6 +742,12 @@
                 new_licenses = []
                 licenses = origvalue.split('\\')
                 for license in licenses:
+                    if not license:
+                        logger.warning("No license file was detected for the main module!")
+                        # the license list of the main recipe must be empty
+                        # this can happen for example in case of CLOSED license
+                        # Fall through to complete recipe generation
+                        continue
                     license = license.strip()
                     uri, chksum = license.split(';', 1)
                     url = urllib.parse.urlparse(uri)