diff mbox series

classes/sanity: De-golf regex

Message ID 20220808131951.2029559-1-JPEWhacker@gmail.com
State New
Headers show
Series classes/sanity: De-golf regex | expand

Commit Message

Joshua Watt Aug. 8, 2022, 1:19 p.m. UTC
The regex to match github or gitlab was unnecessarily shortened, which
prevented them from showing up when grepping.

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

Comments

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

On Mon,  8 Aug 2022 08:19:51 -0500
Joshua Watt <jpewhacker@gmail.com> wrote:

> The regex to match github or gitlab was unnecessarily shortened, which
> prevented them from showing up when grepping.
> 
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>

Thank you!

Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
Alexandre Belloni Aug. 8, 2022, 7:34 p.m. UTC | #2
Hi,

On 08/08/2022 08:19:51-0500, Joshua Watt wrote:
> The regex to match github or gitlab was unnecessarily shortened, which
> prevented them from showing up when grepping.
> 

This doesn't apply since we have "classes/sanity: Add comment about
github & gitlab archives" in master. I guess this was one or the other.

> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>  meta/classes/insane.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
> index 37e10ad850..b66926f540 100644
> --- a/meta/classes/insane.bbclass
> +++ b/meta/classes/insane.bbclass
> @@ -1335,7 +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():
> -        if re.search(r"git(hu|la)b\.com/.+/.+/archive/.+", url):
> +        if re.search(r"(github|gitlab)\.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)
>  
>  python do_qa_unpack() {
> -- 
> 2.33.0
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#169085): https://lists.openembedded.org/g/openembedded-core/message/169085
> Mute This Topic: https://lists.openembedded.org/mt/92891575/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Joshua Watt Aug. 8, 2022, 7:41 p.m. UTC | #3
On Mon, Aug 8, 2022 at 2:34 PM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
>
> Hi,
>
> On 08/08/2022 08:19:51-0500, Joshua Watt wrote:
> > The regex to match github or gitlab was unnecessarily shortened, which
> > prevented them from showing up when grepping.
> >
>
> This doesn't apply since we have "classes/sanity: Add comment about
> github & gitlab archives" in master. I guess this was one or the other.

Ack, sorry. This was due to feedback on that patch, and I didn't
realize it had merged already. Sorry about that. It doesn't really
matter to me which one was merged, so dropping this is fine

I think I should have done this one as a V2, or at least in-reply-to that one?

>
> > Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> > ---
> >  meta/classes/insane.bbclass | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
> > index 37e10ad850..b66926f540 100644
> > --- a/meta/classes/insane.bbclass
> > +++ b/meta/classes/insane.bbclass
> > @@ -1335,7 +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():
> > -        if re.search(r"git(hu|la)b\.com/.+/.+/archive/.+", url):
> > +        if re.search(r"(github|gitlab)\.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)
> >
> >  python do_qa_unpack() {
> > --
> > 2.33.0
> >
>
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#169085): https://lists.openembedded.org/g/openembedded-core/message/169085
> > Mute This Topic: https://lists.openembedded.org/mt/92891575/3617179
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
>
>
> --
> Alexandre Belloni, co-owner and COO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
Randy MacLeod Aug. 9, 2022, 7:53 p.m. UTC | #4
De-golf?

LoL: https://www.explainxkcd.com/wiki/index.php/1313:_Regex_Golf

on "regex golf <http://regex.alf.nu/>", which is a discipline of "code 
golf <https://en.wikipedia.org/wiki/Code_golf>", a game in which 
programmers attempt to solve a given programming problem using as few 
characters as possible,


I need to get out more!

../Randy


On 2022-08-08 09:19, Joshua Watt wrote:
> The regex to match github or gitlab was unnecessarily shortened, which
> prevented them from showing up when grepping.
>
> Signed-off-by: Joshua Watt<JPEWhacker@gmail.com>
> ---
>   meta/classes/insane.bbclass | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
> index 37e10ad850..b66926f540 100644
> --- a/meta/classes/insane.bbclass
> +++ b/meta/classes/insane.bbclass
> @@ -1335,7 +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():
> -        if re.search(r"git(hu|la)b\.com/.+/.+/archive/.+", url):
> +        if re.search(r"(github|gitlab)\.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)
>   
>   python do_qa_unpack() {
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#169085):https://lists.openembedded.org/g/openembedded-core/message/169085
> Mute This Topic:https://lists.openembedded.org/mt/92891575/3616765
> Group Owner:openembedded-core+owner@lists.openembedded.org
> Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub  [randy.macleod@windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 37e10ad850..b66926f540 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -1335,7 +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():
-        if re.search(r"git(hu|la)b\.com/.+/.+/archive/.+", url):
+        if re.search(r"(github|gitlab)\.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)
 
 python do_qa_unpack() {