Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

[Suggestion] Clone and install paru only if it's not already installed #4

Closed
xfzv opened this issue Mar 3, 2021 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@xfzv
Copy link

xfzv commented Mar 3, 2021

As I was testing the packages install feature, I noticed that this function was run although I already had paruAUR installed:

superb-bootstrap/setup

Lines 88 to 94 in 1e478bc

superbbootstrap_AUR() {
sudo pacman --sync --refresh --noconfirm --needed git base-devel
git clone 'https://aur.archlinux.org/paru.git' "$TEMPORARY/paru"
cd "$TEMPORARY/paru" || exit 1
makepkg -si
cd "$WD" || exit 1
}


[ "$packagemanager_main" = 'Pacman' ] && packagemanager_list="$packagemanager_list AUR"

What about using something like this instead, so that paruAUR is cloned and installed only if it's not already installed?

if [[ "$packagemanager_main"  = 'Pacman' ]]; then
    if ! command -v "paru" >/dev/null; then
        packagemanager_list="$packagemanager_list AUR"
    fi
        packagemanager_list="$packagemanager_list Flatpak"
fi
@NNBnh NNBnh added the enhancement New feature or request label Mar 3, 2021
@NNBnh
Copy link
Owner

NNBnh commented Mar 4, 2021

packagemanager_list isn't just to setup/install the package managers themself, it's also to install packages from that package manager. So we will change superbbootstrap_AUR() directly:

superbbootstrap_AUR() {
	if ! command -v 'paru' >/dev/null; then
		$PERMISSION_COMMAND pacman --sync --noconfirm --needed git base-devel
		git clone 'https://aur.archlinux.org/paru.git' "$TEMPORARY/paru"
		cd "$TEMPORARY/paru" || exit 1
		makepkg -si
		cd "$WD" || exit 1
	else
		printf '%s\n' "Paru has been installed"
	fi
}

This will be add to SBB 1.5.4

@NNBnh
Copy link
Owner

NNBnh commented Mar 5, 2021

This has been add to SBB 1.5.4

@NNBnh NNBnh closed this as completed Mar 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants