diff --git a/symlinks/bin/clone-installation-from-directory b/symlinks/bin/clone-installation-from-directory index fd306c3..8bb7955 100755 --- a/symlinks/bin/clone-installation-from-directory +++ b/symlinks/bin/clone-installation-from-directory @@ -2,7 +2,9 @@ SELECTED_INSTALL_DIR=$1 -if type pacman > /dev/null 2>&1 +. ~/.local/opt/script_utils/parse-package-managers-params.bash + +if [ "${RUN[pacman]}" = "1" ] then # Install arch packages echo "Installing Arch packages..." @@ -14,25 +16,31 @@ then done <$SELECTED_INSTALL_DIR/AUR fi -if type apt > /dev/null 2>&1 +if [ "${RUN[apt]}" = "1" ] then echo "Installing apt packages..." sudo xargs -a $SELECTED_INSTALL_DIR/apt apt install fi -if type brew > /dev/null 2>&1 +if [ "${RUN[dnf]}" = "1" ] +then + echo "Installing dnf packages..." + sudo xargs -a $SELECTED_INSTALL_DIR/dnf dnf install +fi + +if [ "${RUN[brew]}" = "1" ] then echo "Installing brew packages..." brew bundle --file $SELECTED_INSTALL_DIR/Brewfile fi -if type flatpak > /dev/null 2>&1 +if [ "${RUN[flatpak]}" = "1" ] then echo "Installing flatpak packages..." xargs -a $SELECTED_INSTALL_DIR/flatpak flatpak install fi -if type gem > /dev/null 2>&1 +if [ "${RUN[gem]}" = "1" ] then echo "Installing gems..." while read gem; do @@ -40,13 +48,13 @@ then done <$( cat $SELECTED_INSTALL_DIR/gem | awk '{print $1}') fi -if type pip2 > /dev/null 2>&1 +if [ "${RUN[pip2]}" = "1" ] then echo "Installing python2 packages..." pip2 install -r $SELECTED_INSTALL_DIR/pip2 fi -if type pip3 > /dev/null 2>&1 +if [ "${RUN[pip3]}" = "1" ] then echo "Installing python3 packages..." pip3 install -r $SELECTED_INSTALL_DIR/pip3 diff --git a/symlinks/bin/get-package-manager-install-command b/symlinks/bin/get-package-manager-install-command index 1f859fe..7238f55 100755 --- a/symlinks/bin/get-package-manager-install-command +++ b/symlinks/bin/get-package-manager-install-command @@ -5,4 +5,6 @@ if [ "$PACKAGE_MANAGER" = "pacman" ]; then echo "sudo pacman -S" elif [ "$PACKAGE_MANAGER" = "apt" ]; then echo "sudo apt install" +elif [ "$PACKAGE_MANAGER" = "dnf" ]; then + echo "sudo dnf install" fi diff --git a/symlinks/bin/get-package-manager-name b/symlinks/bin/get-package-manager-name index ec9789e..1fdad30 100755 --- a/symlinks/bin/get-package-manager-name +++ b/symlinks/bin/get-package-manager-name @@ -9,5 +9,9 @@ if type pacman > /dev/null 2>&1 then PACKAGE_MANAGER="pacman" fi +if type dnf > /dev/null 2>&1 +then + PACKAGE_MANAGER="dnf" +fi echo $PACKAGE_MANAGER diff --git a/symlinks/bin/migrate-installation b/symlinks/bin/migrate-installation index f837722..ad8e519 100755 --- a/symlinks/bin/migrate-installation +++ b/symlinks/bin/migrate-installation @@ -27,6 +27,11 @@ then sudo dpkg-query -f '${binary:Package}\n' -W > $PACKAGES_DIRECTORY/apt fi +if type dnf > /dev/null 2>&1 +then + dnf repoquery --userinstalled > $PACKAGES_DIRECTORY/dnf +fi + if type flatpak > /dev/null 2>&1 then flatpak list | cut -f2 > $PACKAGES_DIRECTORY/flatpak diff --git a/symlinks/bin/update-all-packages b/symlinks/bin/update-all-packages index fbc896b..2fd864e 100755 --- a/symlinks/bin/update-all-packages +++ b/symlinks/bin/update-all-packages @@ -3,53 +3,8 @@ set -e UNAME=$(sh -c 'uname 2>/dev/null || echo Unknown') -declare -A SKIP=() -POSITIONAL=() -while [[ $# -gt 0 ]]; do - key="$1" - - case $key in - -s|--skip) - shift # past argument - SKIP["$1"]=1 - shift # past value - ;; - *) # unknown option - POSITIONAL+=("$1") # save it in an array for later - shift # past argument - ;; - esac -done - -declare -A RUN=() - -for command in "pacman" "apt" "dnf" "flatpak" "gem" "nvim" "asdf" "brew" "pacman"; -do - echo $command - if type $command > /dev/null 2>&1 - then - if [ "${SKIP[$command]}" = "1" ]; then - RUN[$command]=0 - else - RUN[$command]=1 - fi - else - RUN[$command]=0 - fi -done - -# Special case for vim -if type -f vim > /dev/null 2>&1 -then - if [ "${SKIP[vim]}" = "1" ]; then - RUN[vim]=0 - else - RUN[vim]=1 - fi -else - RUN[vim]=0 -fi +. ~/.local/opt/script_utils/parse-package-managers-params.bash if [ "${RUN[pacman]}" = "1" ] then