All URLs from SRC checked to be a patch.
In some rare cases, when we have "diff" or
"patch" into URL it is treated as a patch not
like proper resource (e.g. repository).

In this specific case, the problem fixed with
git fetcher which behaves differently in case of
using mirrors. Without pre-downloaded repository
archive we have directory into downloads and exit
from patch_path. As a workaround, we check if the
patch file exists.

Error example for this URL:
git://github.com/pkg/diff;name=diff;\
destsuffix=build/vendor/src/github.com/pkg/diff;branch=main;protocol=https

ERROR: nativesdk-yq-4.30.8+gitdd6cf3df146f3e2c0f8c765a6ef9e35780ad8cc1-r0 
do_patch: \
Importing patch 'github.com.pkg.diff' with striplevel '1'
FileNotFoundError(2, 'No such file or directory')

Signed-off-by: Oleksiy Obitotskyy <[email protected]>
---
 meta/lib/oe/patch.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 246fc6221f..30462ef1ad 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -889,6 +889,8 @@ def patch_path(url, fetch, unpackdir, expand=True):
     """Return the local path of a patch, or return nothing if this isn't a 
patch"""
 
     local = fetch.localpath(url)
+    if not os.path.exists(local):
+        return
     if os.path.isdir(local):
         return
     base, ext = os.path.splitext(os.path.basename(local))
-- 
2.35.6

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#229239): 
https://lists.openembedded.org/g/openembedded-core/message/229239
Mute This Topic: https://lists.openembedded.org/mt/117240919/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

  • [OE-core] [PATCH] patch.py: ... Oleksiy Obitotskyy via lists.openembedded.org

Reply via email to