summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-09-14 14:22:06 +0200
committerThomas Haller <thaller@redhat.com>2018-09-14 14:55:43 +0200
commitd1fecaa2d372c6907cafc4ee4884c01ad49b4184 (patch)
tree3bee896f07b000a33ddd72aa03217432e4d248d3 /contrib
parentfd2e8179d32d98736110ea17fb7ce1253534679c (diff)
downloadNetworkManager-d1fecaa2d372c6907cafc4ee4884c01ad49b4184.tar.gz
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: ad850c4f03a93a21d745b2e46cca78525bdad843 (cherry picked from commit cc8c207120a766946b25d39ab5211840a12d20cb)
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/fedora/rpm/build_clean.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/contrib/fedora/rpm/build_clean.sh b/contrib/fedora/rpm/build_clean.sh
index 888cac8cbb..4ceedf40ac 100755
--- a/contrib/fedora/rpm/build_clean.sh
+++ b/contrib/fedora/rpm/build_clean.sh
@@ -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[@]}"