mock-build.sh: minor improvements
This commit is contained in:
parent
a16c51f057
commit
644cd53fab
|
@ -8,20 +8,20 @@ if (! command -v mock > /dev/null) || (! groups | grep 'mock' > /dev/null); then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z $1 ]]; then
|
||||
if [[ -z "${1:-}" ]]; then
|
||||
echo 'Need a SOURCES directory.'
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -d $1 ]]; then
|
||||
if [[ ! -d "$1" ]]; then
|
||||
echo "'$1' is not a directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z $2 ]]; then
|
||||
if [[ -z "${2:-}" ]]; then
|
||||
echo 'Need an RPM SPEC file.'
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! -f $2 ]]; then
|
||||
if [[ ! -f "$2" ]]; then
|
||||
echo "'$2' is not a file"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -37,14 +37,15 @@ if [[ ! -d "/var/lib/mock/$MOCK_ROOT" ]]; then
|
|||
mock --root "$MOCK_ROOT" --init
|
||||
fi
|
||||
|
||||
additional_args=( "$@" )
|
||||
# shellcheck disable=SC2086
|
||||
time mock \
|
||||
$3 \
|
||||
"${additional_args[@]:2}" \
|
||||
--isolation nspawn \
|
||||
--root $MOCK_ROOT \
|
||||
--resultdir $MOCK_OUT \
|
||||
--sources $1 \
|
||||
--root "$MOCK_ROOT" \
|
||||
--resultdir "$MOCK_OUT" \
|
||||
--sources "$1" \
|
||||
--no-cleanup-after \
|
||||
--buildsrpm \
|
||||
--spec $2 \
|
||||
--spec "$2" \
|
||||
--rebuild
|
||||
|
|
Loading…
Reference in New Issue