* experimental/byobu-classroom, usr/bin/byobu-config, usr/bin/byobu-

ctrl-a, usr/bin/byobu-janitor, usr/bin/byobu-launcher-uninstall,
  usr/bin/byobu-quiet, usr/bin/byobu-silent, usr/bin/byobu-status,
  usr/lib/byobu/cpu_temp, usr/lib/byobu/custom,
  usr/lib/byobu/ec2_cost, usr/lib/byobu/include/constants,
  usr/lib/byobu/logo, usr/lib/byobu/menu, usr/lib/byobu/network,
  usr/share/byobu/keybindings/f-keys: LP: #920661
  - byobu should not set environment variable 'SED'
  - use BYOBU_SED instead
This commit is contained in:
Dustin Kirkland 2012-01-28 12:45:36 -06:00
commit 70be047156
17 changed files with 38 additions and 29 deletions

9
debian/changelog vendored
View file

@ -13,6 +13,15 @@ byobu (5.6) unreleased; urgency=low
- easy to change with F8
- need to save characters in default tmux launch to get it to fit
in 80x24 terminals
* experimental/byobu-classroom, usr/bin/byobu-config, usr/bin/byobu-
ctrl-a, usr/bin/byobu-janitor, usr/bin/byobu-launcher-uninstall,
usr/bin/byobu-quiet, usr/bin/byobu-silent, usr/bin/byobu-status,
usr/lib/byobu/cpu_temp, usr/lib/byobu/custom,
usr/lib/byobu/ec2_cost, usr/lib/byobu/include/constants,
usr/lib/byobu/logo, usr/lib/byobu/menu, usr/lib/byobu/network,
usr/share/byobu/keybindings/f-keys: LP: #920661
- byobu should not set environment variable 'SED'
- use BYOBU_SED instead
[ Ryan Thompson ]
* usr/bin/byobu-select-session: LP: #919391

View file

@ -125,7 +125,7 @@ while [ $(grep -c "#byobu-classrom" /etc/ssh/sshd_config) != "4" ]; do
c=$(head -n1)
case "$c" in
y|Y)
$SED -i -e '/#byobu-classroom/d' /etc/ssh/sshd_config || true
$BYOBU_SED -i -e '/#byobu-classroom/d' /etc/ssh/sshd_config || true
echo "
PasswordAuthentication yes #byobu-classroom
AllowTcpForwarding no #byobu-classroom

View file

@ -47,9 +47,9 @@ ESC = ''
snack.hotkeys[ESC] = ord(ESC)
snack.hotkeys[ord(ESC)] = ESC
if commands.getstatusoutput('which gsed')[0] == 0:
SED = "gsed"
BYOBU_SED = "gsed"
else:
SED = "sed"
BYOBU_SED = "sed"
gettext.bindtextdomain(PKG, SHARE+'/po')
gettext.textdomain(PKG)
_ = gettext.gettext
@ -121,7 +121,7 @@ def help(snackScreen, size, config):
text=f.read()
f.close()
text=text.replace("<esckey>", getesckey(), 1)
text=text.replace("_VER_", commands.getoutput("byobu -v | head -n1 | " + SED + " 's/.* //'"), 1)
text=text.replace("_VER_", commands.getoutput("byobu -v | head -n1 | " + BYOBU_SED + " 's/.* //'"), 1)
t = Textbox(67, 16, text, scroll=1, wrap=1)
bb = ButtonBar(snackScreen, ((_("Menu"), "menu", ESC),), compact = 1)
g = GridForm(snackScreen, _("Byobu Help"), 2, 4)
@ -177,16 +177,16 @@ def writestatus(items):
path = BYOBU_CONFIG_DIR+'/status'
for i in items:
status[i[1]] = i[0]
# SED is hacky here, but effective
# BYOBU_SED is hacky here, but effective
if BYOBU_BACKEND == "tmux":
for key in ["tmux_left", "tmux_right"]:
val = genstatusstring(key, status)
commands.getoutput("%s -i -e '/^%s=/d' %s" % (SED, key, path))
commands.getoutput("%s -i -e '/^%s=/d' %s" % (BYOBU_SED, key, path))
commands.getoutput("echo '%s=\"%s\"' >> %s" % (key, val, path))
else:
for key in ["screen_upper_left", "screen_upper_right", "screen_lower_left", "screen_lower_right"]:
val = genstatusstring(key, status)
commands.getoutput("%s -i -e '/^%s=/d' %s" % (SED, key, path))
commands.getoutput("%s -i -e '/^%s=/d' %s" % (BYOBU_SED, key, path))
commands.getoutput("echo '%s=\"%s\"' >> %s" % (key, val, path))
def togglestatus(snackScreen, size):
@ -257,13 +257,13 @@ def setesckey(key):
u = key[0].upper()
l = key[0].lower()
if os.path.exists(path):
out = commands.getoutput(SED+" -i -e 's/^escape.*$//' "+path)
out = commands.getoutput(BYOBU_SED+" -i -e 's/^escape.*$//' "+path)
appendtofile(path, "escape ^"+u+l+"\n")
out = commands.getoutput(SED+" -i -e 's/^register.*$//' "+path)
out = commands.getoutput(BYOBU_SED+" -i -e 's/^register.*$//' "+path)
out = commands.getoutput("grep -sh '^register x' "+SHARE+"/keybindings/*keys")
appendtofile(path, out+"\n")
out = commands.getoutput(SED+" -i -e 's/\"^^/\"\^"+l+"/g' "+path)
out = commands.getoutput(SED+" -i -e '/^$/d' "+path)
out = commands.getoutput(BYOBU_SED+" -i -e 's/\"^^/\"\^"+l+"/g' "+path)
out = commands.getoutput(BYOBU_SED+" -i -e '/^$/d' "+path)
def chgesc(snackScreen, size):
esc=Entry(2, text=getesckey(), returnExit=1)

View file

@ -70,13 +70,13 @@ done
case "$bind_to" in
emacs)
$SED -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape escape \^Aa/d" "$keybindings"
$BYOBU_SED -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape escape \^Aa/d" "$keybindings"
echo 'bindkey "^A"' >> "$keybindings"
echo "INFO: ctrl-a will now operate in emacs mode"
echo > "$keybindings.tmux"
;;
screen)
$SED -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings"
$BYOBU_SED -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings"
echo 'escape "^Aa"' >> "$keybindings"
echo 'register x "^A"' >> "$keybindings"
echo 'bindkey "^A"' >> "$keybindings"

View file

@ -77,7 +77,7 @@ for f in status statusrc; do
cp -f "$BYOBU_PREFIX/share/$PKG/status/$f" "$BYOBU_CONFIG_DIR/$f"
# Enable ec2_cost, if we're in ec2 and seeding a new setup
if metadata_available; then
$SED -i -e "s/#ec2_cost/ec2_cost/g" "$($READLINK -f $BYOBU_CONFIG_DIR/$f)"
$BYOBU_SED -i -e "s/#ec2_cost/ec2_cost/g" "$($READLINK -f $BYOBU_CONFIG_DIR/$f)"
fi
fi
done
@ -91,7 +91,7 @@ fi
# Affects: Upgrades from <= byobu-2.78 which might have "motd+shell"
# in their window list; update this to just "shell"
if grep -qs "motd+shell" "$BYOBU_CONFIG_DIR/windows"; then
$SED -i -e "s/motd+shell/shell/g" "$($READLINK -f $BYOBU_CONFIG_DIR/windows)" || true
$BYOBU_SED -i -e "s/motd+shell/shell/g" "$($READLINK -f $BYOBU_CONFIG_DIR/windows)" || true
fi
# Affects: Upgrades from <= byobu 4.3, remove ec2_rates
@ -99,7 +99,7 @@ rm -f "$BYOBU_CONFIG_DIR/ec2_rates"
# Affects: Upgrades from <= byobu 4.4, update "shell" -> "byobu-shell"
if grep -qs " shell$" "$BYOBU_CONFIG_DIR/windows"; then
$SED -i -e "s/ shell$/ $PKG-shell/g" "$($READLINK -f $BYOBU_CONFIG_DIR/windows)" || true
$BYOBU_SED -i -e "s/ shell$/ $PKG-shell/g" "$($READLINK -f $BYOBU_CONFIG_DIR/windows)" || true
fi
# Affects: Upgrades from <= byobu 4.22

View file

@ -27,7 +27,7 @@ remove_launcher() {
dest=$1
if [ -w "$dest" ]; then
# keep any comments, and remove lines invoking byobu:
$SED -i -e '/^\s*#/n' -e "/\b$PKG-launch\$/d" -e "/ screen-launch/d" "$dest"
$BYOBU_SED -i -e '/^\s*#/n' -e "/\b$PKG-launch\$/d" -e "/ screen-launch/d" "$dest"
fi
}

View file

@ -25,7 +25,7 @@ PKG="byobu"
FLAG="$BYOBU_CONFIG_DIR/status.disable"
# Clean up environment
$SED -i "/hardstatus/d" "$BYOBU_CONFIG_DIR/keybindings" || true
$BYOBU_SED -i "/hardstatus/d" "$BYOBU_CONFIG_DIR/keybindings" || true
if [ "$1" = "--undo" ]; then
rm -f "$FLAG"
else

View file

@ -25,7 +25,7 @@ PKG="byobu"
FLAG="$BYOBU_CONFIG_DIR/status.disable"
# Clean up environment
$SED -i "/caption/d" "$BYOBU_CONFIG_DIR/keybindings" || true
$BYOBU_SED -i "/caption/d" "$BYOBU_CONFIG_DIR/keybindings" || true
if [ "$1" = "--undo" ]; then
rm -f "$FLAG"
else

View file

@ -100,8 +100,8 @@ case "$1" in
include|menu|notify_osd|time_binary) continue ;;
esac
find_script "$i" && . "${_RET}"
short=$(eval "__${i}" | $SED -e 's/^\s*//' -e 's/\s*$//' -e 's/.{[^}]*}//g')
detail=$(eval "__${i}_detail" 2>/dev/null | $SED -e '/^$/d' -e 's/^/\t/g')
short=$(eval "__${i}" | $BYOBU_SED -e 's/^\s*//' -e 's/\s*$//' -e 's/.{[^}]*}//g')
detail=$(eval "__${i}_detail" 2>/dev/null | $BYOBU_SED -e '/^$/d' -e 's/^/\t/g')
printf "%s\n\t(%s)\n" "$short" "$i"
[ -n "$detail" ] && printf "%s\n" "$detail"
done

View file

@ -36,7 +36,7 @@ __cpu_temp() {
[ -s "$i" ] && read t < "$i" && t=$(($t/1000))
;;
*)
[ -s "$i" ] && t=$($SED -e "s/^[^0-9]\+//" -e "s/\s.*$//" "$i")
[ -s "$i" ] && t=$($BYOBU_SED -e "s/^[^0-9]\+//" -e "s/\s.*$//" "$i")
;;
esac
if [ -n "$t" ] && [ "$t" -gt 0 ]; then

View file

@ -53,7 +53,7 @@ __custom() {
;;
esac
done
printf "$output" | $SED ':a;N;$!ba;s/\n//g'
printf "$output" | $BYOBU_SED ':a;N;$!ba;s/\n//g'
}
# vi: syntax=sh ts=4 noexpandtab

View file

@ -42,7 +42,7 @@ __ec2_cost() {
. "$BYOBU_PREFIX/share/$PKG/ec2/rates.${zone%?}"
[ -s "$cache.type" ] || wget -q -O "$cache.type" http://169.254.169.254/latest/meta-data/instance-type 2>/dev/null &
sleep 0.02
[ -s "$cache.type" ] && type=$($SED -e "s/\./_/g" "$cache.type")
[ -s "$cache.type" ] && type=$($BYOBU_SED -e "s/\./_/g" "$cache.type")
eval rate="\$$type"
file_to_stat="$cache.type"
fi

View file

@ -94,7 +94,7 @@ case "$BYOBU_BACKEND" in
esac
# MacOS Support
command -v gsed >/dev/null 2>&1 && export SED="gsed" || export SED="sed"
command -v gsed >/dev/null 2>&1 && export BYOBU_SED="gsed" || export BYOBU_SED="sed"
command -v greadlink >/dev/null 2>&1 && export READLINK="greadlink" || export READLINK="readlink"
command -v sensible-pager >/dev/null 2>&1 && export BYOBU_PAGER="sensible-pager" || export BYOBU_PAGER="less"

View file

@ -50,7 +50,7 @@ __logo() {
return
fi
get_distro
local distro="$(echo "$_RET" | $SED 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')"
local distro="$(echo "$_RET" | $BYOBU_SED 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')"
case "$distro" in
*ubuntu*)
if $MARKUP; then

View file

@ -27,7 +27,7 @@ __menu() {
local bindings esc key text
[ -r "$BYOBU_CONFIG_DIR/keybindings" ] && bindings="$BYOBU_CONFIG_DIR/keybindings" || bindings="$HOME/.screenrc"
if grep -qs "^source.*screen-escape-keys$" $bindings 2>/dev/null || [ "$1" = "--disable-f-keys" ]; then
esc=`grep "^escape" $bindings | $SED "s/.*^\(.\).*/\1/"`
esc=`grep "^escape" $bindings | $BYOBU_SED "s/.*^\(.\).*/\1/"`
[ -n "$esc" ] && key="^$esc-@" || key="^a-@"
elif grep -qs "^source.*none$" $bindings 2>/dev/null; then
key="byobu-config"

View file

@ -21,7 +21,7 @@
__network_detail() {
get_network_interface; local interface="$_RET"
LC_ALL=C /sbin/ifconfig "$interface" | $SED 's/\s*$//'
LC_ALL=C /sbin/ifconfig "$interface" | $BYOBU_SED 's/\s*$//'
}
__network() {

View file

@ -44,7 +44,7 @@ bind $ $BYOBU_BACKEND -t status 0 byobu-status-detail # F12 $ | show detailed st
bind @ $BYOBU_BACKEND -t config 0 byobu-config # F12 @ | Configuration
bind R process r # F12 R | Reload profile
register s "[g G$>^h" # Goes with F12 ~ definition
bind ~ eval 'process x' 'process s' 'exec $SED -i -e "/./,/^$/!d" $BYOBU_RUN_DIR/printscreen' '$BYOBU_BACKEND -t PRINTSCREEN view $BYOBU_RUN_DIR/printscreen' # F12 ~ | write the buffer to file, open in a new window
bind ~ eval 'process x' 'process s' 'exec $BYOBU_SED -i -e "/./,/^$/!d" $BYOBU_RUN_DIR/printscreen' '$BYOBU_BACKEND -t PRINTSCREEN view $BYOBU_RUN_DIR/printscreen' # F12 ~ | write the buffer to file, open in a new window
# Hotkeys for splits (gnome-terminal)
bindkey "^[O1;2Q" eval 'split' 'focus down' 'next' 'focus up' 'layout save byobu' 'layout autosave' # shift-F2 | horizontal split