NNBnh/superb-bootstrap

[Suggestion] dont install flatpack or snap unless listed in packagesList

Closed this issue · 4 comments

[Suggestion] dont install flatpack or snap unless listed in packagesList
xfzv commented

I second this. I'm using Arch Linux and I commented out the following lines because I only install packages from official Arch repositories and from the AUR.

superb-bootstrap/setup

Lines 131 to 132 in 637614e

PACKAGEMANAGER_LIST="$PACKAGEMANAGER_LIST Flatpak"
[ "$PACKAGEMANAGER_MAIN" != 'XBPS' ] && PACKAGEMANAGER_LIST="$PACKAGEMANAGER_LIST Snap"

Maybe doing something like this?

if [[ "$PACKAGEMANAGER_MAIN"  = 'Pacman' ]]; then
    PACKAGEMANAGER_LIST="$PACKAGEMANAGER_LIST AUR"
        if [[ "grep 'FLA:' packageslist" ]]; then
            PACKAGEMANAGER_LIST="$PACKAGEMANAGER_LIST Flatpak"
        elif [[ "grep 'SNA:' packageslist" ]]; then
            PACKAGEMANAGER_LIST="$PACKAGEMANAGER_LIST Snap"
        fi
fi

if [[ "$PACKAGEMANAGER_MAIN" != 'XBPS'   ]]; then
    if [[ "grep 'SNA:' packageslist" ]]; then
        PACKAGEMANAGER_LIST="$PACKAGEMANAGER_LIST Snap"
    fi
fi

That's just an idea, I'm sure @NNBnh could come up with a much more elegant solution than mine.

NNBnh commented

Sorry for not document this better but this is already a feature of SBB, it loop through all the package manager that can be use on your system:

for packagemanager in $PACKAGEMANAGER_LIST; do

find all package with match mark:

packages_installing=$(printf '%s' "$packages_list" | sed -e "s/^.*$mark://g" -e 's/[[:space:]].*$//g' -e '/^$/d' | tr '\n' ' ')

if their is package with match mark, SBB will setup it package manager and install it's packages:

superb-bootstrap/setup

Lines 154 to 162 in 637614e

[ -n "$packages_installing" ] && {
packages_list=$(printf '%s' "$packages_list" | sed -e "s/^.*$mark.*\$//g")
printf '\n\033[1;7;35m%s\033[0m\n' "Setting up $packagemanager"
eval "superbbootstrap_$packagemanager"
printf '\n\033[1;7;32m%s\033[0m\n' "Installing $packagemanager Packages"
eval "$install_command $packages_installing"
}

it will also remove packages with match mark out of packages_list so those package don't get reinstall on another package manager later on:

packages_list=$(printf '%s' "$packages_list" | sed -e "s/^.*$mark.*\$//g")

Oh ok, I didn't realize this was the case, awesome!

NNBnh commented

This feature has been documented in SBB 1.5.5