]> code.ossystems Code Review - openembedded-core.git/commitdiff
buildhistory: simplify buildhistory_list_files()
authorJacob Kroon <jacob.kroon@gmail.com>
Sun, 6 Jan 2019 18:13:49 +0000 (19:13 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 11 Jan 2019 10:38:21 +0000 (10:38 +0000)
Avoid duplicating shell code for the two cases, fakeroot/non-fakeroot.

Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/buildhistory.bbclass

index d1f3e6aa8257173118edfbde643ae0570ffac803..33eb1b00f61c6ef61c4a5a64d3be3ca764cb468d 100644 (file)
@@ -519,12 +519,14 @@ buildhistory_get_sdk_installed_target() {
 
 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
+       # This is somewhat messy, but handles where the size is not printed for device files under pseudo
+       ( cd $1
+       find_cmd='find . ! -path . -printf "%M %-10u %-10g %10s %p -> %l\n"'
        if [ "$3" = "fakeroot" ] ; then
-               ( cd $1 && ${FAKEROOTENV} ${FAKEROOTCMD} find . ! -path . -printf "%M %-10u %-10g %10s %p -> %l\n" | sort -k5 | sed 's/ * -> $//' > $2 )
+               eval ${FAKEROOTENV} ${FAKEROOTCMD} $find_cmd
        else
-               ( cd $1 && find . ! -path . -printf "%M %-10u %-10g %10s %p -> %l\n" | sort -k5 | sed 's/ * -> $//' > $2 )
-       fi
+               eval $find_cmd
+       fi | sort -k5 | sed 's/ * -> $//' > $2 )
 }
 
 buildhistory_list_pkg_files() {