* [RFC][PATCH] buildhistory.bbclass: Break up the find to catch failures
[not found] <1455032081-212934-1-git-send-email-mark.hatle@windriver.com>
@ 2016-02-09 15:34 ` Mark Hatle
2016-02-10 12:39 ` Paul Eggleton
0 siblings, 1 reply; 2+ messages in thread
From: Mark Hatle @ 2016-02-09 15:34 UTC (permalink / raw)
To: openembedded-core
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@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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RFC][PATCH] buildhistory.bbclass: Break up the find to catch failures
2016-02-09 15:34 ` [RFC][PATCH] buildhistory.bbclass: Break up the find to catch failures Mark Hatle
@ 2016-02-10 12:39 ` Paul Eggleton
0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2016-02-10 12:39 UTC (permalink / raw)
To: openembedded-core
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@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@linux.intel.com>
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-02-10 12:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1455032081-212934-1-git-send-email-mark.hatle@windriver.com>
2016-02-09 15:34 ` [RFC][PATCH] buildhistory.bbclass: Break up the find to catch failures Mark Hatle
2016-02-10 12:39 ` 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.