build-package: delete old $PREFIX ealier in build

Currently there is a problem building packages that use *-config
scripts (for example gnupg), we are creating a
/bin/sh->/data/data/com.termux/files/usr/bin/sh symlink so that the
shebang for the scripts can be interpreted, but after
ecd214881a ("build-package: add new arg -c for "continue build"") the
symlink was deleted in termux_step_get_dependencies.
This commit is contained in:
Henrik Grimler 2021-09-03 17:56:57 +02:00
parent 2e942d0b35
commit e6239bb81c
2 changed files with 16 additions and 10 deletions

View File

@ -3,12 +3,6 @@ termux_get_repo_files() {
[ "$TERMUX_ON_DEVICE_BUILD" = "true" ] && return
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
rm -f $TERMUX_BUILT_PACKAGES_DIRECTORY/*
fi
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')
local RELEASE_FILE=${TERMUX_COMMON_CACHEDIR}/${TERMUX_REPO_NAME}-${TERMUX_REPO_DISTRIBUTION[$idx-1]}-Release

View File

@ -1,8 +1,19 @@
termux_step_setup_build_folders() {
# Following directories may contain files with read-only permissions which
# makes them undeletable. We need to fix that.
# Following directories may contain files with read-only
# permissions which makes them undeletable. We need to fix
# that.
[ -d "$TERMUX_PKG_BUILDDIR" ] && chmod +w -R "$TERMUX_PKG_BUILDDIR"
[ -d "$TERMUX_PKG_SRCDIR" ] && chmod +w -R "$TERMUX_PKG_SRCDIR"
if [ "$TERMUX_SKIP_DEPCHECK" = false ] && \
[ "$TERMUX_INSTALL_DEPS" = true ] && \
[ "$TERMUX_PKG_METAPACKAGE" = false ] && \
[ "$TERMUX_NO_CLEAN" = false ] && \
[ "$TERMUX_ON_DEVICE_BUILD" = false ]; then
# Remove all previously extracted/built files from
# $TERMUX_PREFIX:
rm -rf $TERMUX_PREFIX
rm -f $TERMUX_BUILT_PACKAGES_DIRECTORY/*
fi
# Cleanup old build state:
rm -Rf "$TERMUX_PKG_BUILDDIR" \
@ -13,9 +24,10 @@ termux_step_setup_build_folders() {
"$TERMUX_PKG_TMPDIR" \
"$TERMUX_PKG_MASSAGEDIR"
# 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" \
"$TERMUX_COMMON_CACHEDIR-$TERMUX_ARCH" \
"$TERMUX_COMMON_CACHEDIR-$TERMUX_ARCH" \
"$TERMUX_COMMON_CACHEDIR-all" \
"$TERMUX_DEBDIR" \
"$TERMUX_PKG_BUILDDIR" \