-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed(scripts|main/termux-tools): Use TERMUX_APP_PACKAGE_MANAGER in…
…stead of TERMUX_MAIN_PACKAGE_FORMAT Make changes as per new design implemented in termux/termux-app@b950efec and termux/termux-app#2740 The package build and termux-tools scripts use current package manager for custom logic. The `termux-tools/termux-setup-package-manager` script has been added that will now be used to provide backward compatibility for termux-app `< 0.119.0` (when its released) and validate the package manager. It will also ensure the variable in not unset to prevent `unbound variable` errors if `set -u` is being used by calling scripts. Closes #10782
- Loading branch information
1 parent
82f2127
commit 28ca844
Showing
5 changed files
with
52 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# TERMUX_APP_PACKAGE_MANAGER should be exported by termux-app v0.119.0+ | ||
# itself and should contain "apt" or "pacman". | ||
# TERMUX_MAIN_PACKAGE_FORMAT should be exported by login script in | ||
# termux-tools v0.161+ if termux-app version is less than 0.119.0 and | ||
# should contain "debian" or "pacman". | ||
if [ -z "${TERMUX_APP_PACKAGE_MANAGER-}" ]; then | ||
if [ -n "${TERMUX_MAIN_PACKAGE_FORMAT-}" ]; then | ||
TERMUX_APP_PACKAGE_MANAGER="$([ "${TERMUX_MAIN_PACKAGE_FORMAT-}" = "debian" ] && echo "apt" || echo "${TERMUX_MAIN_PACKAGE_FORMAT-}")" | ||
else | ||
TERMUX_APP_PACKAGE_MANAGER="@TERMUX_PACKAGE_MANAGER@" | ||
fi | ||
fi | ||
|
||
case "${TERMUX_APP_PACKAGE_MANAGER-}" in | ||
apt|pacman) :;; | ||
*) echo "Unsupported package manager \"${TERMUX_APP_PACKAGE_MANAGER-}\". Only 'apt' and 'pacman' managers are supported" 1>&2; exit 1;; | ||
esac | ||
export TERMUX_APP_PACKAGE_MANAGER |