/usr/bin/rpmbuild ${TARGET:+--target $TARGET} $BCONDS --short-circuit --define '_source_payload w9.gzdio' "$@" || exit
}
-BCONDS=$(./builder --show-bconds "$@")
-# ignore output from older builders whose output is not compatible.
-if [ "$(echo "$bconds" | wc -l)" -gt 1 ]; then
- BCONDS=""
-fi
+specfile="$1"
-SPECFILE="$1"
-tmp=$(awk '/^BuildArch:/ { print $NF}' $SPECFILE)
+tmp=$(awk '/^BuildArch:/ { print $NF}' $specfile)
if [ "$tmp" ]; then
TARGET="$tmp"
fi
+BCONDS=$(./builder --show-bconds $specfile)
+# ignore output from older builders whose output is not compatible.
+if [ "$(echo "$bconds" | wc -l)" -gt 1 ]; then
+ BCONDS=""
+fi
+
# just create the rpm's if -bb is somewhere in the args
if [[ *$@* != *-bb* ]]; then
rpmbuild -bi "$@"