bin/byobu-export, bin/byobu-reconnect-sockets, bin/byobu-status,

lib/byobu/cpu_temp: avoid programmatic use of ls in for loops,
LP: #452405
This commit is contained in:
Dustin Kirkland 2010-03-10 18:40:54 -06:00
commit 3054022d2d
5 changed files with 16 additions and 6 deletions

3
debian/changelog vendored
View file

@ -7,6 +7,9 @@ byobu (2.63) unreleased; urgency=low
use /var/run/screen as the socket directory, LP: #535378
* usr/bin/byobu-config: change a sample reference from "bash" to "shell"
again for portability, LP: #535407
* bin/byobu-export, bin/byobu-reconnect-sockets, bin/byobu-status,
lib/byobu/cpu_temp: avoid programmatic use of ls in for loops,
LP: #452405
[ Torsten Spindler ]
* debian/postinst: handle situation where /var/run/screen does not

View file

@ -94,7 +94,10 @@ ln -sf usr/share/$PKG/profiles/common "$DIR/.$PKG/profile"
ln -sf usr/share/$PKG/ec2/rates.us_ca "$DIR/.$PKG/ec2_rates"
# Some gardening; update paths to be $HOME-based
for i in $(ls /usr/bin/$PKG-* | grep -v "install"); do
for i in /usr/bin/$PKG-*; do
if echo "$i" | grep -qs "install"; then
continue
fi
bin=$(basename "$i")
sed -i "s:$bin:\$HOME/.$PKG$i:g" $(find $DIR -type f)
done

View file

@ -31,12 +31,14 @@ if ! echo $- | grep -qs i; then
fi
# Establish gpg-agent socket, helps when reconnecting to a detached session
for i in $(ls "$HOME/.gnupg/"gpg-agent-info-*); do
# Sorry, ls -t is needed here, to sort by time
for i in $(ls -t "$HOME/.gnupg/"gpg-agent-info-*); do
. "$i" || continue
export GPG_AGENT_INFO && break
done
# Reconnect dbus, source the most recently touched session-bus
# Sorry, ls -t is needed here, to sort by time
for i in $(ls -t "$HOME/.dbus/session-bus/" 2>/dev/null); do
. "$HOME/.dbus/session-bus/$i" || continue
export DBUS_SESSION_BUS_ADDRESS && break

View file

@ -67,7 +67,8 @@ case "$P" in
VER=`dpkg-query --show $PKG | awk '{print "-" $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"
for i in $(ls "/usr/lib/$PKG" "$HOME/.$PKG/bin" 2>/dev/null | grep -v "^/" | sort -u); do
for i in "/usr/lib/$PKG"/* "$HOME/.$PKG/bin"/*; do
i=$(echo "$i" | sed "s:^.*/::")
[ "$i" = "menu" ] && continue
script=`find_script $i`
short=`$script --short | sed 's/^\s*//' | sed 's/\s*$//' | sed 's/.{[^}]*}//g'` || true

View file

@ -22,10 +22,11 @@ PKG="byobu"
color 2>/dev/null || color() { true; }
DIR="/proc/acpi/thermal_zone"
if [ "$1" = "--detail" ]; then
for i in `ls $DIR 2>/dev/null`; do
if [ "$1" = "--detail" ] && [ -d "$DIR" ]; then
for i in "$DIR"/*; do
[ -r "$i" ] || continue
echo "$i:"
cat "$DIR/$i"/*
cat "$i"/*
done
exit 0
fi