mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 14:24:39 -07:00
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:
parent
31ecc85191
commit
3054022d2d
5 changed files with 16 additions and 6 deletions
3
debian/changelog
vendored
3
debian/changelog
vendored
|
@ -7,6 +7,9 @@ byobu (2.63) unreleased; urgency=low
|
||||||
use /var/run/screen as the socket directory, LP: #535378
|
use /var/run/screen as the socket directory, LP: #535378
|
||||||
* usr/bin/byobu-config: change a sample reference from "bash" to "shell"
|
* usr/bin/byobu-config: change a sample reference from "bash" to "shell"
|
||||||
again for portability, LP: #535407
|
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 ]
|
[ Torsten Spindler ]
|
||||||
* debian/postinst: handle situation where /var/run/screen does not
|
* debian/postinst: handle situation where /var/run/screen does not
|
||||||
|
|
|
@ -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"
|
ln -sf usr/share/$PKG/ec2/rates.us_ca "$DIR/.$PKG/ec2_rates"
|
||||||
|
|
||||||
# Some gardening; update paths to be $HOME-based
|
# 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")
|
bin=$(basename "$i")
|
||||||
sed -i "s:$bin:\$HOME/.$PKG$i:g" $(find $DIR -type f)
|
sed -i "s:$bin:\$HOME/.$PKG$i:g" $(find $DIR -type f)
|
||||||
done
|
done
|
||||||
|
|
|
@ -31,12 +31,14 @@ if ! echo $- | grep -qs i; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Establish gpg-agent socket, helps when reconnecting to a detached session
|
# 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
|
. "$i" || continue
|
||||||
export GPG_AGENT_INFO && break
|
export GPG_AGENT_INFO && break
|
||||||
done
|
done
|
||||||
|
|
||||||
# Reconnect dbus, source the most recently touched session-bus
|
# 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
|
for i in $(ls -t "$HOME/.dbus/session-bus/" 2>/dev/null); do
|
||||||
. "$HOME/.dbus/session-bus/$i" || continue
|
. "$HOME/.dbus/session-bus/$i" || continue
|
||||||
export DBUS_SESSION_BUS_ADDRESS && break
|
export DBUS_SESSION_BUS_ADDRESS && break
|
||||||
|
|
|
@ -67,7 +67,8 @@ case "$P" in
|
||||||
VER=`dpkg-query --show $PKG | awk '{print "-" $2 }'`
|
VER=`dpkg-query --show $PKG | awk '{print "-" $2 }'`
|
||||||
fi
|
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 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
|
[ "$i" = "menu" ] && continue
|
||||||
script=`find_script $i`
|
script=`find_script $i`
|
||||||
short=`$script --short | sed 's/^\s*//' | sed 's/\s*$//' | sed 's/.{[^}]*}//g'` || true
|
short=`$script --short | sed 's/^\s*//' | sed 's/\s*$//' | sed 's/.{[^}]*}//g'` || true
|
||||||
|
|
|
@ -22,10 +22,11 @@ PKG="byobu"
|
||||||
color 2>/dev/null || color() { true; }
|
color 2>/dev/null || color() { true; }
|
||||||
|
|
||||||
DIR="/proc/acpi/thermal_zone"
|
DIR="/proc/acpi/thermal_zone"
|
||||||
if [ "$1" = "--detail" ]; then
|
if [ "$1" = "--detail" ] && [ -d "$DIR" ]; then
|
||||||
for i in `ls $DIR 2>/dev/null`; do
|
for i in "$DIR"/*; do
|
||||||
|
[ -r "$i" ] || continue
|
||||||
echo "$i:"
|
echo "$i:"
|
||||||
cat "$DIR/$i"/*
|
cat "$i"/*
|
||||||
done
|
done
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue