ENH update package aggregator
This commit is contained in:
parent
18c26bad16
commit
334816ce47
|
@ -2,27 +2,19 @@
|
||||||
|
|
||||||
# Print list of packages to be installed via pacman
|
# Print list of packages to be installed via pacman
|
||||||
|
|
||||||
query='.[].success |
|
filter_type () {
|
||||||
objects |
|
# echo "$1" | jq --raw-output "select(.type==\"$2\") | .name" | sort | uniq
|
||||||
.root.tree |
|
echo "$1" | sed -n "/$2/p" | cut -f2
|
||||||
..|.left?.data, ..|.right?.data, .data? |
|
|
||||||
select(. != null) |
|
|
||||||
.fulfillment |
|
|
||||||
select(. != null) |
|
|
||||||
add | select(. != null)'
|
|
||||||
|
|
||||||
jq_type () {
|
|
||||||
echo "$1" | jq --raw-output "select(.type==\"$2\") | .name" | sort | uniq
|
|
||||||
}
|
}
|
||||||
|
|
||||||
raw=$(echo -e "$(xmonad --deps | jq "$query")\n$(xmobar --deps | jq "$query")")
|
raw=$(echo -e "$(xmonad --deps)\n$(xmobar --deps)")
|
||||||
|
|
||||||
# these are extra packages that pertain to processes outside xmonad but are
|
# these are extra packages that pertain to processes outside xmonad but are
|
||||||
# still required/desired to make it work correctly
|
# still required/desired to make it work correctly
|
||||||
xmonad_pkgs=(xorg-xinit xorg-server autorandr picom)
|
xmonad_pkgs=(xorg-xinit xorg-server autorandr picom)
|
||||||
|
|
||||||
mapfile -t official < <(jq_type "$raw" "Official")
|
mapfile -t official < <(filter_type "$raw" "Official")
|
||||||
mapfile -t local < <(jq_type "$raw" "AUR")
|
mapfile -t local < <(filter_type "$raw" "AUR")
|
||||||
|
|
||||||
if ! pacman -Si "${official[@]}" > /dev/null; then
|
if ! pacman -Si "${official[@]}" > /dev/null; then
|
||||||
echo "At least one official package doesn't exist."
|
echo "At least one official package doesn't exist."
|
||||||
|
|
Loading…
Reference in New Issue