added support for dnf package manager

https://code.launchpad.net/~sanjay-ankur/byobu/byobu/+merge/415959
This commit is contained in:
Dustin Kirkland 2024-02-10 11:04:14 -06:00
commit fc1b4580a8
2 changed files with 10 additions and 1 deletions

View file

@ -85,6 +85,9 @@ ___update_cache() {
# Wolfi updates are cheap (~1s); so update cache every time
apk update 2>&1 >/dev/null
apk upgrade --simulate | grep -c " Upgrading " >$mycache 2>/dev/null &
elif eval $BYOBU_TEST dnf >/dev/null; then
# If dnf exists, use it
flock -xn "$flock" dnf list --upgrades -q -y | grep -vc "Available Upgrades" >$mycache 2>/dev/null &
fi
}
@ -141,6 +144,9 @@ ___update_needed() {
# formulae database was updated
[ "$(brew --prefix)/Library/Formula" -nt "$mycache" ]
return $?
elif [ -e "/var/cache/dnf/packages.db" ]; then
[ "/var/cache/dnf/packages.db" -nt "$mycache" ]
return $?
fi
return 1
}