[OE-core] [RFC][PATCH] buildhistory.bbclass: Break up the find to catch failures

Mark Hatle mark.hatle at windriver.com
Tue Feb 9 15:34:41 UTC 2016


If for some reason the 'find' operation were to fail, the buildhistory would
not fail, but instead store invalid history!

[YOCTO #9031]

Note this fixes the symptom, but not the cause of 9031.  That is a separate
issue, see the defect for more details on the work being done to resolve the
cause of the failure.

Signed-off-by: Mark Hatle <mark.hatle at windriver.com>
---
 meta/classes/buildhistory.bbclass | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 5e2581f..189881e 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -439,10 +439,12 @@ 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
 	if [ "$3" = "fakeroot" ] ; then
-		( cd $1 && ${FAKEROOTENV} ${FAKEROOTCMD} find . ! -path . -printf "%M %-10u %-10g %10s %p -> %l\n" | sort -k5 | sed 's/ * -> $//' > $2 )
+		( cd $1 && ${FAKEROOTENV} ${FAKEROOTCMD} find . ! -path . -printf "%M %-10u %-10g %10s %p -> %l\n" > $2.tmp )
 	else
-		( cd $1 && find . ! -path . -printf "%M %-10u %-10g %10s %p -> %l\n" | sort -k5 | sed 's/ * -> $//' > $2 )
+		( cd $1 && find . ! -path . -printf "%M %-10u %-10g %10s %p -> %l\n" > $2.tmp )
 	fi
+	cat $2.tmp | sort -k5 | sed 's/ * -> $//' > $2
+	rm $2.tmp
 }
 
 buildhistory_list_pkg_files() {
-- 
2.5.0




More information about the Openembedded-core mailing list