update debscripts for compatibility with pacman format

This commit is contained in:
Leonid Pliushch
2021-09-10 19:33:36 +03:00
parent 6a54b19a37
commit 9608af5a38
25 changed files with 42 additions and 37 deletions

View File

@@ -79,7 +79,7 @@ termux_step_post_make_install() {
termux_step_create_debscripts() {
cat <<- EOF > ./postinst
#!$TERMUX_PREFIX/bin/sh
if [ "\$1" = "configure" ] || [ "\$1" = "abort-upgrade" ]; then
if [ "$TERMUX_PACKAGE_FORMAT" = "pacman" ] || [ "\$1" = "configure" ] || [ "\$1" = "abort-upgrade" ]; then
if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then
update-alternatives --install \
$TERMUX_PREFIX/bin/editor editor $TERMUX_PREFIX/bin/vim 50
@@ -91,7 +91,7 @@ termux_step_create_debscripts() {
cat <<- EOF > ./prerm
#!$TERMUX_PREFIX/bin/sh
if [ "\$1" != "upgrade" ]; then
if [ "$TERMUX_PACKAGE_FORMAT" = "pacman" ] || [ "\$1" != "upgrade" ]; then
if [ -x "$TERMUX_PREFIX/bin/update-alternatives" ]; then
update-alternatives --remove editor $TERMUX_PREFIX/bin/vim
update-alternatives --remove vi $TERMUX_PREFIX/bin/vim