From 2ae1b202e4c91d320173ebbbec52cd36f0b9f8d5 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Mon, 31 Aug 2015 10:24:58 -0500 Subject: [PATCH] * experimental/byobu-classroom, usr/bin/byobu-ctrl-a.in, usr/bin/byobu- disable-prompt.in, usr/bin/byobu-janitor.in, usr/bin/byobu-launcher- uninstall.in, usr/bin/byobu-quiet.in, usr/bin/byobu-silent.in, usr/bin/byobu-status.in, usr/lib/byobu/include/constants, usr/share/byobu/keybindings/f-keys.screen: LP: #1068580 - create BYOBU_SED_INLINE variable, to handle inline sed's, using --follow-symlinks when possible (not always available) --- debian/changelog | 7 +++++++ experimental/byobu-classroom | 2 +- usr/bin/byobu-ctrl-a.in | 8 ++++---- usr/bin/byobu-disable-prompt.in | 2 +- usr/bin/byobu-janitor.in | 6 +++--- usr/bin/byobu-launcher-uninstall.in | 2 +- usr/bin/byobu-quiet.in | 2 +- usr/bin/byobu-silent.in | 2 +- usr/bin/byobu-status.in | 8 ++++---- usr/lib/byobu/include/constants | 2 +- usr/share/byobu/keybindings/f-keys.screen | 4 ++-- 11 files changed, 26 insertions(+), 19 deletions(-) diff --git a/debian/changelog b/debian/changelog index 20cca33e..e60a60b1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,13 @@ byobu (5.95) unreleased; urgency=medium - find the motd * usr/share/byobu/keybindings/f-keys.tmux.disable: LP: #1453037 - ensure that we source user's keybindings + * experimental/byobu-classroom, usr/bin/byobu-ctrl-a.in, usr/bin/byobu- + disable-prompt.in, usr/bin/byobu-janitor.in, usr/bin/byobu-launcher- + uninstall.in, usr/bin/byobu-quiet.in, usr/bin/byobu-silent.in, + usr/bin/byobu-status.in, usr/lib/byobu/include/constants, + usr/share/byobu/keybindings/f-keys.screen: LP: #1068580 + - create BYOBU_SED_INLINE variable, to handle inline sed's, using + --follow-symlinks when possible (not always available) [ Fortunato Ventre ] * usr/lib/byobu/include/constants: diff --git a/experimental/byobu-classroom b/experimental/byobu-classroom index 5367573b..a8dd403e 100755 --- a/experimental/byobu-classroom +++ b/experimental/byobu-classroom @@ -125,7 +125,7 @@ while [ $(grep -c "#byobu-classrom" /etc/ssh/sshd_config) != "4" ]; do c=$(head -n1) case "$c" in y|Y) - $BYOBU_SED -i -e '/#byobu-classroom/d' /etc/ssh/sshd_config || true + $BYOBU_SED_INLINE -e '/#byobu-classroom/d' /etc/ssh/sshd_config || true echo " PasswordAuthentication yes #byobu-classroom AllowTcpForwarding no #byobu-classroom diff --git a/usr/bin/byobu-ctrl-a.in b/usr/bin/byobu-ctrl-a.in index 0faeeb36..8807b69a 100755 --- a/usr/bin/byobu-ctrl-a.in +++ b/usr/bin/byobu-ctrl-a.in @@ -98,12 +98,12 @@ case "$bind_to" in emacs) case "$BYOBU_BACKEND" in screen) - $BYOBU_SED -i -e "/^register x /d" -e "/^bindkey /d" -e "/^escape /d" "$keybindings" + $BYOBU_SED_INLINE -e "/^register x /d" -e "/^bindkey /d" -e "/^escape /d" "$keybindings" echo "bindkey \"^${KEY}\"" >> "$keybindings" $BYOBU_BACKEND -X at 0 source "$BYOBU_CONFIG_DIR/profile" ;; tmux) - $BYOBU_SED -i -e "/^set -g prefix/d" -e "/ send-prefix/d" -e "/^unbind-key -n C-${key}/d" "$keybindings" + $BYOBU_SED_INLINE -e "/^set -g prefix/d" -e "/ send-prefix/d" -e "/^unbind-key -n C-${key}/d" "$keybindings" echo "set -g prefix F12" >> "$keybindings" echo "unbind-key -n C-${key}" >> "$keybindings" $BYOBU_BACKEND source "$BYOBU_PREFIX/share/byobu/profiles/tmuxrc" @@ -114,14 +114,14 @@ case "$bind_to" in screen) case "$BYOBU_BACKEND" in screen) - $BYOBU_SED -i -e "/^register x /d" -e "/^bindkey \"^\"/d" -e "/^escape /d" "$keybindings" + $BYOBU_SED_INLINE -e "/^register x /d" -e "/^bindkey \"^\"/d" -e "/^escape /d" "$keybindings" echo "bindkey \"^${KEY}\"" >> "$keybindings" echo "escape \"^${KEY}${key}\"" >> "$keybindings" echo "register x \"^${KEY}\"" >> "$keybindings" $BYOBU_BACKEND -X at 0 source "$BYOBU_CONFIG_DIR/profile" ;; tmux) - $BYOBU_SED -i -e "/^set -g prefix/d" -e "/ send-prefix/d" -e "/^unbind-key -n C-${key}/d" "$keybindings" + $BYOBU_SED_INLINE -e "/^set -g prefix/d" -e "/ send-prefix/d" -e "/^unbind-key -n C-${key}/d" "$keybindings" echo "unbind-key -n C-${key}" >> "$keybindings" if $BYOBU_BACKEND -V | grep " 1.5"; then # tmux 1.5 supports a list of prefixes diff --git a/usr/bin/byobu-disable-prompt.in b/usr/bin/byobu-disable-prompt.in index 951137a4..2748c9ce 100755 --- a/usr/bin/byobu-disable-prompt.in +++ b/usr/bin/byobu-disable-prompt.in @@ -22,7 +22,7 @@ PKG="byobu" [ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="@prefix@" || export BYOBU_PREFIX . "${BYOBU_PREFIX}/lib/${PKG}/include/common" -$BYOBU_SED -i -e "/#byobu-prompt#$/d" "$HOME/.bashrc" +$BYOBU_SED_INLINE -e "/#byobu-prompt#$/d" "$HOME/.bashrc" if [ "$1" != "--no-reload" ]; then if [ -n "$TMUX" ] && [ "$SHELL" = "/bin/bash" ]; then diff --git a/usr/bin/byobu-janitor.in b/usr/bin/byobu-janitor.in index b41c0c62..d998897d 100755 --- a/usr/bin/byobu-janitor.in +++ b/usr/bin/byobu-janitor.in @@ -84,7 +84,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 - $BYOBU_SED -i -e "s/#ec2_cost/ec2_cost/g" "$($BYOBU_READLINK -f $BYOBU_CONFIG_DIR/$f)" + $BYOBU_SED_INLINE -e "s/#ec2_cost/ec2_cost/g" "$($BYOBU_READLINK -f $BYOBU_CONFIG_DIR/$f)" fi fi done @@ -98,7 +98,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 - $BYOBU_SED -i -e "s/motd+shell/shell/g" "$($BYOBU_READLINK -f $BYOBU_CONFIG_DIR/windows)" || true + $BYOBU_SED_INLINE -e "s/motd+shell/shell/g" "$($BYOBU_READLINK -f $BYOBU_CONFIG_DIR/windows)" || true fi # Affects: Upgrades from <= byobu 4.3, remove ec2_rates @@ -106,7 +106,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 - $BYOBU_SED -i -e "s/ shell$/ $PKG-shell/g" "$($BYOBU_READLINK -f $BYOBU_CONFIG_DIR/windows)" || true + $BYOBU_SED_INLINE -e "s/ shell$/ $PKG-shell/g" "$($BYOBU_READLINK -f $BYOBU_CONFIG_DIR/windows)" || true fi # Affects: Upgrades from <= byobu 4.22 diff --git a/usr/bin/byobu-launcher-uninstall.in b/usr/bin/byobu-launcher-uninstall.in index 8fc9afc6..ee635acf 100755 --- a/usr/bin/byobu-launcher-uninstall.in +++ b/usr/bin/byobu-launcher-uninstall.in @@ -27,7 +27,7 @@ remove_launcher() { dest=$1 if [ -w "$dest" ]; then # keep any comments, and remove lines invoking byobu: - $BYOBU_SED -i -e '/^\s*#/n' -e "/\b$PKG-launch/d" -e "/\bscreen-launch/d" "$dest" + $BYOBU_SED_INLINE -e '/^\s*#/n' -e "/\b$PKG-launch/d" -e "/\bscreen-launch/d" "$dest" fi } diff --git a/usr/bin/byobu-quiet.in b/usr/bin/byobu-quiet.in index fd5b8b74..1d1dffe3 100755 --- a/usr/bin/byobu-quiet.in +++ b/usr/bin/byobu-quiet.in @@ -25,7 +25,7 @@ PKG="byobu" FLAG="$BYOBU_CONFIG_DIR/status.disable" # Clean up environment -$BYOBU_SED -i "/hardstatus/d" "$BYOBU_CONFIG_DIR/keybindings" || true +$BYOBU_SED_INLINE "/hardstatus/d" "$BYOBU_CONFIG_DIR/keybindings" || true if [ "$1" = "--undo" ]; then rm -f "$FLAG" else diff --git a/usr/bin/byobu-silent.in b/usr/bin/byobu-silent.in index 973e6c3b..bf5679d2 100755 --- a/usr/bin/byobu-silent.in +++ b/usr/bin/byobu-silent.in @@ -25,7 +25,7 @@ PKG="byobu" FLAG="$BYOBU_CONFIG_DIR/status.disable" # Clean up environment -$BYOBU_SED -i "/caption/d" "$BYOBU_CONFIG_DIR/keybindings" || true +$BYOBU_SED_INLINE "/caption/d" "$BYOBU_CONFIG_DIR/keybindings" || true if [ "$1" = "--undo" ]; then rm -f "$FLAG" else diff --git a/usr/bin/byobu-status.in b/usr/bin/byobu-status.in index 762d1d87..13006083 100755 --- a/usr/bin/byobu-status.in +++ b/usr/bin/byobu-status.in @@ -115,7 +115,7 @@ case "$1" in case "$i" in \#date) if [ -n "$BYOBU_DATE" ]; then - $BYOBU_SED -i -e "/BYOBU_DATE=/d" "$BYOBU_CONFIG_DIR/datetime.tmux" + $BYOBU_SED_INLINE -e "/BYOBU_DATE=/d" "$BYOBU_CONFIG_DIR/datetime.tmux" printf "%s\n" 'BYOBU_DATE=' >> "$BYOBU_CONFIG_DIR/datetime.tmux" touch "$BYOBU_RUN_DIR/reload-required" continue @@ -123,7 +123,7 @@ case "$1" in ;; \#time) if [ -n "$BYOBU_TIME" ]; then - $BYOBU_SED -i -e "/BYOBU_TIME=/d" "$BYOBU_CONFIG_DIR/datetime.tmux" + $BYOBU_SED_INLINE -e "/BYOBU_TIME=/d" "$BYOBU_CONFIG_DIR/datetime.tmux" printf "%s\n" 'BYOBU_TIME=' >> "$BYOBU_CONFIG_DIR/datetime.tmux" touch "$BYOBU_RUN_DIR/reload-required" continue @@ -131,7 +131,7 @@ case "$1" in ;; date) if [ -z "$BYOBU_DATE" ]; then - $BYOBU_SED -i -e "/BYOBU_DATE=/d" "$BYOBU_CONFIG_DIR/datetime.tmux" + $BYOBU_SED_INLINE -e "/BYOBU_DATE=/d" "$BYOBU_CONFIG_DIR/datetime.tmux" printf "%s\n" 'BYOBU_DATE="%Y-%m-%d "' >> "$BYOBU_CONFIG_DIR/datetime.tmux" touch "$BYOBU_RUN_DIR/reload-required" continue @@ -139,7 +139,7 @@ case "$1" in ;; time) if [ -z "$BYOBU_TIME" ]; then - $BYOBU_SED -i -e "/BYOBU_TIME=/d" "$BYOBU_CONFIG_DIR/datetime.tmux" + $BYOBU_SED_INLINE -e "/BYOBU_TIME=/d" "$BYOBU_CONFIG_DIR/datetime.tmux" printf "%s\n" 'BYOBU_TIME="%H:%M:%S"' >> "$BYOBU_CONFIG_DIR/datetime.tmux" touch "$BYOBU_RUN_DIR/reload-required" continue diff --git a/usr/lib/byobu/include/constants b/usr/lib/byobu/include/constants index 06e73b5b..48dbaa1e 100755 --- a/usr/lib/byobu/include/constants +++ b/usr/lib/byobu/include/constants @@ -49,7 +49,7 @@ $BYOBU_TEST greadlink >/dev/null 2>&1 && export BYOBU_READLINK="greadlink" || ex $BYOBU_TEST sensible-pager >/dev/null 2>&1 && export BYOBU_PAGER="sensible-pager" || export BYOBU_PAGER="less" # Check sed's follow-symlinks feature -$BYOBU_SED --follow-symlinks "s///" /dev/null 2>/dev/null && BYOBU_SED="$BYOBU_SED --follow-symlinks" || true +$BYOBU_SED --follow-symlinks "s///" /dev/null 2>/dev/null && BYOBU_SED_INLINE="$BYOBU_SED -i --follow-symlinks" || BYOBU_SED_INLINE="$BYOBU_SED -i" # Determine if we have ulimit support $BYOBU_TEST ulimit >/dev/null 2>&1 && export BYOBU_ULIMIT="ulimit" || export BYOBU_ULIMIT="false" diff --git a/usr/share/byobu/keybindings/f-keys.screen b/usr/share/byobu/keybindings/f-keys.screen index ab7f08e8..db5fa51e 100644 --- a/usr/share/byobu/keybindings/f-keys.screen +++ b/usr/share/byobu/keybindings/f-keys.screen @@ -74,7 +74,7 @@ bindkey "^[[19;5~" eval 'process x' 'process u' # Ctrl-F8 | Re-title a session # No ctrl-shift-F8 (save layout) in Screen bindkey -k k9 $BYOBU_BACKEND -t config 0 byobu-config # F9 | Configuration register s "[g G$>^h" # Goes with Shift-F7 and F12 ~ definition -bindkey "^[[18;2~" eval 'process x' 'process s' 'exec $BYOBU_SED -i -e "/./,/^$/!d" $BYOBU_RUN_DIR/printscreen' '$BYOBU_BACKEND -t PRINTSCREEN view $BYOBU_RUN_DIR/printscreen' # Shift-F7 | write the buffer to file, open in a new window +bindkey "^[[18;2~" eval 'process x' 'process s' 'exec $BYOBU_SED_INLINE -e "/./,/^$/!d" $BYOBU_RUN_DIR/printscreen' '$BYOBU_BACKEND -t PRINTSCREEN view $BYOBU_RUN_DIR/printscreen' # Shift-F7 | write the buffer to file, open in a new window # F10 | 'toolbar' in gnome-terminal # F11 | 'Full Screen' in gnome-terminal # No alt-F11 (break pane) in Screen @@ -84,7 +84,7 @@ bindkey -k F2 process x # F12 | Byobu's escape key bind $ $BYOBU_BACKEND -t status 0 byobu-status-detail # F12 $ | show detailed status bind @ $BYOBU_BACKEND -t config 0 byobu-config # F12 @ | Configuration bind R process r # F12 R | Reload profile -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 +bind ~ eval 'process x' 'process s' 'exec $BYOBU_SED_INLINE -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 register d ":source $BYOBU_PREFIX/share/byobu/keybindings/f-keys.screen.disable^M" bind ! eval 'process x' 'process d' 'backtick 111 9999999 9999999 byobu-status menu --disable-f-keys' # F12 ! | toggle on/off f-keys