build-package.sh: fix TERMUX_PKG_SRCURL unbound variable

When no source URL defined, the following error occurs:

 /home/builder/termux-packages/scripts/build/get_source/termux_step_get_source.sh: line 2: TERMUX_PKG_SRCURL: unbound variable
This commit is contained in:
Leonid Pliushch 2020-07-22 20:08:46 +03:00
parent 6ee315200b
commit 22ae9c583e
1 changed files with 6 additions and 4 deletions

View File

@ -1,11 +1,13 @@
termux_step_get_source() {
: "${TERMUX_PKG_SRCURL:=""}"
if [ "${TERMUX_PKG_SRCURL: -4}" == ".git" ]; then
termux_git_clone_src
else
if [ -z "${TERMUX_PKG_SRCURL:=""}" ] || [ "${TERMUX_PKG_SKIP_SRC_EXTRACT-false}" = "true" ] || [ "$TERMUX_PKG_METAPACKAGE" = "true" ]; then
mkdir -p "$TERMUX_PKG_SRCDIR"
return
fi
if [ -z "${TERMUX_PKG_SRCURL}" ] || [ "${TERMUX_PKG_SKIP_SRC_EXTRACT-false}" = "true" ] || [ "$TERMUX_PKG_METAPACKAGE" = "true" ]; then
mkdir -p "$TERMUX_PKG_SRCDIR"
return
fi
termux_download_src_archive
cd $TERMUX_PKG_TMPDIR
termux_extract_src_archive