mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-12-25 04:49:44 +00:00
Move AUR helper functionality to common-script
This commit is contained in:
parent
0ffe947072
commit
bb2eca123d
|
@ -11,6 +11,32 @@ command_exists() {
|
|||
which "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
checkAURHelper() {
|
||||
## Check & Install AUR helper
|
||||
if [ "$PACKAGER" = "pacman" ]; then
|
||||
AUR_HELPERS="yay paru"
|
||||
for helper in ${AUR_HELPERS}; do
|
||||
if command_exists "${helper}"; then
|
||||
AUR_HELPER=${helper}
|
||||
echo "Using ${helper} as AUR helper"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Installing yay as AUR helper..."
|
||||
$ESCALATION_TOOL "$PACKAGER" -S --needed --noconfirm base-devel
|
||||
cd /opt && $ESCALATION_TOOL git clone https://aur.archlinux.org/yay-git.git && $ESCALATION_TOOL chown -R "$USER":"$USER" ./yay-git
|
||||
cd yay-git && makepkg --noconfirm -si
|
||||
|
||||
if command_exists yay; then
|
||||
AUR_HELPER="yay"
|
||||
else
|
||||
echo -e "${RED}Failed to install AUR helper.${RC}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
checkEscalationTool() {
|
||||
## Check for escalation tools.
|
||||
if [ -z "$ESCALATION_TOOL_CHECKED" ]; then
|
||||
|
|
|
@ -15,22 +15,7 @@ installDepend() {
|
|||
else
|
||||
echo "Multilib is already enabled."
|
||||
fi
|
||||
if ! command_exists yay && ! command_exists paru; then
|
||||
echo "Installing yay as AUR helper..."
|
||||
$ESCALATION_TOOL "$PACKAGER" -S --needed --noconfirm base-devel
|
||||
cd /opt && $ESCALATION_TOOL git clone https://aur.archlinux.org/yay-git.git && $ESCALATION_TOOL chown -R "$USER":"$USER" ./yay-git
|
||||
cd yay-git && makepkg --noconfirm -si
|
||||
else
|
||||
echo "Aur helper already installed"
|
||||
fi
|
||||
if command_exists yay; then
|
||||
AUR_HELPER="yay"
|
||||
elif command_exists paru; then
|
||||
AUR_HELPER="paru"
|
||||
else
|
||||
echo "No AUR helper found. Please install yay or paru."
|
||||
exit 1
|
||||
fi
|
||||
checkAURHelper
|
||||
$AUR_HELPER -S --needed --noconfirm "$DEPENDENCIES"
|
||||
;;
|
||||
apt-get|nala)
|
||||
|
|
|
@ -13,22 +13,7 @@ installDepend() {
|
|||
else
|
||||
echo "Multilib is already enabled."
|
||||
fi
|
||||
if ! command_exists yay && ! command_exists paru; then
|
||||
echo "Installing yay as AUR helper..."
|
||||
$ESCALATION_TOOL ${PACKAGER} -S --needed --noconfirm base-devel
|
||||
cd /opt && $ESCALATION_TOOL git clone https://aur.archlinux.org/yay-git.git && $ESCALATION_TOOL chown -R ${USER}:${USER} ./yay-git
|
||||
cd yay-git && makepkg --noconfirm -si
|
||||
else
|
||||
echo "Aur helper already installed"
|
||||
fi
|
||||
if command_exists yay; then
|
||||
AUR_HELPER="yay"
|
||||
elif command_exists paru; then
|
||||
AUR_HELPER="paru"
|
||||
else
|
||||
echo "No AUR helper found. Please install yay or paru."
|
||||
exit 1
|
||||
fi
|
||||
checkAURHelper
|
||||
$AUR_HELPER -S --needed --noconfirm wine giflib lib32-giflib libpng lib32-libpng libldap lib32-libldap gnutls lib32-gnutls \
|
||||
mpg123 lib32-mpg123 openal lib32-openal v4l-utils lib32-v4l-utils libpulse lib32-libpulse libgpg-error \
|
||||
lib32-libgpg-error alsa-plugins lib32-alsa-plugins alsa-lib lib32-alsa-lib libjpeg-turbo lib32-libjpeg-turbo \
|
||||
|
|
|
@ -5,23 +5,8 @@
|
|||
fastUpdate() {
|
||||
case ${PACKAGER} in
|
||||
pacman)
|
||||
if ! command_exists yay && ! command_exists paru; then
|
||||
echo "Installing yay as AUR helper..."
|
||||
$ESCALATION_TOOL ${PACKAGER} -S --needed --noconfirm base-devel || { echo -e "${RED}Failed to install base-devel${RC}"; exit 1; }
|
||||
cd /opt && $ESCALATION_TOOL git clone https://aur.archlinux.org/yay-git.git && $ESCALATION_TOOL chown -R ${USER}:${USER} ./yay-git
|
||||
cd yay-git && makepkg --noconfirm -si || { echo -e "${RED}Failed to install yay${RC}"; exit 1; }
|
||||
else
|
||||
echo "Aur helper already installed"
|
||||
fi
|
||||
if command_exists yay; then
|
||||
AUR_HELPER="yay"
|
||||
elif command_exists paru; then
|
||||
AUR_HELPER="paru"
|
||||
else
|
||||
echo "No AUR helper found. Please install yay or paru."
|
||||
exit 1
|
||||
fi
|
||||
$AUR_HELPER -S --needed --noconfirm rate-mirrors-bin
|
||||
checkAURHelper
|
||||
$AUR_HELPER -S --needed --noconfirm rate-mirrors-bin
|
||||
if [ -s /etc/pacman.d/mirrorlist ]; then
|
||||
$ESCALATION_TOOL cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue
Block a user