Add fallback function

This commit is contained in:
Augusto Gunsch 2021-08-12 22:17:54 -03:00
parent 3738f13cf0
commit 6f0c4d6360
No known key found for this signature in database
GPG Key ID: F7EEFE29825C72DC
1 changed files with 4 additions and 4 deletions

View File

@ -188,7 +188,7 @@ install_aur() {
#dependencies
for pkg in $(sudo -u nobody makepkg --printsrcinfo | awk '$1 ~ /depends/ {print $3}'); do
install_skip_missing $pkg
install_try_aur $pkg
done
if [ -z "$2" ]; then
@ -230,7 +230,7 @@ install() {
echo "done"
}
install_skip_missing() {
install_try_aur() {
if [ -z "$2" ]; then
echo -ne "Installing ${LGREEN}$1${NC}..."
else
@ -238,7 +238,7 @@ install_skip_missing() {
fi
set +e
ultra_quiet pacman -Sq --needed --noconfirm $1
[ $? -ne 0 ] && echo "Not found: skipping" || echo "done"
[ $? -ne 0 ] && set -e && echo "not found: will try from AUR" && install_aur $1
set -e
}
@ -546,7 +546,7 @@ install_loop() {
[ -f "packages.csv" ] || curl -sL "$PACKAGES_URL" -o "packages.csv"
while IFS=, read -r method package description; do
case "$method" in
"PAC") install "$package" "$description";;
"PAC") install_try_aur "$package" "$description";;
"AUR") install_aur "$package" "$description";;
"SRC") install_src "$package" "$description";;
"FUN") $package ;;