2019-03-03 10:27:03 +01:00
|
|
|
termux_get_repo_files() {
|
2019-08-06 14:39:42 +02:00
|
|
|
# Not needed for on-device builds.
|
2019-08-13 17:43:08 +02:00
|
|
|
[ "$TERMUX_ON_DEVICE_BUILD" = "true" ] && return
|
2019-08-06 14:39:42 +02:00
|
|
|
|
2019-02-26 21:40:40 +01:00
|
|
|
# Ensure folders present (but not $TERMUX_PKG_SRCDIR, it will be created in build)
|
|
|
|
mkdir -p "$TERMUX_COMMON_CACHEDIR" \
|
|
|
|
"$TERMUX_COMMON_CACHEDIR-$TERMUX_ARCH" \
|
|
|
|
"$TERMUX_COMMON_CACHEDIR-all" \
|
|
|
|
"$TERMUX_DEBDIR" \
|
|
|
|
"$TERMUX_PKG_BUILDDIR" \
|
|
|
|
"$TERMUX_PKG_PACKAGEDIR" \
|
|
|
|
"$TERMUX_PKG_TMPDIR" \
|
|
|
|
"$TERMUX_PKG_CACHEDIR" \
|
|
|
|
"$TERMUX_PKG_MASSAGEDIR" \
|
|
|
|
$TERMUX_PREFIX/{bin,etc,lib,libexec,share,tmp,include}
|
2019-08-06 14:39:42 +02:00
|
|
|
|
2019-02-26 21:40:40 +01:00
|
|
|
if [ "$TERMUX_INSTALL_DEPS" = true ]; then
|
|
|
|
if [ "$TERMUX_NO_CLEAN" = false ]; then
|
|
|
|
# Remove all previously extracted/built files from $TERMUX_PREFIX:
|
|
|
|
rm -rf $TERMUX_PREFIX
|
2019-08-06 14:39:42 +02:00
|
|
|
rm -f $TERMUX_BUILT_PACKAGES_DIRECTORY/*
|
2019-02-26 21:40:40 +01:00
|
|
|
fi
|
2019-03-06 14:37:50 +01:00
|
|
|
|
2019-02-26 21:40:40 +01:00
|
|
|
for idx in $(seq ${#TERMUX_REPO_URL[@]}); do
|
|
|
|
local TERMUX_REPO_NAME=$(echo ${TERMUX_REPO_URL[$idx-1]} | sed -e 's%https://%%g' -e 's%http://%%g' -e 's%/%-%g')
|
2019-03-11 16:51:42 +01:00
|
|
|
local RELEASE_FILE=${TERMUX_COMMON_CACHEDIR}/${TERMUX_REPO_NAME}-${TERMUX_REPO_DISTRIBUTION[$idx-1]}-Release
|
2019-02-26 21:40:40 +01:00
|
|
|
|
2020-08-13 17:16:43 +02:00
|
|
|
termux_download "${TERMUX_REPO_URL[$idx-1]}/dists/${TERMUX_REPO_DISTRIBUTION[$idx-1]}/Release" \
|
|
|
|
"$RELEASE_FILE" SKIP_CHECKSUM
|
|
|
|
|
|
|
|
termux_download "${TERMUX_REPO_URL[$idx-1]}/dists/${TERMUX_REPO_DISTRIBUTION[$idx-1]}/Release.gpg" \
|
|
|
|
"${RELEASE_FILE}.gpg" SKIP_CHECKSUM
|
2020-03-21 15:30:02 +01:00
|
|
|
|
|
|
|
gpg --verify "${RELEASE_FILE}.gpg" "$RELEASE_FILE"
|
|
|
|
|
2019-02-26 21:40:40 +01:00
|
|
|
for arch in all $TERMUX_ARCH; do
|
2019-03-03 10:27:03 +01:00
|
|
|
local PACKAGES_HASH=$(./scripts/get_hash_from_file.py ${RELEASE_FILE} $arch ${TERMUX_REPO_COMPONENT[$idx-1]})
|
2019-02-26 21:40:40 +01:00
|
|
|
# If packages_hash = "" then the repo probably doesn't contain debs for $arch
|
2019-08-13 00:39:35 +02:00
|
|
|
if [ -n "$PACKAGES_HASH" ]; then
|
2019-02-26 21:40:40 +01:00
|
|
|
termux_download "${TERMUX_REPO_URL[$idx-1]}/dists/${TERMUX_REPO_DISTRIBUTION[$idx-1]}/${TERMUX_REPO_COMPONENT[$idx-1]}/binary-$arch/Packages" \
|
|
|
|
"${TERMUX_COMMON_CACHEDIR}-$arch/${TERMUX_REPO_NAME}-${TERMUX_REPO_DISTRIBUTION[$idx-1]}-${TERMUX_REPO_COMPONENT[$idx-1]}-Packages" \
|
2019-03-03 10:27:03 +01:00
|
|
|
$PACKAGES_HASH
|
2019-02-26 21:40:40 +01:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
}
|