scripts/setup-termux.sh: adding the ability to install packages via pacman (#16368)
build-package.sh: improved work with pacman-conf
This commit is contained in:
parent
2534d50092
commit
cd151f2841
|
@ -350,7 +350,7 @@ if [ "$TERMUX_ON_DEVICE_BUILD" = "true" ]; then
|
|||
# Target architecture must be same as for environment used currently.
|
||||
case "$TERMUX_APP_PACKAGE_MANAGER" in
|
||||
"apt") TERMUX_ARCH=$(dpkg --print-architecture);;
|
||||
"pacman") TERMUX_ARCH=$(pacman-conf | grep Architecture | sed 's/Architecture = //g');;
|
||||
"pacman") TERMUX_ARCH=$(pacman-conf Architecture);;
|
||||
esac
|
||||
export TERMUX_ARCH
|
||||
fi
|
||||
|
|
|
@ -18,7 +18,7 @@ PACKAGES+=" asciidoctor"
|
|||
PACKAGES+=" autoconf"
|
||||
PACKAGES+=" automake"
|
||||
PACKAGES+=" bc"
|
||||
PACKAGES+=" bison"
|
||||
PACKAGES+=" byacc"
|
||||
PACKAGES+=" bsdtar" # Needed to create pacman packages
|
||||
PACKAGES+=" cmake"
|
||||
PACKAGES+=" ed"
|
||||
|
@ -45,6 +45,17 @@ PACKAGES+=" valac"
|
|||
PACKAGES+=" xmlto" # Needed by git's manpage generation
|
||||
PACKAGES+=" zip"
|
||||
|
||||
apt update
|
||||
apt dist-upgrade -y
|
||||
apt install -y $PACKAGES
|
||||
# Definition of a package manager
|
||||
. $(dirname "$(realpath "$0")")/properties.sh
|
||||
source "$TERMUX_PREFIX/bin/termux-setup-package-manager" || true
|
||||
|
||||
if [ "$TERMUX_APP_PACKAGE_MANAGER" = "apt" ]; then
|
||||
apt update
|
||||
apt dist-upgrade -y
|
||||
apt install -y $PACKAGES
|
||||
elif [ "$TERMUX_APP_PACKAGE_MANAGER" = "pacman" ]; then
|
||||
pacman -Syu $PACKAGES --needed --noconfirm
|
||||
else
|
||||
echo "Error: no package manager defined"
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue