]> git.pld-linux.org Git - projects/cleanbuild.git/commitdiff
add --with/--without to docker variant
authorElan Ruusamäe <glen@pld-linux.org>
Sat, 2 Feb 2019 21:27:06 +0000 (23:27 +0200)
committerElan Ruusamäe <glen@pld-linux.org>
Sat, 2 Feb 2019 21:27:06 +0000 (23:27 +0200)
cleanbuild-docker.sh

index 82f90213c18fe6b00425ae3fae4f010ef2c75c5e..8d6bd69869c4c4800f864e18ac59fc4a37e5fbd7 100755 (executable)
@@ -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
This page took 0.18368 seconds and 4 git commands to generate.