* A set of fixes for LP: #700911

* usr/bin/byobu-status, usr/bin/byobu-status-detail:
  - improve support for byobu-status-detail on systems without vim
* usr/lib/byobu/mail: test for mail dir, avoids errors
* usr/lib/byobu/reboot_required: test for file existence, avoids errors
* usr/lib/byobu/wifi_quality: avoid potential divide by zero error
This commit is contained in:
Dustin Kirkland 2011-01-27 09:47:52 -06:00
commit f13a04c125
6 changed files with 30 additions and 13 deletions

11
debian/changelog vendored
View file

@ -1,10 +1,21 @@
byobu (3.26) unreleased; urgency=low
[ Dustin Kirkland ]
* usr/bin/byobu-reconnect-sockets, usr/lib/byobu/date,
usr/share/byobu/keybindings/f-keys,
usr/share/byobu/keybindings/screen-escape-keys:
- add a ctrl-f5 keybinding for reconnecting sockets
[ swalker <sdwalker@myrealbox.com> ]
* A set of fixes for LP: #700911
* usr/bin/byobu-status, usr/bin/byobu-status-detail:
- improve support for byobu-status-detail on systems without vim
* usr/lib/byobu/mail: test for mail dir, avoids errors
* usr/lib/byobu/reboot_required: test for file existence, avoids errors
[ Dustin Kirkland + swalker <sdwalker@myrealbox.com> ]
* usr/lib/byobu/wifi_quality: avoid potential divide by zero error
-- Dustin Kirkland <kirkland@ubuntu.com> Sun, 23 Jan 2011 16:28:45 -0600
byobu (3.25-0ubuntu1) natty; urgency=low

View file

@ -69,7 +69,10 @@ case "$P" in
if which dpkg-query >/dev/null; then
VER=$(set -- $(dpkg-query --show $PKG); echo "$2")
fi
printf "$PKG-$VER Detailed Status Navigation\n Expand all - zr\t\tCollapse all - zm\n Expand one - zo\t\tCollapse one - zc\n\n"
printf "$PKG-$VER Detailed Status Navigation\n"
if which vim >/dev/null && `vim --version | grep -q +folding`; then
printf " Expand all - zr\t\tCollapse all - zm\n Expand one - zo\t\tCollapse one - zc\n\n"
fi
for i in "$BYOBU_PREFIX/lib/$PKG"/* "$DATA/bin"/*; do
i=${i##*/}
[ "$i" = "menu" ] && continue

View file

@ -17,12 +17,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
case "$(vim --version)" in
*+folding*)
if which vim >/dev/null && `vim --version | grep -q +folding`; then
exec byobu-status --detail | vim -c "set foldmethod=indent" -c "set foldminlines=0" -c "set foldnestmax=1" -c "set foldcolumn=2" -R -
;;
*)
(which sensible-pager >/dev/null) && exec byobu-status --detail | sensible-pager
exec byobu-status --detail | less
;;
esac
else
(which sensible-pager >/dev/null) && PAGER=sensible-pager || PAGER=less
exec byobu-status --detail | $PAGER
fi

View file

@ -23,7 +23,7 @@ color 2>/dev/null || color() { true; }
mailfile="/var/spool/mail/$USER"
if [ "$1" = "--detail" ]; then
ls -alF "$mailfile" 2>&1
[ -s "$mailfile" ] && ls -alF "$mailfile" 2>&1
exit 0
fi

View file

@ -26,7 +26,8 @@ reboot="/var/run/reboot-required"
reload="$DIR/$PKG.reload-required"
case "$1" in
--detail)
ls -alF "$reboot" "$reload" 2>&1
[ -e "$reboot" ] && ls -alF "$reboot" 2>&1
[ -e "$reload" ] && ls -alF "$reload" 2>&1
;;
--short)
[ -e "$reboot" ] && printf "Yes" || printf "No"

View file

@ -27,6 +27,11 @@ fi
iwconfig=`/sbin/iwconfig 2>/dev/null`
bitrate=`echo "$iwconfig" | grep "Bit Rate." | sed -e "s/^.*Bit Rate.//" -e "s/ .*$//g"`
[ -z "$bitrate" ] && exit 0
quality=`echo "$iwconfig" | grep "Link Quality." | sed -e "s/^.*Link Quality.//" -e "s/ .*$//g" | awk -F/ '{printf "%.0f", 100*$1/$2}'`
[ -z "$bitrate" ] && bitrate="0"
quality=`echo "$iwconfig" | grep "Link Quality." | sed -e "s/^.*Link Quality.//" -e "s/ .*$//g"`
if [ -z "$quality" ] || [ "$quality" = "0" ]; then
quality="0"
else
quality=`echo "$quality" | awk -F/ '{printf "%.0f", 100*$1/$2}'`
fi
printf "$(color b C k)%s$(color -)$(color C k)%s,$(color -)$(color b C k)%s$(color -)$(color C k)%%$(color -) " "$bitrate" "Mbps" "$quality"