[projects/cleanbuild] handle gracely when build dir is not found

glen glen at pld-linux.org
Wed Jun 14 22:50:46 CEST 2017


commit ded7b68b7946bcbd590f35912dae4fff6d8dc099
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Wed Jun 14 23:24:22 2017 +0300

    handle gracely when build dir is not found
    
    to indicate that scenario is handled

 docker-builder.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/docker-builder.sh b/docker-builder.sh
index dab69e9..e2a932d 100755
--- a/docker-builder.sh
+++ b/docker-builder.sh
@@ -43,7 +43,11 @@ while true; do
 	docker exec $name cleanbuild/teeboth $buildlog builder -nn -bb -R $package --define 'clean exit 0' && rc=$? || rc=$?
 
 	findbr=$package.findbr.log
-	builddir=$(docker exec $name sh -c 'test -d rpm/BUILD/* && echo rpm/BUILD/*')
+	builddir=$(docker exec $name sh -c 'test ! -d rpm/BUILD/* || echo rpm/BUILD/*')
+	if [ -z "$builddir" ]; then
+		echo >&2 "No build dir. Build failed?"
+		exit 6
+	fi
 	# need root to run poldek
 	docker exec --user=root $name cleanbuild/findbr $builddir $buildlog > $findbr
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/cleanbuild.git/commitdiff/4f6e2b515b98ba137dfcde393db3db0658b4bfb8



More information about the pld-cvs-commit mailing list