[projects/cleanbuild] add --with/--without to docker variant

glen glen at pld-linux.org
Sat Feb 2 22:27:21 CET 2019


commit 60584f5d0a8c1f0afc6f238182369c14e07896e0
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Sat Feb 2 23:27:06 2019 +0200

    add --with/--without to docker variant

 cleanbuild-docker.sh | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/cleanbuild-docker.sh b/cleanbuild-docker.sh
index 82f9021..8d6bd69 100755
--- a/cleanbuild-docker.sh
+++ b/cleanbuild-docker.sh
@@ -7,6 +7,8 @@ PROGRAM=${0##*/}
 : ${PACKAGE_NAME=''}
 : ${NETWORKING=false}
 : ${TRACING=false}
+: ${WITH=}
+: ${WITHOUT=}
 : ${KEEP_CONTAINER=false}
 : ${TMPFS="4G"}
 
@@ -61,7 +63,7 @@ create_container() {
 		-v $dir/cache/poldek:/var/cache/poldek \
 		-v $dir/cache/ccache/$PACKAGE_NAME:$home/.ccache \
 		$(tmpfs) \
-		$image
+		$image >/dev/null
 
 	# set the homedir
 	docker exec --user=root -w / $name usermod -d $home builder
@@ -90,16 +92,19 @@ package_prepare() {
 }
 
 package_build() {
+	# create default args for builder
+	set -- -nn ${WITH:+--with "${WITH# }"} ${WITHOUT:+--without "${WITHOUT# }"} "$PACKAGE_NAME"
+
 	while true; do
 		# install deps
-		docker exec $name builder -g -nn -R $PACKAGE_NAME
+		docker exec $name builder -g -R "$@"
 		# remove .la dependencies
 		docker exec --user=root -w / $name $home/cleanbuild/cleanup-la
 		# reset findunusedbr state after deps install
 		docker exec --user=root -w / $name $home/cleanbuild/findunusedbr -c / $home/rpm/packages/$PACKAGE_NAME/$PACKAGE_NAME.spec
 
 		# actual build
-		docker exec $name cleanbuild/teeboth $buildlog builder -nn -bb $PACKAGE_NAME --define '__spec_clean_body %{nil}' && rc=$? || rc=$?
+		docker exec $name cleanbuild/teeboth $buildlog builder -bb --define '__spec_clean_body %{nil}' "$@" && rc=$? || rc=$?
 
 		findbr=$PACKAGE_NAME.findbr.log
 		builddir=$(docker exec $name sh -c 'test ! -d rpm/BUILD/* || echo rpm/BUILD/*')
@@ -134,7 +139,7 @@ package_build() {
 
 parse_options() {
 	local t
-	t=$(getopt -o 'x' --long 'network,no-tmpfs,notmpfs,tmpfs:,keep-container' -n "$PROGRAM" -- "$@")
+	t=$(getopt -o 'x' --long 'network,no-tmpfs,notmpfs,tmpfs:,keep-container,with:,without:' -n "$PROGRAM" -- "$@")
 	[ $? != 0 ] && exit $?
 	eval set -- "$t"
 
@@ -156,6 +161,14 @@ parse_options() {
 		--keep-container)
 			KEEP_CONTAINER=true
 			;;
+		--with)
+			shift
+			WITH="$WITH $1"
+			;;
+		--without)
+			shift
+			WITHOUT="$WITHOUT $1"
+			;;
 		--)
 			shift
 			break
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/cleanbuild.git/commitdiff/60584f5d0a8c1f0afc6f238182369c14e07896e0



More information about the pld-cvs-commit mailing list