NNBnh / superb-bootstrap

🅱️ OS dotfiles-manager framework that SuperB
GNU General Public License v3.0
112 stars 7 forks source link

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

Closed obyxcc closed 3 years ago

xfzv commented 3 years ago

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.

https://github.com/NNBnh/superb-bootstrap/blob/637614e246ac3742b817cc4e9d8b66d45f10a2c9/setup#L131-L132

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 3 years ago

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:

https://github.com/NNBnh/superb-bootstrap/blob/637614e246ac3742b817cc4e9d8b66d45f10a2c9/setup#L148

find all package with match mark:

https://github.com/NNBnh/superb-bootstrap/blob/637614e246ac3742b817cc4e9d8b66d45f10a2c9/setup#L152

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

https://github.com/NNBnh/superb-bootstrap/blob/637614e246ac3742b817cc4e9d8b66d45f10a2c9/setup#L154-L162

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:

https://github.com/NNBnh/superb-bootstrap/blob/637614e246ac3742b817cc4e9d8b66d45f10a2c9/setup#L155

obyxcc commented 3 years ago

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

NNBnh commented 3 years ago

This feature has been documented in SBB 1.5.5