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

Paul Eggleton paul.eggleton at linux.intel.com
Wed Feb 10 12:39:02 UTC 2016


On Tue, 09 Feb 2016 09:34:41 Mark Hatle wrote:
> 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() {

Would that such contortions weren't necessary, but silently getting bad data 
is worse.

Acked-by: Paul Eggleton <paul.eggleton at linux.intel.com>

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the Openembedded-core mailing list