diff mbox series

classes/sanity: Add comment about github & gitlab archives

Message ID 20220804145831.1545698-1-JPEWhacker@gmail.com
State Accepted, archived
Commit 07c9c6144748d1fbbbdf9c2cb156bea5bed273d4
Headers show
Series classes/sanity: Add comment about github & gitlab archives | expand

Commit Message

Joshua Watt Aug. 4, 2022, 2:58 p.m. UTC
Add a comment so that users grepping for "github" or "gitlab" will find
this code (since the regex wont).

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 meta/classes/insane.bbclass | 1 +
 1 file changed, 1 insertion(+)

Comments

Luca Ceresoli Aug. 4, 2022, 8:58 p.m. UTC | #1
Hi Joshua,

On Thu,  4 Aug 2022 09:58:31 -0500
"Joshua Watt" <JPEWhacker@gmail.com> wrote:

> Add a comment so that users grepping for "github" or "gitlab" will find
> this code (since the regex wont).
> 
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>  meta/classes/insane.bbclass | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
> index 37e10ad850..c8b434bb54 100644
> --- a/meta/classes/insane.bbclass
> +++ b/meta/classes/insane.bbclass
> @@ -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! :-)
Joshua Watt Aug. 4, 2022, 9:04 p.m. UTC | #2
On 8/4/22 15:58, Luca Ceresoli wrote:
> Hi Joshua,
>
> On Thu,  4 Aug 2022 09:58:31 -0500
> "Joshua Watt" <JPEWhacker@gmail.com> wrote:
>
>> Add a comment so that users grepping for "github" or "gitlab" will find
>> this code (since the regex wont).
>>
>> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
>> ---
>>   meta/classes/insane.bbclass | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
>> index 37e10ad850..c8b434bb54 100644
>> --- a/meta/classes/insane.bbclass
>> +++ b/meta/classes/insane.bbclass
>> @@ -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! :-)
Ya that would be better. I assumed someone was trying to win regex golf ;)
>
diff mbox series

Patch

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 37e10ad850..c8b434bb54 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -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)