You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

39 lines
1.4 KiB

--- a/usr/lib/byobu/updates_available
+++ b/usr/lib/byobu/updates_available
@@ -67,9 +67,16 @@ ___update_cache() {
elif eval $BYOBU_TEST pacman >/dev/null; then
# If pacman (Archlinux) exists, use it
LC_ALL=C flock -xn "$flock" pacman -Sup | grep -vc "^\(::\| \)" >$mycache 2>/dev/null &
+ elif eval $BYOBU_TEST opkg >/dev/null; then
+ # If opkg (OpenWrt) exists, use it, also background if flock exists
+ if eval $BYOBU_TEST flock >/dev/null; then
+ flock -xn "$flock" opkg list-upgradable | wc -l >$mycache 2>/dev/null &
+ else
+ opkg list-upgradable | wc -l >$mycache &
+ fi
elif eval $BYOBU_TEST brew >/dev/null; then
# If homebrew (Mac OSX) exists, use it, also background if flock exists
- if eval $BYOBU_TEST flock; then
+ if eval $BYOBU_TEST flock >/dev/null; then
flock -xn "$flock" brew outdated | wc -l >$mycache 2>/dev/null &
else
brew outdated | wc -l >$mycache &
@@ -106,6 +113,18 @@ ___update_needed() {
[ "$db" -nt "$mycache" ] && return 0
done
return 1
+ elif eval $BYOBU_TEST opkg >/dev/null; then
+ # OpenWrt
+ [ ! -e /var/lock/opkg.lock ] || return 1
+ if [ -d /var/opkg-lists ]; then
+ [ /var/opkg-lists -nt "$mycache" ]
+ return $?
+ else
+ local u s
+ read u s < "$mycache"
+ [ "$u" -gt 0 ]
+ return $?
+ fi
elif eval $BYOBU_TEST brew >/dev/null; then
# Mac OSX
# check if any new versions have been installed since