Require a branch in build-package script

This commit is contained in:
Francesco Abbate 2021-02-16 16:31:46 +01:00
parent 9fced84a7a
commit 4335ab93c9
1 changed files with 10 additions and 1 deletions

View File

@ -10,7 +10,7 @@ copy_directory_from_repo () {
fi
local dirname="$1"
local destdir="$2"
git archive master "$dirname" --format=tar | tar xf - -C "$destdir" "${tar_options[@]}"
git archive "$use_branch" "$dirname" --format=tar | tar xf - -C "$destdir" "${tar_options[@]}"
}
# Check if build directory is ok to be used to build.
@ -190,6 +190,10 @@ while [ ! -z {$1+x} ]; do
portable=true
shift
;;
-branch=*)
use_branch="${1#-branch=}"
shift
;;
*)
version="$1"
arch="$2"
@ -197,6 +201,11 @@ while [ ! -z {$1+x} ]; do
esac
done
if [ -z ${use_branch+set} ]; then
echo "Please specify a branch with -branch=<name>"
exit 1
fi
build_dir=".build-$arch"
if [ -z ${pgo+set} ]; then