diff --git a/debian/changelog b/debian/changelog index c9f1aedb..2fb3071c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -88,6 +88,12 @@ byobu (4.18) unreleased; urgency=low * usr/bin/byobu-janitor, usr/bin/byobu-launcher-uninstall, usr/lib/byobu/.constants, usr/lib/byobu/disk_io: - move the MacOSX support to constants + * usr/bin/byobu-ctrl-a, usr/bin/byobu-janitor, 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/logo, + usr/lib/byobu/menu, usr/lib/byobu/network, + usr/lib/byobu/updates_available, usr/share/byobu/keybindings/f-keys: + - comprehensively use $SED for MacOSX compatibility, LP: #812973 [ James Spencer ] * usr/lib/byobu/.constants: diff --git a/usr/bin/byobu-ctrl-a b/usr/bin/byobu-ctrl-a index e454926a..8f423b22 100755 --- a/usr/bin/byobu-ctrl-a +++ b/usr/bin/byobu-ctrl-a @@ -42,13 +42,13 @@ while true; do echo case "$s" in 1) - sed -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings" + $SED -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings" echo 'bindkey "^A"' >> "$keybindings" echo "INFO: ctrl-a will now operate in emacs mode" break ;; 2) - sed -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings" + $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" diff --git a/usr/bin/byobu-janitor b/usr/bin/byobu-janitor index 464a3052..56fb5bed 100755 --- a/usr/bin/byobu-janitor +++ b/usr/bin/byobu-janitor @@ -100,7 +100,7 @@ if [ ! -r "$BYOBU_CONFIG_DIR/status" ]; then fi grep -A 999999 BEGIN_CUT_HERE $skel | grep -B 999999 END_CUT_HERE | grep -v CUT > "$BYOBU_CONFIG_DIR/status" # If it looks like we're running in ec2, enable ec2_cost by default - [ -x /usr/sbin/update-grub-legacy-ec2 ] && sed -i "s/ec2_cost=.*/ec2_cost=1/" "$BYOBU_CONFIG_DIR/status" + [ -x /usr/sbin/update-grub-legacy-ec2 ] && $SED -i "s/ec2_cost=.*/ec2_cost=1/" "$BYOBU_CONFIG_DIR/status" fi [ -r "$BYOBU_CONFIG_DIR/windows" ] || touch "$BYOBU_CONFIG_DIR/windows" [ -r "$HOME/.screenrc" ] || touch "$HOME/.screenrc" diff --git a/usr/bin/byobu-quiet b/usr/bin/byobu-quiet index 30d9f9b9..6e281711 100755 --- a/usr/bin/byobu-quiet +++ b/usr/bin/byobu-quiet @@ -24,7 +24,7 @@ PKG="byobu" FLAG="$BYOBU_CONFIG_DIR/status.disable" # Clean up environment -sed -i "/hardstatus/d" "$BYOBU_CONFIG_DIR/keybindings" || true +$SED -i "/hardstatus/d" "$BYOBU_CONFIG_DIR/keybindings" || true if [ "$1" = "--undo" ]; then rm -f "$FLAG" else diff --git a/usr/bin/byobu-silent b/usr/bin/byobu-silent index cbe652e5..60430596 100755 --- a/usr/bin/byobu-silent +++ b/usr/bin/byobu-silent @@ -24,7 +24,7 @@ PKG="byobu" FLAG="$BYOBU_CONFIG_DIR/status.disable" # Clean up environment -sed -i "/caption/d" "$BYOBU_CONFIG_DIR/keybindings" || true +$SED -i "/caption/d" "$BYOBU_CONFIG_DIR/keybindings" || true if [ "$1" = "--undo" ]; then rm -f "$FLAG" else diff --git a/usr/bin/byobu-status b/usr/bin/byobu-status index 923e01e4..91e85f9f 100755 --- a/usr/bin/byobu-status +++ b/usr/bin/byobu-status @@ -66,8 +66,8 @@ case "$P" in 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}" | $SED -e 's/^\s*//' -e 's/\s*$//' -e 's/.{[^}]*}//g') + detail=$(eval "__${i}_detail" 2>/dev/null | $SED -e '/^$/d' -e 's/^/\t/g') printf "%s\n\t(%s)\n" "$short" "$i" [ -n "$detail" ] && printf "%s\n" "$detail" done diff --git a/usr/lib/byobu/cpu_temp b/usr/lib/byobu/cpu_temp index 22618e13..5bc2748c 100755 --- a/usr/lib/byobu/cpu_temp +++ b/usr/lib/byobu/cpu_temp @@ -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=$($SED -e "s/^[^0-9]\+//" -e "s/\s.*$//" "$i") ;; esac if [ -n "$t" ] && [ "$t" -gt 0 ]; then diff --git a/usr/lib/byobu/custom b/usr/lib/byobu/custom index 6454cf08..77356af6 100755 --- a/usr/lib/byobu/custom +++ b/usr/lib/byobu/custom @@ -53,7 +53,7 @@ __custom() { ;; esac done - echo -n "$output" | sed ':a;N;$!ba;s/\n//g' + echo -n "$output" | $SED ':a;N;$!ba;s/\n//g' } # vi: syntax=sh ts=4 noexpandtab diff --git a/usr/lib/byobu/ec2_cost b/usr/lib/byobu/ec2_cost index 56bedae9..532642e7 100755 --- a/usr/lib/byobu/ec2_cost +++ b/usr/lib/byobu/ec2_cost @@ -37,7 +37,7 @@ __ec2_cost() { if metadata_available; then zone=$(wget -q -O - http://169.254.169.254/latest/meta-data/placement/availability-zone) . "$BYOBU_PREFIX/share/$PKG/ec2/rates.${zone%?}" - type=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-type | sed -e "s/\./_/g") + type=$(wget -q -O - http://169.254.169.254/latest/meta-data/instance-type | $SED -e "s/\./_/g") eval rate="\$$type" file_to_stat="$BYOBU_RUN_DIR/ec2_cost.instance_type" [ -f "$file_to_stat" ] || wget -q -O "$file_to_stat" http://169.254.169.254/latest/meta-data/instance-type diff --git a/usr/lib/byobu/logo b/usr/lib/byobu/logo index 206a5028..bdc0ed21 100755 --- a/usr/lib/byobu/logo +++ b/usr/lib/byobu/logo @@ -50,7 +50,7 @@ __logo() { return fi get_distro - local distro="$(echo "$_RET" | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')" + local distro="$(echo "$_RET" | $SED 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/')" case "$distro" in *ubuntu*) if $MARKUP; then diff --git a/usr/lib/byobu/menu b/usr/lib/byobu/menu index af8f4970..5cbf0f9b 100755 --- a/usr/lib/byobu/menu +++ b/usr/lib/byobu/menu @@ -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 | $SED "s/^.*\(.\)$/\1/"` [ -n "$esc" ] && key="^$esc-@" || key="^a-@" elif grep -qs "^source.*none$" $bindings 2>/dev/null; then key="byobu-config" diff --git a/usr/lib/byobu/network b/usr/lib/byobu/network index 92681585..2cd4f349 100755 --- a/usr/lib/byobu/network +++ b/usr/lib/byobu/network @@ -32,7 +32,7 @@ get_interface() { __network_detail() { get_interface; local interface="$_RET" - LC_ALL=C /sbin/ifconfig "$interface" | sed 's/\s*$//' + LC_ALL=C /sbin/ifconfig "$interface" | $SED 's/\s*$//' } __network() { diff --git a/usr/lib/byobu/updates_available b/usr/lib/byobu/updates_available index de8aa2a0..8cd41d2b 100755 --- a/usr/lib/byobu/updates_available +++ b/usr/lib/byobu/updates_available @@ -98,7 +98,7 @@ __updates_available_detail() { __updates_available() { local mycache="$BYOBU_RUN_DIR/updates-available" # If mycache is present, use it - [ -r $mycache ] && ___print_updates `sed -n '/[^0-9]/s/ .*$//p' $mycache` + [ -r $mycache ] && ___print_updates `$SED -n '/[^0-9]/s/ .*$//p' $mycache` # If we really need to do so (mycache doesn't exist, or the package database has changed), # background an update now ___update_needed "$mycache" && ___update_cache "$mycache" diff --git a/usr/share/byobu/keybindings/f-keys b/usr/share/byobu/keybindings/f-keys index da6d2ec8..8005995d 100644 --- a/usr/share/byobu/keybindings/f-keys +++ b/usr/share/byobu/keybindings/f-keys @@ -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 $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