All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] archiver: Escape recipe name in regex
@ 2017-06-01  1:33 Joshua Watt
  2017-06-04 21:37 ` Joshua Watt
  0 siblings, 1 reply; 3+ messages in thread
From: Joshua Watt @ 2017-06-01  1:33 UTC (permalink / raw)
  To: openembedded-core

The recipe name needs to be escaped when it is used in a regular expression so
that any special characters are treated literally

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 meta/classes/archiver.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 2c04557..9cc9fb5 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -349,8 +349,8 @@ python do_ar_recipe () {
     bbappend_files = d.getVar('BBINCLUDED').split()
     # If recipe name is aa, we need to match files like aa.bbappend and aa_1.1.bbappend
     # Files like aa1.bbappend or aa1_1.1.bbappend must be excluded.
-    bbappend_re = re.compile( r".*/%s_[^/]*\.bbappend$" %pn)
-    bbappend_re1 = re.compile( r".*/%s\.bbappend$" %pn)
+    bbappend_re = re.compile( r".*/%s_[^/]*\.bbappend$" % re.escape(pn))
+    bbappend_re1 = re.compile( r".*/%s\.bbappend$" % re.escape(pn))
     for file in bbappend_files:
         if bbappend_re.match(file) or bbappend_re1.match(file):
             shutil.copy(file, outdir)
-- 
2.9.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] archiver: Escape recipe name in regex
  2017-06-01  1:33 [PATCH v2] archiver: Escape recipe name in regex Joshua Watt
@ 2017-06-04 21:37 ` Joshua Watt
  2017-06-05 10:23   ` Burton, Ross
  0 siblings, 1 reply; 3+ messages in thread
From: Joshua Watt @ 2017-06-04 21:37 UTC (permalink / raw)
  To: OE-core

On Wed, May 31, 2017 at 8:33 PM, Joshua Watt <jpewhacker@gmail.com> wrote:
> The recipe name needs to be escaped when it is used in a regular expression so
> that any special characters are treated literally
>
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>  meta/classes/archiver.bbclass | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
> index 2c04557..9cc9fb5 100644
> --- a/meta/classes/archiver.bbclass
> +++ b/meta/classes/archiver.bbclass
> @@ -349,8 +349,8 @@ python do_ar_recipe () {
>      bbappend_files = d.getVar('BBINCLUDED').split()
>      # If recipe name is aa, we need to match files like aa.bbappend and aa_1.1.bbappend
>      # Files like aa1.bbappend or aa1_1.1.bbappend must be excluded.
> -    bbappend_re = re.compile( r".*/%s_[^/]*\.bbappend$" %pn)
> -    bbappend_re1 = re.compile( r".*/%s\.bbappend$" %pn)
> +    bbappend_re = re.compile( r".*/%s_[^/]*\.bbappend$" % re.escape(pn))
> +    bbappend_re1 = re.compile( r".*/%s\.bbappend$" % re.escape(pn))
>      for file in bbappend_files:
>          if bbappend_re.match(file) or bbappend_re1.match(file):
>              shutil.copy(file, outdir)
> --
> 2.9.4
>
Would it be possible to get this backported to pyro and morty? If
there is something else I need to move that along, please let me know.

Thanks,
Joshua Watt


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] archiver: Escape recipe name in regex
  2017-06-04 21:37 ` Joshua Watt
@ 2017-06-05 10:23   ` Burton, Ross
  0 siblings, 0 replies; 3+ messages in thread
From: Burton, Ross @ 2017-06-05 10:23 UTC (permalink / raw)
  To: Joshua Watt; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 428 bytes --]

On 4 June 2017 at 22:37, Joshua Watt <jpewhacker@gmail.com> wrote:

> Would it be possible to get this backported to pyro and morty? If
> there is something else I need to move that along, please let me know.
>

The patch is now in master, so if you backport it to those branches and
then post the patches to the list with [pyro] and [morty] in the subject
then the release maintainers can pick the patches up.

Ross

[-- Attachment #2: Type: text/html, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-05 10:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-01  1:33 [PATCH v2] archiver: Escape recipe name in regex Joshua Watt
2017-06-04 21:37 ` Joshua Watt
2017-06-05 10:23   ` Burton, Ross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.