summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOtavio Salvador <otavio@ossystems.com.br>2014-01-23 10:11:05 -0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-28 11:32:50 +0000
commitf328a9d53b51e31bb0c30eda221cf6857b7bd4f9 (patch)
treec6b8c1bb4e7ea04feab19b1b88959f250d7685a2
parentd955d6a8f52edcffe3c81af7b01f2e3843dbe432 (diff)
downloadpoky-f328a9d53b51e31bb0c30eda221cf6857b7bd4f9.tar.gz
buildhistory.bbclass: Improve robustness in image file listing
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 properly 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. (From OE-Core rev: b09e24449c1c9ae335732dd070eacf66777556a1) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/buildhistory.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index e9a9c3b4e5..545a42fe91 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -385,7 +385,7 @@ buildhistory_get_sdk_installed() {
385buildhistory_list_files() { 385buildhistory_list_files() {
386 # List the files in the specified directory, but exclude date/time etc. 386 # List the files in the specified directory, but exclude date/time etc.
387 # This awk script is somewhat messy, but handles where the size is not printed for device files under pseudo 387 # This awk script is somewhat messy, but handles where the size is not printed for device files under pseudo
388 ( 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 ) 388 ( cd $1 && find . -printf "%M %-10u %-10g %10s %p -> %l\n" | sort -k5 | sed 's/ * -> $//' > $2 )
389} 389}
390 390
391 391