diff options
author | Elan Ruusamäe | 2019-02-02 21:27:06 (GMT) |
---|---|---|
committer | Elan Ruusamäe | 2019-02-02 21:27:06 (GMT) |
commit | 60584f5d0a8c1f0afc6f238182369c14e07896e0 (patch) | |
tree | 3d3b7eb2c9414f618369d0d8c4a7abac9de7aa84 | |
parent | ad5ed75b3b5faa1dcf87f576955c52b3f8c444bd (diff) | |
download | cleanbuild-60584f5d0a8c1f0afc6f238182369c14e07896e0.zip cleanbuild-60584f5d0a8c1f0afc6f238182369c14e07896e0.tar.gz |
add --with/--without to docker variant
-rwxr-xr-x | cleanbuild-docker.sh | 21 |
1 files 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 |