clean.sh & build-package.sh: avoid errors in case chmod's target dir is not exist

This commit is contained in:
Leonid Pliushch 2019-07-04 14:29:06 +03:00
parent 33b93ef30d
commit 225b1c471f
2 changed files with 3 additions and 2 deletions

View File

@ -6,5 +6,5 @@ set -e -u
test -f $HOME/.termuxrc && . $HOME/.termuxrc
: ${TERMUX_TOPDIR:="$HOME/.termux-build"}
chmod +w -R $TERMUX_TOPDIR
[ -d "$TERMUX_TOPDIR" ] && chmod +w -R $TERMUX_TOPDIR
rm -Rf /data/* $TERMUX_TOPDIR

View File

@ -94,7 +94,8 @@ termux_step_start_build() {
# Following directories may contain objects with RO-only permissions which
# makes them undeletable. We need fix that.
chmod +w -R "$TERMUX_PKG_BUILDDIR" "$TERMUX_PKG_SRCDIR"
[ -d "$TERMUX_PKG_BUILDDIR" ] && chmod +w "$TERMUX_PKG_BUILDDIR"
[ -d "$TERMUX_PKG_SRCDIR" ] && chmod +w "$TERMUX_PKG_SRCDIR"
# Cleanup old state:
rm -Rf "$TERMUX_PKG_BUILDDIR" \