proot-distro: use file copy instead of symlink 'ubuntu.sh --> ubuntu-20.04.sh'

This commit is contained in:
Leonid Pliushch 2020-09-03 15:57:32 +03:00
parent 2ef2748898
commit 6a74b6d6a2
1 changed files with 5 additions and 5 deletions

View File

@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Termux official utility for managing proot'ed Linux dist
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="Leonid Pliushch <leonid.pliushch@gmail.com>"
TERMUX_PKG_VERSION=0.8
TERMUX_PKG_REVISION=2
TERMUX_PKG_REVISION=3
TERMUX_PKG_SRCURL=https://github.com/termux/proot-distro/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=cbcd4b652e383e732a2be9aedce60519b5db9ffb95ea4909c2ee2f296abc477c
TERMUX_PKG_DEPENDS="bash, bzip2, coreutils, curl, findutils, gzip, ncurses-utils, proot, tar, xz-utils"
@ -24,17 +24,17 @@ termux_step_make_install() {
}
termux_step_create_debscripts() {
# Create compatibility symlink ubuntu.sh --> ubuntu-20.04.sh.
# Don't break older installations.
cat <<- POSTINST_EOF > ./postinst
#!$TERMUX_PREFIX/bin/sh
if [ -f "$TERMUX_PREFIX/etc/proot-distro/ubuntu.sh" ]; then
mv -f "$TERMUX_PREFIX/etc/proot-distro/ubuntu.sh" "$TERMUX_PREFIX/etc/proot-distro/ubuntu-20.04.sh"
cp -f "$TERMUX_PREFIX/etc/proot-distro/ubuntu.sh" "$TERMUX_PREFIX/etc/proot-distro/ubuntu-20.04.sh"
else
cp -f "$TERMUX_PREFIX/etc/proot-distro/ubuntu-20.04.sh" "$TERMUX_PREFIX/etc/proot-distro/ubuntu.sh"
fi
ln -sfr "$TERMUX_PREFIX/etc/proot-distro/ubuntu-20.04.sh" "$TERMUX_PREFIX/etc/proot-distro/ubuntu.sh"
exit 0
POSTINST_EOF
# Delete compatibility symlink.
cat <<- PRERM_EOF > ./prerm
#!$TERMUX_PREFIX/bin/sh
if [ "\$1" != "remove" ]; then