* [morty][PATCH] archiver: Escape recipe name in regex
@ 2017-06-06 2:30 Joshua Watt
2017-06-27 16:08 ` Joshua Watt
0 siblings, 1 reply; 2+ messages in thread
From: Joshua Watt @ 2017-06-06 2:30 UTC (permalink / raw)
To: openembedded-core
From: Joshua Watt <jpewhacker@gmail.com>
The recipe name needs to be escaped when using it in a regular expression so
that and special characters are treated literally
(From OE-Core rev: 53c8cceb744adda1bf899d62071d11b20a5dea98)
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 3543ca9..188f8c0 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -349,8 +349,8 @@ python do_ar_recipe () {
bbappend_files = d.getVar('BBINCLUDED', True).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] 2+ messages in thread
* Re: [morty][PATCH] archiver: Escape recipe name in regex
2017-06-06 2:30 [morty][PATCH] archiver: Escape recipe name in regex Joshua Watt
@ 2017-06-27 16:08 ` Joshua Watt
0 siblings, 0 replies; 2+ messages in thread
From: Joshua Watt @ 2017-06-27 16:08 UTC (permalink / raw)
To: openembedded-core
On Mon, 2017-06-05 at 21:30 -0500, Joshua Watt wrote:
> From: Joshua Watt <jpewhacker@gmail.com>
>
> The recipe name needs to be escaped when using it in a regular
> expression so
> that and special characters are treated literally
>
> (From OE-Core rev: 53c8cceb744adda1bf899d62071d11b20a5dea98)
>
> 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 3543ca9..188f8c0 100644
> --- a/meta/classes/archiver.bbclass
> +++ b/meta/classes/archiver.bbclass
> @@ -349,8 +349,8 @@ python do_ar_recipe () {
> bbappend_files = d.getVar('BBINCLUDED', True).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)
Ping?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-27 16:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-06 2:30 [morty][PATCH] archiver: Escape recipe name in regex Joshua Watt
2017-06-27 16:08 ` Joshua Watt
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.