From 8d8a21166b106bdb06a5b3e48724c9cd930a7e4b Mon Sep 17 00:00:00 2001 From: Riyyi Date: Mon, 28 Feb 2022 11:58:39 +0100 Subject: [PATCH] Manager: Suppress error output, fix Debian package list --- dotfiles.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dotfiles.sh b/dotfiles.sh index df1c7e2..1444888 100755 --- a/dotfiles.sh +++ b/dotfiles.sh @@ -272,7 +272,7 @@ osDependencies() getPackageList() { if [ "$os" = "arch" ]; then - filterList="$( (pacman -Qqg base base-devel; pactree -u base | tail -n +2) | sort)" + filterList="$( (pacman -Qqg base base-devel 2> /dev/null; pactree -u base | tail -n +2) | sort -u)" packageList="$(pacman -Qqe | grep -vx "$filterList" | sort)" elif [ "$os" = "debian" ]; then installedList="$(dpkg-query --show --showformat='${Package}\t${Priority}\n')" @@ -302,7 +302,7 @@ packageInstall() fi elif [ "$os" = "debian" ]; then # Grab everything off enabled official repositories that is in the list - repoList="$(apt-cache search .* | cut -d ' ' -f 1 | grep -xf $packageFile)" + repoList="$(apt-cache search . | cut -d ' ' -f 1 | grep -xf $packageFile)" # Install packages echo "$repoList" | xargs --open-tty sudo apt install @@ -319,6 +319,7 @@ packages() if [ "$1" = "list" ] || [ "$1" = "" ]; then [ -z "$packageList" ] && getPackageList + # FIXME: This only selects 1 target echo "$packageList" | grep "$2" elif [ "$1" = "store" ]; then [ -z "$packageList" ] && getPackageList @@ -335,8 +336,8 @@ packages() script="$(basename "$0")" parsed="$(getopt --options "hFPails" \ - --longoptions "help,file,package,add,aur-install,install,pull,push,store" \ - -n "$script" -- "$@" 2>&1)" + --longoptions "help,file,package,add,aur-install,install,pull,push,store" \ + -n "$script" -- "$@" 2>&1)" result="$?" # Exit if invalid option is provided