building packages: create termux_step_get_source function

Calls termux_git_clone_src if TERMUX_PKG_SRCURL ends with .git, and
termux_download_src_archive and termux_extract_src_archive otherwise.
termux_step_extract_package has been split up into the latter two
functions.

termux_step_post_extract_package has been renamed to
termux_step_post_get_source to reflect these changes.
This commit is contained in:
Henrik Grimler
2020-07-16 23:51:05 +02:00
parent 955a7b7c5c
commit 4e902a41a5
7 changed files with 102 additions and 48 deletions

View File

@@ -0,0 +1,10 @@
termux_step_get_source() {
if [ "${TERMUX_PKG_SRCURL: -4}" == ".git" ]; then
termux_git_clone_src
else
mkdir -p $TERMUX_PKG_SRCDIR
termux_download_src_archive
cd $TERMUX_PKG_TMPDIR
termux_extract_src_archive
fi
}