* [PATCH] buildhistory.bbclass: Improve robustness in image file listing
@ 2014-01-23 12:11 Otavio Salvador
2014-01-27 18:15 ` Otavio Salvador
2014-01-27 21:52 ` Randy MacLeod
0 siblings, 2 replies; 8+ messages in thread
From: Otavio Salvador @ 2014-01-23 12:11 UTC (permalink / raw)
To: OpenEmbedded Core Mailing List; +Cc: Otavio Salvador
The filenames sometimes may have strange names. With the 'awk' script
it handled a limited number of spaces in the filename and a package
installing a file named "test file with spaces" would have its name
truncated.
This patch uses the find's printf formating to simplify the code and
proper handle this case. From a testing image, the only diff produced
is:
,----[ files-in-image.txt diff ]
| --rwxr-xr-x root root 0 ./usr/bin/test\ file\ with\
| +-rwxr-xr-x root root 0 ./usr/bin/test file with spaces
`----
The options used are available since findutils 4.2.5, released in 19
Nov 2004, making it available in all supported host distributions.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
meta/classes/buildhistory.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index e9a9c3b..545a42f 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -385,7 +385,7 @@ buildhistory_get_sdk_installed() {
buildhistory_list_files() {
# List the files in the specified directory, but exclude date/time etc.
# This awk script is somewhat messy, but handles where the size is not printed for device files under pseudo
- ( cd $1 && find . -ls | awk '{ if ( $7 ~ /[0-9]/ ) printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, $7, $11, $12, $13 ; else printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, 0, $10, $11, $12 }' | sort -k5 | sed 's/ *$//' > $2 )
+ ( cd $1 && find . -printf "%M %-10u %-10g %10s %p -> %l\n" | sort -k5 | sed 's/ * -> $//' > $2 )
}
--
1.8.5.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] buildhistory.bbclass: Improve robustness in image file listing
2014-01-23 12:11 [PATCH] buildhistory.bbclass: Improve robustness in image file listing Otavio Salvador
@ 2014-01-27 18:15 ` Otavio Salvador
2014-01-27 21:52 ` Randy MacLeod
1 sibling, 0 replies; 8+ messages in thread
From: Otavio Salvador @ 2014-01-27 18:15 UTC (permalink / raw)
To: OpenEmbedded Core Mailing List; +Cc: Otavio Salvador
On Thu, Jan 23, 2014 at 10:11 AM, Otavio Salvador
<otavio@ossystems.com.br> wrote:
> The filenames sometimes may have strange names. With the 'awk' script
> it handled a limited number of spaces in the filename and a package
> installing a file named "test file with spaces" would have its name
> truncated.
>
> This patch uses the find's printf formating to simplify the code and
> proper handle this case. From a testing image, the only diff produced
> is:
>
> ,----[ files-in-image.txt diff ]
> | --rwxr-xr-x root root 0 ./usr/bin/test\ file\ with\
> | +-rwxr-xr-x root root 0 ./usr/bin/test file with spaces
> `----
>
> The options used are available since findutils 4.2.5, released in 19
> Nov 2004, making it available in all supported host distributions.
>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
ping?
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] buildhistory.bbclass: Improve robustness in image file listing
2014-01-23 12:11 [PATCH] buildhistory.bbclass: Improve robustness in image file listing Otavio Salvador
2014-01-27 18:15 ` Otavio Salvador
@ 2014-01-27 21:52 ` Randy MacLeod
2014-01-28 1:52 ` Otavio Salvador
2014-01-28 8:59 ` Paul Eggleton
1 sibling, 2 replies; 8+ messages in thread
From: Randy MacLeod @ 2014-01-27 21:52 UTC (permalink / raw)
To: Otavio Salvador, OpenEmbedded Core Mailing List
On 14-01-23 07:11 AM, Otavio Salvador wrote:
> The filenames sometimes may have strange names. With the 'awk' script
> it handled a limited number of spaces in the filename and a package
> installing a file named "test file with spaces" would have its name
> truncated.
>
> This patch uses the find's printf formating to simplify the code and
> proper handle this case. From a testing image, the only diff produced
s/proper/properly/
Yes, I'm with the grammar police; we're here to be helpful.
> is:
>
> ,----[ files-in-image.txt diff ]
> | --rwxr-xr-x root root 0 ./usr/bin/test\ file\ with\
> | +-rwxr-xr-x root root 0 ./usr/bin/test file with spaces
> `----
>
> The options used are available since findutils 4.2.5, released in 19
> Nov 2004, making it available in all supported host distributions.
Acked-by: Randy MacLeod <Randy.MacLeod@windriver.com>
Works for me, even on CentOS/RHEL-5.9/10 which does indeed have
findutils > 4.2.5:
$ rpm -qf `which find`
findutils-4.2.27-6.el5
and the find command seems to work as intended:
$ find jj -printf "%M %-10u %-10g %10s %p -> %l\n" | cut -c 44-
jj ->
jj/usr ->
jj/usr/bin ->
jj/usr/bin/test file with spaces ->
../Randy
>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
> meta/classes/buildhistory.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
> index e9a9c3b..545a42f 100644
> --- a/meta/classes/buildhistory.bbclass
> +++ b/meta/classes/buildhistory.bbclass
> @@ -385,7 +385,7 @@ buildhistory_get_sdk_installed() {
> buildhistory_list_files() {
> # List the files in the specified directory, but exclude date/time etc.
> # This awk script is somewhat messy, but handles where the size is not printed for device files under pseudo
> - ( cd $1 && find . -ls | awk '{ if ( $7 ~ /[0-9]/ ) printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, $7, $11, $12, $13 ; else printf "%s %10-s %10-s %10s %s %s %s\n", $3, $5, $6, 0, $10, $11, $12 }' | sort -k5 | sed 's/ *$//' > $2 )
> + ( cd $1 && find . -printf "%M %-10u %-10g %10s %p -> %l\n" | sort -k5 | sed 's/ * -> $//' > $2 )
> }
>
>
>
--
# Randy MacLeod. SMTS, Linux, Wind River
Direct: 613.963.1350
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] buildhistory.bbclass: Improve robustness in image file listing
2014-01-27 21:52 ` Randy MacLeod
@ 2014-01-28 1:52 ` Otavio Salvador
2014-01-28 11:33 ` Richard Purdie
2014-01-28 8:59 ` Paul Eggleton
1 sibling, 1 reply; 8+ messages in thread
From: Otavio Salvador @ 2014-01-28 1:52 UTC (permalink / raw)
To: Randy MacLeod, Richard Purdie; +Cc: OpenEmbedded Core Mailing List
On Mon, Jan 27, 2014 at 7:52 PM, Randy MacLeod
<randy.macleod@windriver.com> wrote:
> On 14-01-23 07:11 AM, Otavio Salvador wrote:
>>
>> The filenames sometimes may have strange names. With the 'awk' script
>> it handled a limited number of spaces in the filename and a package
>> installing a file named "test file with spaces" would have its name
>> truncated.
>>
>> This patch uses the find's printf formating to simplify the code and
>> proper handle this case. From a testing image, the only diff produced
>
> s/proper/properly/
> Yes, I'm with the grammar police; we're here to be helpful.
>
>> is:
>>
>> ,----[ files-in-image.txt diff ]
>> | --rwxr-xr-x root root 0 ./usr/bin/test\ file\ with\
>> | +-rwxr-xr-x root root 0 ./usr/bin/test file with
>> spaces
>> `----
>>
>> The options used are available since findutils 4.2.5, released in 19
>> Nov 2004, making it available in all supported host distributions.
>
>
> Acked-by: Randy MacLeod <Randy.MacLeod@windriver.com>
>
> Works for me, even on CentOS/RHEL-5.9/10 which does indeed have
> findutils > 4.2.5:
>
> $ rpm -qf `which find`
> findutils-4.2.27-6.el5
>
> and the find command seems to work as intended:
>
> $ find jj -printf "%M %-10u %-10g %10s %p -> %l\n" | cut -c 44-
> jj ->
> jj/usr ->
> jj/usr/bin ->
> jj/usr/bin/test file with spaces ->
Richard, do you want me to send a v2 or can you fix the typo when applying it?
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] buildhistory.bbclass: Improve robustness in image file listing
2014-01-27 21:52 ` Randy MacLeod
2014-01-28 1:52 ` Otavio Salvador
@ 2014-01-28 8:59 ` Paul Eggleton
2014-01-28 9:19 ` Phil Blundell
1 sibling, 1 reply; 8+ messages in thread
From: Paul Eggleton @ 2014-01-28 8:59 UTC (permalink / raw)
To: Otavio Salvador; +Cc: openembedded-core
On Monday 27 January 2014 16:52:45 Randy MacLeod wrote:
> On 14-01-23 07:11 AM, Otavio Salvador wrote:
> > The filenames sometimes may have strange names. With the 'awk' script
> > it handled a limited number of spaces in the filename and a package
> > installing a file named "test file with spaces" would have its name
> > truncated.
> >
> > This patch uses the find's printf formating to simplify the code and
> > proper handle this case. From a testing image, the only diff produced
>
> s/proper/properly/
> Yes, I'm with the grammar police; we're here to be helpful.
>
> > is:
> >
> > ,----[ files-in-image.txt diff ]
> >
> > | --rwxr-xr-x root root 0 ./usr/bin/test\ file\ with\
> > | +-rwxr-xr-x root root 0 ./usr/bin/test file with
> > | spaces>
> > `----
> >
> > The options used are available since findutils 4.2.5, released in 19
> > Nov 2004, making it available in all supported host distributions.
>
> Acked-by: Randy MacLeod <Randy.MacLeod@windriver.com>
>
> Works for me, even on CentOS/RHEL-5.9/10 which does indeed have
> findutils > 4.2.5:
>
> $ rpm -qf `which find`
> findutils-4.2.27-6.el5
>
> and the find command seems to work as intended:
>
> $ find jj -printf "%M %-10u %-10g %10s %p -> %l\n" | cut -c 44-
> jj ->
> jj/usr ->
> jj/usr/bin ->
> jj/usr/bin/test file with spaces ->
So I think this is mostly a good change, however, we don't want those -> if
the file isn't a symlink. Otavio, can you fix that?
Thanks,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] buildhistory.bbclass: Improve robustness in image file listing
2014-01-28 8:59 ` Paul Eggleton
@ 2014-01-28 9:19 ` Phil Blundell
2014-01-28 9:34 ` Paul Eggleton
0 siblings, 1 reply; 8+ messages in thread
From: Phil Blundell @ 2014-01-28 9:19 UTC (permalink / raw)
To: Paul Eggleton; +Cc: Otavio Salvador, openembedded-core
On Tue, 2014-01-28 at 08:59 +0000, Paul Eggleton wrote:
> So I think this is mostly a good change, however, we don't want those -> if
> the file isn't a symlink. Otavio, can you fix that?
Isn't that what the sed 's/ -> $//' in the original patch is dealing
with?
p.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] buildhistory.bbclass: Improve robustness in image file listing
2014-01-28 9:19 ` Phil Blundell
@ 2014-01-28 9:34 ` Paul Eggleton
0 siblings, 0 replies; 8+ messages in thread
From: Paul Eggleton @ 2014-01-28 9:34 UTC (permalink / raw)
To: Phil Blundell, Otavio Salvador; +Cc: openembedded-core
On Tuesday 28 January 2014 09:19:59 Phil Blundell wrote:
> On Tue, 2014-01-28 at 08:59 +0000, Paul Eggleton wrote:
> > So I think this is mostly a good change, however, we don't want those ->
> > if the file isn't a symlink. Otavio, can you fix that?
>
> Isn't that what the sed 's/ -> $//' in the original patch is dealing
> with?
Oops, you're right. Ignore this :)
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] buildhistory.bbclass: Improve robustness in image file listing
2014-01-28 1:52 ` Otavio Salvador
@ 2014-01-28 11:33 ` Richard Purdie
0 siblings, 0 replies; 8+ messages in thread
From: Richard Purdie @ 2014-01-28 11:33 UTC (permalink / raw)
To: Otavio Salvador; +Cc: OpenEmbedded Core Mailing List
On Mon, 2014-01-27 at 23:52 -0200, Otavio Salvador wrote:
> On Mon, Jan 27, 2014 at 7:52 PM, Randy MacLeod
> <randy.macleod@windriver.com> wrote:
> > On 14-01-23 07:11 AM, Otavio Salvador wrote:
> >>
> >> The filenames sometimes may have strange names. With the 'awk' script
> >> it handled a limited number of spaces in the filename and a package
> >> installing a file named "test file with spaces" would have its name
> >> truncated.
> >>
> >> This patch uses the find's printf formating to simplify the code and
> >> proper handle this case. From a testing image, the only diff produced
> >
> > s/proper/properly/
> > Yes, I'm with the grammar police; we're here to be helpful.
> >
> >> is:
> >>
> >> ,----[ files-in-image.txt diff ]
> >> | --rwxr-xr-x root root 0 ./usr/bin/test\ file\ with\
> >> | +-rwxr-xr-x root root 0 ./usr/bin/test file with
> >> spaces
> >> `----
> >>
> >> The options used are available since findutils 4.2.5, released in 19
> >> Nov 2004, making it available in all supported host distributions.
> >
> >
> > Acked-by: Randy MacLeod <Randy.MacLeod@windriver.com>
> >
> > Works for me, even on CentOS/RHEL-5.9/10 which does indeed have
> > findutils > 4.2.5:
> >
> > $ rpm -qf `which find`
> > findutils-4.2.27-6.el5
> >
> > and the find command seems to work as intended:
> >
> > $ find jj -printf "%M %-10u %-10g %10s %p -> %l\n" | cut -c 44-
> > jj ->
> > jj/usr ->
> > jj/usr/bin ->
> > jj/usr/bin/test file with spaces ->
>
> Richard, do you want me to send a v2 or can you fix the typo when applying it?
I fixed this one up and merged it.
Cheers,
Richard
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-01-28 11:33 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-23 12:11 [PATCH] buildhistory.bbclass: Improve robustness in image file listing Otavio Salvador
2014-01-27 18:15 ` Otavio Salvador
2014-01-27 21:52 ` Randy MacLeod
2014-01-28 1:52 ` Otavio Salvador
2014-01-28 11:33 ` Richard Purdie
2014-01-28 8:59 ` Paul Eggleton
2014-01-28 9:19 ` Phil Blundell
2014-01-28 9:34 ` Paul Eggleton
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.