GitHub redirects /archive/ URLs to codeload.github.com, a dedicated
service for caching git archives:

$ wget -v https://github.com/unicode-org/icu/archive/refs/tags/release-72-1.zip
HTTP request sent, awaiting response... 302 Found
Location: 
https://codeload.github.com/unicode-org/icu/zip/refs/tags/release-72-1 
[following]

This is not the case for uploaded artifacts:

$ wget -v 
https://github.com/unicode-org/icu/releases/download/release-72-1/icu4c-72_1-data-bin-l.zip.asc
HTTP request sent, awaiting response... 302 Found
Location: 
https://objects.githubusercontent.com/github-production-release-asset-2e65be/49244766/...
 [following]

Check for codeload.github.com URLs in the src-uri-bad check in case
the SRC_URI contains this final URL, and not the public URI.

Signed-off-by: Ross Burton <[email protected]>
---
 meta/classes-global/insane.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes-global/insane.bbclass 
b/meta/classes-global/insane.bbclass
index dc46857a194..df2c40c3c5d 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -1346,7 +1346,7 @@ def unpack_check_src_uri(pn, d):
 
     for url in d.getVar("SRC_URI").split():
         # Search for github and gitlab URLs that pull unstable archives 
(comment for future greppers)
-        if re.search(r"git(hu|la)b\.com/.+/.+/archive/.+", url):
+        if re.search(r"git(hu|la)b\.com/.+/.+/archive/.+", url) or 
"//codeload.github.com/" in url:
             oe.qa.handle_error("src-uri-bad", "%s: SRC_URI uses unstable 
GitHub/GitLab archives, convert recipe to use git protocol" % pn, d)
 
 python do_qa_unpack() {
-- 
2.34.1

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

Reply via email to