From e6c3593588727be81525b7434ca3355ea09423cb Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Thu, 14 Apr 2011 16:16:04 -0500 Subject: [PATCH] usr/bin/byobu-launch, usr/bin/byobu-launcher-install: fix handling of logout behavior, when dpkg-configured globally by the sysadmin, LP: #741281 --- debian/changelog | 3 +++ usr/bin/byobu-launch | 5 ++++- usr/bin/byobu-launcher-install | 12 ++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b3e4df60..7de85976 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,9 @@ byobu (3.30) unreleased; urgency=low LP: #760696 * usr/bin/byobu-launcher: don't disrupt work flow, but rather inform user about launching byobu in a nested screen session, LP: #747649 + * usr/bin/byobu-launch, usr/bin/byobu-launcher-install: fix handling + of logout behavior, when dpkg-configured globally by the sysadmin, + LP: #741281 [ Chaskiel Grundman ] * debian/postinst: correctly fix old-school screen-profiles era diversions diff --git a/usr/bin/byobu-launch b/usr/bin/byobu-launch index 24fc967c..e5b51bc2 100755 --- a/usr/bin/byobu-launch +++ b/usr/bin/byobu-launch @@ -17,4 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -case "$-" in *i*) byobu-launcher && exit 0; esac; +PKG="byobu" +DATA="$HOME/.$PKG" +case "$-" in *i*) byobu-launcher; esac; +[ -e "$DATA/no-logout-on-detach" ] || exit 0 diff --git a/usr/bin/byobu-launcher-install b/usr/bin/byobu-launcher-install index 772402ec..f1093a77 100755 --- a/usr/bin/byobu-launcher-install +++ b/usr/bin/byobu-launcher-install @@ -20,6 +20,7 @@ PKG="byobu" DATA="$HOME/.$PKG" +FLAG="$DATA/no-logout-on-detach" LOGOUT_ON_DETACH=1 for i in $@; do @@ -30,6 +31,14 @@ for i in $@; do esac done +update_flag() { + if [ "$LOGOUT_ON_DETACH" = "1" ]; then + rm -f "$FLAG" + else + touch "$FLAG" + fi +} + install_launcher() { if [ "$LOGOUT_ON_DETACH" = "1" ]; then printf "%s\n" 'case "$-" in *i*) byobu-launcher && exit 0; esac;' >> "$1" @@ -44,6 +53,9 @@ $PKG-launcher-uninstall || true touch "$HOME"/.hushlogin rm -f "$DATA/disable-autolaunch" +# Update the logout/nologout flag +update_flag + # Handle bourne shells, if not set globally in /etc/profile.d if [ ! -h "/etc/profile.d/Z98-$PKG.sh" ]; then # Install in $HOME/.profile unconditionally