Skip to contentSkip to conversation

classes/sanity: Add comment about github & gitlab archives

PATCH In review Joshua Watt 2 participants 3 messages Aug 4, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 classes/sanity: Add comment about github & gitlab archives

Add a comment so that users grepping for "github" or "gitlab" will find this code (since the regex wont).

---
 meta/classes/insane.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta/classes/insane.bbclass +1 -0
index 37e10ad850..c8b434bb54 100644
@@ -1335,6 +1335,7 @@ def unpack_check_src_uri(pn, d):
         oe.qa.handle_error("src-uri-bad", "%s: SRC_URI uses PN not BPN" % 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):
             oe.qa.handle_error("src-uri-bad", "%s: SRC_URI uses unstable GitHub/GitLab archives, convert recipe to use git protocol" % pn, d)
 
Signature · 1 line
2.33.0
#1 lore raw

Hi Joshua,

Quoted 13 lines · On Thu, 4 Aug 2022 09:58:31 -0500 "Joshua Watt" <[email protected]> wrote:

Add a comment so that users grepping for "github" or "gitlab" will find this code (since the regex wont).

---
 meta/classes/insane.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta/classes/insane.bbclass +0 -0
index 37e10ad850..c8b434bb54 100644

meta/classes/insane.bbclass def unpack_check_src_uri(pn, d): · line 1339

Quoted 5 lines
meta/classes/insane.bbclass +1 -0
@@ -1335,6 +1335,7 @@ def unpack_check_src_uri(pn, d):
         oe.qa.handle_error("src-uri-bad", "%s: SRC_URI uses PN not BPN" % 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):

I think the regexp is unnecessarily baroque and it could become just a more readable (github|gitlab). And that would add only 4 chars! :-)

Signature · 3 lines
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw
Quoted 20 lines · Luca Ceresoli

Hi Joshua,

Quoted 15 lines · On Thu, 4 Aug 2022 09:58:31 -0500 "Joshua Watt" <[email protected]> wrote:

Add a comment so that users grepping for "github" or "gitlab" will find this code (since the regex wont).

---
  meta/classes/insane.bbclass | 1 +
  1 file changed, 1 insertion(+)
meta/classes/insane.bbclass +0 -0
index 37e10ad850..c8b434bb54 100644
@@ -1335,6 +1335,7 @@ def unpack_check_src_uri(pn, d):
          oe.qa.handle_error("src-uri-bad", "%s: SRC_URI uses PN not BPN" % pn, d)
 
Quoted 5 lines

meta/classes/insane.bbclass def unpack_check_src_uri(pn, d): · line 1339

Quoted 3 lines
meta/classes/insane.bbclass +1 -0
      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):

I think the regexp is unnecessarily baroque and it could become just a more readable (github|gitlab). And that would add only 4 chars! :-)

Ya that would be better. I assumed someone was trying to win regex golf ;)

Quoted 1 line