Commit cc8c2071 authored by Thomas Haller's avatar Thomas Haller

contrib/rpm: fix handling of --with test default

Seems rpmbuild does not honor the latest occurance with

  --with test --without test

to disable tests. Work around that.

Fixes: ad850c4f
parent ad850c4f
......@@ -41,10 +41,12 @@ IGNORE_DIRTY=0
GIT_CLEAN=0
QUICK=0
NO_DIST=0
WITH_LIST=(--with test)
WITH_LIST=()
SOURCE_FROM_GIT=0
SNAPSHOT="$NM_BUILD_SNAPSHOT"
ADD_WITH_TEST=1
NARGS=$#
while [[ $# -gt 0 ]]; do
......@@ -90,11 +92,17 @@ while [[ $# -gt 0 ]]; do
-w|--with)
[[ $# -gt 0 ]] || die "Missing argument to $A"
WITH_LIST=("${WITH_LIST[@]}" "--with" "$1")
if [[ "$1" == test ]]; then
ADD_WITH_TEST=0
fi
shift
;;
-W|--without)
[[ $# -gt 0 ]] || die "Missing argument to $A"
WITH_LIST=("${WITH_LIST[@]}" "--without" "$1")
if [[ "$1" == test ]]; then
ADD_WITH_TEST=0
fi
shift
;;
*)
......@@ -157,6 +165,10 @@ if [[ $NO_DIST != 1 ]]; then
fi
fi
if [[ "$ADD_WITH_TEST" == 1 ]]; then
WITH_LIST=("${WITH_LIST[@]}" "--with" "test")
fi
export SOURCE_FROM_GIT
export BUILDTYPE
export NM_RPMBUILD_ARGS="${WITH_LIST[@]}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment