From the website: Byobu is a GPLv3 open source text-based window manager and terminal multiplexer. It was originally designed to provide elegant enhancements to the otherwise functional, plain, practical GNU Screen, for the Ubuntu server distribution. Byobu now includes an enhanced profiles, convenient keybindings, configuration utilities, and toggle-able system status notifications for both the GNU Screen window manager and the more modern Tmux terminal multiplexer, and works on most Linux, BSD, and Mac distributions. Adapted from the old packages feed: https://git.openwrt.org/?p=openwrt/svn-archive/packages.git;a=tree;f=utils/byobu Signed-off-by: Jeffery To <jeffery.to@gmail.com>
39 lines
1.4 KiB
Diff
39 lines
1.4 KiB
Diff
--- 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
|