[coreboot-gerrit] New patch to review for coreboot: 34dec5f abuild: allow deleting the work directories immediately

Patrick Georgi (patrick@georgi-clan.de) gerrit at coreboot.org
Wed May 21 23:03:08 CEST 2014


Patrick Georgi (patrick at georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5804

-gerrit

commit 34dec5f02e06061212b6aa60d2a13f9a13118d76
Author: Patrick Georgi <patrick at georgi-clan.de>
Date:   Wed May 21 22:47:05 2014 +0200

    abuild: allow deleting the work directories immediately
    
    This is useful on pure build nodes that don't care for
    object files, just for a build log and success flag.
    
    Change-Id: Ida65d4e41652af0f1b7255309aec2eeb6ef5c9ef
    Signed-off-by: Patrick Georgi <patrick at georgi-clan.de>
---
 util/abuild/abuild | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/util/abuild/abuild b/util/abuild/abuild
index 85b6406..6c8c304 100755
--- a/util/abuild/abuild
+++ b/util/abuild/abuild
@@ -254,18 +254,20 @@ function compile_target
 		junit "</system-out>"
 		printf "ok\n" > compile.status
 		printf "ok. (took ${duration}s)\n"
-		cd $CURR
-		return 0
 	else
+		ret=1
 		junit "<failure type='BuildFailed'>"
 		junitfile make.log
 		junit "</failure>"
 		printf "FAILED after ${duration}s!\nLog excerpt:\n"
 		tail -n $CONTEXT make.log 2> /dev/null || tail -$CONTEXT make.log
-		cd $CURR
 		failed=1
-		return 1
 	fi
+	cd $CURR
+	if [ $clean_work = "true" ]; then
+		rm -rf $TARGET/${VENDOR}_${MAINBOARD}
+	fi
+	return $ret
 }
 
 function build_target
@@ -395,6 +397,7 @@ function myhelp
 	printf "    [-u|--update]                 update existing image\n"
 	printf "    [-P|--prefix <name>]          file name prefix in CBFS\n"
 	printf "    [-B|--blobs]                  Allow using binary files\n"
+	printf "    [-z|--clean]                  Remove build results when finished\n"
 	printf "    [-L|--clang]                  Use clang\n"
 	printf "    [--scan-build]                use clang's static analyzer\n"
 	printf "    [cbroot]			  absolute path to coreboot sources\n"
@@ -437,7 +440,7 @@ cmdline="$* -c 1"
 getoptbrand="`getopt -V`"
 if [ "${getoptbrand:0:6}" == "getopt" ]; then
 	# Detected GNU getopt that supports long options.
-	args=`getopt -l version,verbose,help,all,target:,payloads:,test,cpus:,silent,junit,config,loglevel:,remove,prefix:,update,scan-build,ccache,blobs,clang -o Vvhat:p:Tc:sJCl:rP:uyBL -- "$@"` || exit 1
+	args=`getopt -l version,verbose,help,all,target:,payloads:,test,cpus:,silent,junit,config,loglevel:,remove,prefix:,update,scan-build,ccache,blobs,clang,clean -o Vvhat:p:Tc:sJCl:rP:uyBLz -- "$@"` || exit 1
 	eval set -- $args
 else
 	# Detected non-GNU getopt
@@ -450,6 +453,7 @@ if [ $? != 0 ]; then
 	exit 1
 fi
 
+clean_work=false
 customizing=""
 configoptions=""
 while true ; do
@@ -501,6 +505,10 @@ while true ; do
 			customizing="${customizing}, clang"
 			configoptions="${configoptions}CONFIG_COMPILER_LLVM_CLANG=y\n"
 			;;
+		-z|--clean)	shift
+			customizing="${customizing}, clean"
+			clean_work=true
+			;;
 		--)		shift; break;;
 		-*)		printf "Invalid option\n\n"; myhelp; exit 1;;
 		*)		break;;



More information about the coreboot-gerrit mailing list