All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] package.bbclass: Fix split_and_strip_files when file has single quote (')
@ 2013-11-01  2:25 eu
  2013-11-01  3:11 ` Felipe Ferreri Tonello
  0 siblings, 1 reply; 3+ messages in thread
From: eu @ 2013-11-01  2:25 UTC (permalink / raw)
  To: openembedded-core

From: "Felipe F. Tonello" <eu@felipetonello.com>

Fix false error report when a file that has a single quote by escaping
the single quote. Some packages might install files with quotes, such
as music files and other types, that will cause the problem.

Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
---
 meta/classes/package.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index b0f44c7..a12b7b7 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -747,7 +747,7 @@ python split_and_strip_files () {
     # 16 - kernel module
     def isELF(path):
         type = 0
-        ret, result = oe.utils.getstatusoutput("file '%s'" % path)
+        ret, result = oe.utils.getstatusoutput("file '%s'" % path.replace("'", "\\'"))
 
         if ret:
             msg = "split_and_strip_files: 'file %s' failed" % path
-- 
1.8.3.1



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

* Re: [PATCH] package.bbclass: Fix split_and_strip_files when file has single quote (')
  2013-11-01  2:25 [PATCH] package.bbclass: Fix split_and_strip_files when file has single quote (') eu
@ 2013-11-01  3:11 ` Felipe Ferreri Tonello
  2013-11-01  3:47   ` Chris Larson
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Ferreri Tonello @ 2013-11-01  3:11 UTC (permalink / raw)
  To: openembedded-core

On 10/31/2013 07:25 PM, eu@felipetonello.com wrote:
> From: "Felipe F. Tonello" <eu@felipetonello.com>
>
> Fix false error report when a file that has a single quote by escaping
> the single quote. Some packages might install files with quotes, such
> as music files and other types, that will cause the problem.
>
> Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
> ---
>   meta/classes/package.bbclass | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> index b0f44c7..a12b7b7 100644
> --- a/meta/classes/package.bbclass
> +++ b/meta/classes/package.bbclass
> @@ -747,7 +747,7 @@ python split_and_strip_files () {
>       # 16 - kernel module
>       def isELF(path):
>           type = 0
> -        ret, result = oe.utils.getstatusoutput("file '%s'" % path)
> +        ret, result = oe.utils.getstatusoutput("file '%s'" % path.replace("'", "\\'"))
>
>           if ret:
>               msg = "split_and_strip_files: 'file %s' failed" % path
>


I just found a bug in this implementation. I will send a v2 shortly.

Felipe


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

* Re: [PATCH] package.bbclass: Fix split_and_strip_files when file has single quote (')
  2013-11-01  3:11 ` Felipe Ferreri Tonello
@ 2013-11-01  3:47   ` Chris Larson
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Larson @ 2013-11-01  3:47 UTC (permalink / raw)
  To: Felipe Ferreri Tonello; +Cc: Patches and discussions about the oe-core layer

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

On Thu, Oct 31, 2013 at 8:11 PM, Felipe Ferreri Tonello <
eu@felipetonello.com> wrote:

> On 10/31/2013 07:25 PM, eu@felipetonello.com wrote:
>
>> From: "Felipe F. Tonello" <eu@felipetonello.com>
>>
>> Fix false error report when a file that has a single quote by escaping
>> the single quote. Some packages might install files with quotes, such
>> as music files and other types, that will cause the problem.
>>
>> Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
>> ---
>>   meta/classes/package.bbclass | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
>> index b0f44c7..a12b7b7 100644
>> --- a/meta/classes/package.bbclass
>> +++ b/meta/classes/package.bbclass
>> @@ -747,7 +747,7 @@ python split_and_strip_files () {
>>       # 16 - kernel module
>>       def isELF(path):
>>           type = 0
>> -        ret, result = oe.utils.getstatusoutput("file '%s'" % path)
>> +        ret, result = oe.utils.getstatusoutput("file '%s'" %
>> path.replace("'", "\\'"))
>>
>>           if ret:
>>               msg = "split_and_strip_files: 'file %s' failed" % path
>>
>>
>
> I just found a bug in this implementation. I will send a v2 shortly.


This should really be fixed to use a better method. In this case we’re just
running a single binary with one argument, there’s no need to call out to a
shell at all, much less have to mess around with escaping arguments :)
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

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

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

end of thread, other threads:[~2013-11-01  3:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-01  2:25 [PATCH] package.bbclass: Fix split_and_strip_files when file has single quote (') eu
2013-11-01  3:11 ` Felipe Ferreri Tonello
2013-11-01  3:47   ` Chris Larson

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.