Update repo

This commit is contained in:
termux-pacman-bot
2024-01-07 20:08:22 +00:00
parent 25fbcc1da5
commit 70fdc03530
2 changed files with 65 additions and 27 deletions

View File

@@ -5,16 +5,21 @@ termux_step_get_dependencies() {
if [ "$TERMUX_INSTALL_DEPS" = true ]; then
# Download repo files
termux_get_repo_files
termux_download_repo_file
fi
# When doing build on device, ensure that apt lists are up-to-date.
if [ "$TERMUX_ON_DEVICE_BUILD" = "true" ]; then
case "$TERMUX_APP_PACKAGE_MANAGER" in
"apt") apt update;;
"pacman") pacman -Sy;;
esac
while read PKG PKG_DIR; do
# Checking for duplicate dependencies
local cyclic_dependence=false
if termux_check_package_in_building_packages_list "$PKG"; then
echo "A circular dependency was found on '$PKG', the old version of the package will be installed to resolve the conflict"
cyclic_dependence=true
if [ "$TERMUX_INSTALL_DEPS" = false ]; then
termux_download_repo_file
fi
fi
while read PKG PKG_DIR; do
if [ "$TERMUX_INSTALL_DEPS" = true ] || [ "$cyclic_dependence" = true ]; then
if [ -z $PKG ]; then
continue
elif [ "$PKG" = "ERROR" ]; then
@@ -23,11 +28,15 @@ termux_step_get_dependencies() {
# llvm doesn't build if ndk-sysroot is installed:
if [ "$PKG" = "ndk-sysroot" ]; then continue; fi
read DEP_ARCH DEP_VERSION DEP_VERSION_PAC <<< $(termux_extract_dep_info $PKG "${PKG_DIR}")
[ ! "$TERMUX_QUIET_BUILD" = true ] && echo "Downloading dependency $PKG$(test ${TERMUX_WITHOUT_DEPVERSION_BINDING} = false && echo "@$DEP_VERSION") if necessary..."
local force_build_dependency="$TERMUX_FORCE_BUILD_DEPENDENCIES"
if [ "$TERMUX_FORCE_BUILD_DEPENDENCIES" = "true" ] && [ "$TERMUX_ON_DEVICE_BUILD" = "true" ] && ! package__is_package_on_device_build_supported "$PKG_DIR"; then
echo "Building dependency $PKG on device is not supported. It will be downloaded..."
force_build_dependency="false"
if [ "$cyclic_dependence" = false ]; then
[ ! "$TERMUX_QUIET_BUILD" = true ] && echo "Downloading dependency $PKG$(test ${TERMUX_WITHOUT_DEPVERSION_BINDING} = false && echo "@$DEP_VERSION") if necessary..."
local force_build_dependency="$TERMUX_FORCE_BUILD_DEPENDENCIES"
if [ "$TERMUX_FORCE_BUILD_DEPENDENCIES" = "true" ] && [ "$TERMUX_ON_DEVICE_BUILD" = "true" ] && ! package__is_package_on_device_build_supported "$PKG_DIR"; then
echo "Building dependency $PKG on device is not supported. It will be downloaded..."
force_build_dependency="false"
fi
else
local force_build_dependency=false
fi
local build_dependency=false
if [ "$force_build_dependency" = "true" ]; then
@@ -39,9 +48,9 @@ termux_step_get_dependencies() {
[ ! "$TERMUX_QUIET_BUILD" = true ] && echo "Skipping already built dependency $PKG$(test ${TERMUX_WITHOUT_DEPVERSION_BINDING} = false && echo "@$DEP_VERSION")"
continue
fi
if ! termux_download_deb_pac $PKG $DEP_ARCH $DEP_VERSION $DEP_VERSION_PAC; then
if [ "$TERMUX_FORCE_BUILD_DEPENDENCIES" = "true" ] && [ "$TERMUX_ON_DEVICE_BUILD" = "true" ]; then
echo "Download of $PKG$(test ${TERMUX_WITHOUT_DEPVERSION_BINDING} = false && echo "@$DEP_VERSION") from $TERMUX_REPO_URL failed"
if ! TERMUX_WITHOUT_DEPVERSION_BINDING=$(test "${cyclic_dependence}" = "true" && echo "true" || echo "${TERMUX_WITHOUT_DEPVERSION_BINDING}") termux_download_deb_pac $PKG $DEP_ARCH $DEP_VERSION $DEP_VERSION_PAC; then
if [ "$cyclic_dependence" = "true" ] || ([ "$TERMUX_FORCE_BUILD_DEPENDENCIES" = "true" ] && [ "$TERMUX_ON_DEVICE_BUILD" = "true" ]); then
echo "Download of $PKG$(test ${TERMUX_WITHOUT_DEPVERSION_BINDING} = false && test ${cyclic_dependence} = false && echo "@$DEP_VERSION") from $TERMUX_REPO_URL failed"
return 1
else
echo "Download of $PKG$(test ${TERMUX_WITHOUT_DEPVERSION_BINDING} = false && echo "@$DEP_VERSION") from $TERMUX_REPO_URL failed, building instead"
@@ -49,11 +58,13 @@ termux_step_get_dependencies() {
fi
fi
fi
if $build_dependency; then
termux_run_build-package
continue
if [ "$cyclic_dependence" = false ]; then
if $build_dependency; then
termux_run_build-package
continue
fi
termux_add_package_to_built_packages_list "$PKG"
fi
termux_add_package_to_built_packages_list "$PKG"
if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
[ ! "$TERMUX_QUIET_BUILD" = true ] && echo "extracting $PKG to $TERMUX_COMMON_CACHEDIR-$DEP_ARCH..."
(
@@ -75,13 +86,11 @@ termux_step_get_dependencies() {
)
fi
mkdir -p $TERMUX_BUILT_PACKAGES_DIRECTORY
if [ "$TERMUX_WITHOUT_DEPVERSION_BINDING" = "false" ] || [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
if [ "$cyclic_dependence" = "false" ] && ([ "$TERMUX_WITHOUT_DEPVERSION_BINDING" = "false" ] || [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]); then
echo "$DEP_VERSION" > "$TERMUX_BUILT_PACKAGES_DIRECTORY/$PKG"
fi
done<<<$(./scripts/buildorder.py -i "$TERMUX_PKG_BUILDER_DIR" $TERMUX_PACKAGES_DIRECTORIES || echo "ERROR")
else
else
# Build dependencies
while read PKG PKG_DIR; do
if [ -z $PKG ]; then
continue
elif [ "$PKG" = "ERROR" ]; then
@@ -100,8 +109,8 @@ termux_step_get_dependencies() {
[ ! "$TERMUX_QUIET_BUILD" = true ] && echo "Building dependency $PKG if necessary..."
fi
termux_run_build-package
done<<<$(./scripts/buildorder.py "$TERMUX_PKG_BUILDER_DIR" $TERMUX_PACKAGES_DIRECTORIES || echo "ERROR")
fi
fi
done<<<$(./scripts/buildorder.py $(test "${TERMUX_INSTALL_DEPS}" = "true" && echo "-i") "$TERMUX_PKG_BUILDER_DIR" $TERMUX_PACKAGES_DIRECTORIES || echo "ERROR")
}
termux_force_check_package_dependency() {
@@ -124,7 +133,19 @@ termux_run_build-package() {
fi
TERMUX_BUILD_IGNORE_LOCK=true ./build-package.sh \
$(test "${TERMUX_INSTALL_DEPS}" = "true" && echo "-I" || echo "-s") \
$(test "${TERMUX_FORCE_BUILD_DEPENDENCIES}" = "true" && echo "-F" || true) \
$(test "${TERMUX_FORCE_BUILD_DEPENDENCIES}" = "true" && echo "-F") \
$(test "${TERMUX_WITHOUT_DEPVERSION_BINDING}" = "true" && echo "-w") \
--format $TERMUX_PACKAGE_FORMAT --library $set_library "${PKG_DIR}"
}
termux_download_repo_file() {
termux_get_repo_files
# When doing build on device, ensure that apt lists are up-to-date.
if [ "$TERMUX_ON_DEVICE_BUILD" = "true" ]; then
case "$TERMUX_APP_PACKAGE_MANAGER" in
"apt") apt update;;
"pacman") pacman -Sy;;
esac
fi
}