build-package.sh: mv download of InRelease and Packages to new function termux_step_get_repo_files
This commit is contained in:
parent
9a5afe61c8
commit
13855a96a2
@ -471,25 +471,11 @@ termux_download_deb() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# Source the package build script and start building. No to be overridden by packages.
|
# Script to download InRelease, verify it's signature and then download Packages.xz by hash
|
||||||
termux_step_start_build() {
|
termux_step_get_repo_files() {
|
||||||
# shellcheck source=/dev/null
|
|
||||||
source "$TERMUX_PKG_BUILDER_SCRIPT"
|
|
||||||
|
|
||||||
TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_COMMON_CACHEDIR/${TERMUX_NDK_VERSION}-${TERMUX_ARCH}-${TERMUX_PKG_API_LEVEL}"
|
|
||||||
# Bump the below version if a change is made in toolchain setup to ensure
|
|
||||||
# that everyone gets an updated toolchain:
|
|
||||||
TERMUX_STANDALONE_TOOLCHAIN+="-v4"
|
|
||||||
|
|
||||||
if [ -n "${TERMUX_PKG_BLACKLISTED_ARCHES:=""}" ] && [ "$TERMUX_PKG_BLACKLISTED_ARCHES" != "${TERMUX_PKG_BLACKLISTED_ARCHES/$TERMUX_ARCH/}" ]; then
|
|
||||||
echo "Skipping building $TERMUX_PKG_NAME for arch $TERMUX_ARCH"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
local TERMUX_ALL_DEPS=$(./scripts/buildorder.py "$TERMUX_PKG_BUILDER_DIR")
|
|
||||||
if [ "$TERMUX_SKIP_DEPCHECK" = false ] && [ "$TERMUX_INSTALL_DEPS" = true ]; then
|
if [ "$TERMUX_SKIP_DEPCHECK" = false ] && [ "$TERMUX_INSTALL_DEPS" = true ]; then
|
||||||
# Remove all previously extracted/built files from $TERMUX_PREFIX:
|
# Remove all previously extracted/built files from $TERMUX_PREFIX:
|
||||||
rm -r $TERMUX_PREFIX
|
rm -rf $TERMUX_PREFIX
|
||||||
rm -f /data/data/.built-packages/*
|
rm -f /data/data/.built-packages/*
|
||||||
# Ensure folders present (but not $TERMUX_PKG_SRCDIR, it will be created in build)
|
# Ensure folders present (but not $TERMUX_PKG_SRCDIR, it will be created in build)
|
||||||
mkdir -p "$TERMUX_COMMON_CACHEDIR" \
|
mkdir -p "$TERMUX_COMMON_CACHEDIR" \
|
||||||
@ -529,7 +515,26 @@ termux_step_start_build() {
|
|||||||
$packages_hash
|
$packages_hash
|
||||||
xz -df "${TERMUX_COMMON_CACHEDIR}-$arch/Packages.xz"
|
xz -df "${TERMUX_COMMON_CACHEDIR}-$arch/Packages.xz"
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Source the package build script and start building. No to be overridden by packages.
|
||||||
|
termux_step_start_build() {
|
||||||
|
# shellcheck source=/dev/null
|
||||||
|
source "$TERMUX_PKG_BUILDER_SCRIPT"
|
||||||
|
|
||||||
|
TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_COMMON_CACHEDIR/${TERMUX_NDK_VERSION}-${TERMUX_ARCH}-${TERMUX_PKG_API_LEVEL}"
|
||||||
|
# Bump the below version if a change is made in toolchain setup to ensure
|
||||||
|
# that everyone gets an updated toolchain:
|
||||||
|
TERMUX_STANDALONE_TOOLCHAIN+="-v4"
|
||||||
|
|
||||||
|
if [ -n "${TERMUX_PKG_BLACKLISTED_ARCHES:=""}" ] && [ "$TERMUX_PKG_BLACKLISTED_ARCHES" != "${TERMUX_PKG_BLACKLISTED_ARCHES/$TERMUX_ARCH/}" ]; then
|
||||||
|
echo "Skipping building $TERMUX_PKG_NAME for arch $TERMUX_ARCH"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
local TERMUX_ALL_DEPS=$(./scripts/buildorder.py "$TERMUX_PKG_BUILDER_DIR")
|
||||||
|
if [ "$TERMUX_SKIP_DEPCHECK" = false ] && [ "$TERMUX_INSTALL_DEPS" = true ]; then
|
||||||
# Download dependencies
|
# Download dependencies
|
||||||
local pkg dep_arch dep_version deb_file
|
local pkg dep_arch dep_version deb_file
|
||||||
for pkg in $TERMUX_ALL_DEPS; do
|
for pkg in $TERMUX_ALL_DEPS; do
|
||||||
@ -1423,8 +1428,9 @@ termux_step_create_debfile() {
|
|||||||
termux_step_compare_debs() {
|
termux_step_compare_debs() {
|
||||||
if [ "${TERMUX_INSTALL_DEPS}" = true ]; then
|
if [ "${TERMUX_INSTALL_DEPS}" = true ]; then
|
||||||
local arch version
|
local arch version
|
||||||
if [ ! "$TERMUX_QUIET_BUILD" = true ]; then echo "COMPARING PACKAGES"; fi
|
|
||||||
cd ${TERMUX_SCRIPTDIR}
|
cd ${TERMUX_SCRIPTDIR}
|
||||||
|
if [ ! "$TERMUX_QUIET_BUILD" = true ]; then echo "COMPARING PACKAGES"; fi
|
||||||
|
|
||||||
termux_download_deb $(basename $TERMUX_PKG_BUILDER_DIR) $TERMUX_ARCH $TERMUX_PKG_FULLVERSION
|
termux_download_deb $(basename $TERMUX_PKG_BUILDER_DIR) $TERMUX_ARCH $TERMUX_PKG_FULLVERSION
|
||||||
deb_file=${TERMUX_PKG_NAME}_${TERMUX_PKG_FULLVERSION}_${TERMUX_ARCH}.deb
|
deb_file=${TERMUX_PKG_NAME}_${TERMUX_PKG_FULLVERSION}_${TERMUX_ARCH}.deb
|
||||||
|
|
||||||
@ -1446,6 +1452,7 @@ termux_step_finish_build() {
|
|||||||
termux_step_handle_arguments "$@"
|
termux_step_handle_arguments "$@"
|
||||||
termux_step_setup_variables
|
termux_step_setup_variables
|
||||||
termux_step_handle_buildarch
|
termux_step_handle_buildarch
|
||||||
|
termux_step_get_repo_files
|
||||||
termux_step_start_build
|
termux_step_start_build
|
||||||
termux_step_extract_package
|
termux_step_extract_package
|
||||||
cd "$TERMUX_PKG_SRCDIR"
|
cd "$TERMUX_PKG_SRCDIR"
|
||||||
|
Loading…
Reference in New Issue
Block a user