Skip to content

Commit

Permalink
Fix issue openark#116: precheck() honours -b
Browse files Browse the repository at this point in the history
  • Loading branch information
samveen committed Mar 30, 2017
1 parent cbc5e2b commit ba45adf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@ usage() {
}

function precheck() {
local target
local target build_only
local ok=0 # return err. so shell exit code
target="$1"
build_only="$2"

if [[ "$target" == "linux" ]]; then
if [[ ! -x "$( which fpm )" ]]; then
if [[ $build_only -eq 0 ]] && [[ ! -x "$( which fpm )" ]]; then
echo "Please install fpm and ensure it is in PATH (typically: 'gem install fpm')"
ok=1
fi

if [[ ! -x "$( which rpmbuild )" ]]; then
if [[ $build_only -eq 0 ]] && [[ ! -x "$( which rpmbuild )" ]]; then
echo "rpmbuild not in PATH, rpm will not be built (OS/X: 'brew install rpm')"
fi
fi
Expand Down Expand Up @@ -162,7 +163,7 @@ function main() {
fi
RELEASE_VERSION="${RELEASE_VERSION}${RELEASE_SUBVERSION}"

precheck "$target"
precheck "$target" "$build_only"
builddir=$( setuptree "$prefix" )
oinstall "$builddir" "$prefix"
build "$target" "$arch" "$builddir" "$prefix"
Expand Down

0 comments on commit ba45adf

Please sign in to comment.