From 10029df520277a23e86fa8540eb0be8c96db69ae Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sat, 14 Nov 2015 16:57:11 -0600 Subject: [PATCH] * configure.ac, debian/install, debian/postinst, debian/postrm, etc/profile.d/Makefile.am, usr/share/byobu/profiles/Makefile.am, usr/share/byobu/profiles/Z97-byobu.sh.in => etc/profile.d/Z97- byobu.sh.in: - fix some recent regressions on byobu auto launching --- configure.ac | 2 +- debian/changelog | 5 ++++ debian/install | 1 + debian/postinst | 4 +-- debian/postrm | 4 --- etc/profile.d/Makefile.am | 1 + .../profile.d}/Z97-byobu.sh.in | 27 ++++++++++++------- usr/share/byobu/profiles/Makefile.am | 2 +- 8 files changed, 28 insertions(+), 18 deletions(-) rename {usr/share/byobu/profiles => etc/profile.d}/Z97-byobu.sh.in (67%) diff --git a/configure.ac b/configure.ac index d4a3db65..1b45e184 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,7 @@ AC_PROG_LN_S AC_OUTPUT(Makefile \ etc/byobu/Makefile \ etc/profile.d/Makefile \ - usr/share/byobu/profiles/Z97-byobu.sh \ + etc/profile.d/Z97-byobu.sh \ usr/share/applications/Makefile \ usr/bin/byobu \ usr/bin/byobu-config \ diff --git a/debian/changelog b/debian/changelog index 2d39285e..72c956b4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,11 @@ byobu (5.99) unreleased; urgency=medium * usr/share/byobu/pixmaps/byobu.svg: - cleaned up vector image from Nobuto Murata + * configure.ac, debian/install, debian/postinst, debian/postrm, + etc/profile.d/Makefile.am, usr/share/byobu/profiles/Makefile.am, + usr/share/byobu/profiles/Z97-byobu.sh.in => etc/profile.d/Z97- + byobu.sh.in: + - fix some recent regressions on byobu auto launching -- Dustin Kirkland Wed, 28 Oct 2015 09:48:49 +0900 diff --git a/debian/install b/debian/install index 0d85cab8..e5223958 100644 --- a/debian/install +++ b/debian/install @@ -1,5 +1,6 @@ etc/byobu/socketdir etc/byobu/ etc/byobu/backend etc/byobu/ +etc/profile.d/Z97-byobu.sh etc/profile.d/ usr/share/byobu/pixmaps/byobu.svg usr/share/icons/hicolor/scalable/apps/ usr/share/byobu/pixmaps/highcontrast/byobu.svg usr/share/icons/HighContrast/scalable/apps/ debian/source_byobu.py usr/share/apport/package-hooks diff --git a/debian/postinst b/debian/postinst index 6f166a92..78c77923 100644 --- a/debian/postinst +++ b/debian/postinst @@ -7,9 +7,9 @@ PKG="byobu" db_get byobu/launch-by-default || true if [ "$RET" = true ]; then - ln -sf /usr/share/$PKG/profiles/Z97-$PKG.sh /etc/profile.d/Z97-$PKG.sh + touch /etc/$PKG/autolaunch else - rm -f /etc/profile.d/Z97-$PKG.sh + rm -f /etc/$PKG/autolaunch fi # Clean up any old-school screen-profiles diversions of /usr/bin/screen diff --git a/debian/postrm b/debian/postrm index 5b7afe4d..762d4d5d 100644 --- a/debian/postrm +++ b/debian/postrm @@ -2,10 +2,6 @@ PKG="byobu" -# If removing Byobu, ensure that we clean up this launch-by-default -# symlink, if it exists -rm -f /etc/profile.d/Z97-$PKG.sh - # Clean-up obsolete config file rm -f /etc/byobu/statusrc || true diff --git a/etc/profile.d/Makefile.am b/etc/profile.d/Makefile.am index d1e06f4a..b0d07037 100644 --- a/etc/profile.d/Makefile.am +++ b/etc/profile.d/Makefile.am @@ -1 +1,2 @@ etcdir = @sysconfdir@/profile.d +etc_DATA = Z97-byobu.sh diff --git a/usr/share/byobu/profiles/Z97-byobu.sh.in b/etc/profile.d/Z97-byobu.sh.in similarity index 67% rename from usr/share/byobu/profiles/Z97-byobu.sh.in rename to etc/profile.d/Z97-byobu.sh.in index 46d2ea91..6a051fc1 100644 --- a/usr/share/byobu/profiles/Z97-byobu.sh.in +++ b/etc/profile.d/Z97-byobu.sh.in @@ -19,16 +19,23 @@ # Apologies for borrowing the LC_BYOBU namespace, but: # a) it's reasonable to assume that no one else is using LC_BYOBU # b) LC_* is sent and receieved by most /etc/ssh/ssh*_config -if [ -n "$LC_BYOBU" ] && [ "$LC_BYOBU" -gt 0 ] && [ -r "@prefix@/bin/byobu-launch" ]; then - . @prefix@/bin/byobu-launch -elif [ "$LC_TERMTYPE" = "byobu" ] && [ -r "@prefix@/bin/byobu-launch" ]; then - . @prefix@/bin/byobu-launch -elif [ "$LC_TERMTYPE" = "byobu-screen" ] && [ -r "@prefix@/bin/byobu-launch" ]; then - export BYOBU_BACKEND="screen" - . @prefix@/bin/byobu-launch -elif [ "$LC_TERMTYPE" = "byobu-tmux" ] && [ -r "@prefix@/bin/byobu-launch" ]; then - export BYOBU_BACKEND="tmux" - . @prefix@/bin/byobu-launch + +if [ -r "@prefix@/bin/byobu-launch" ]; then + if [ "$LC_BYOBU" = "0" ]; then + true + elif [ "$LC_BYOBU" = "1" ]; then + . @prefix@/bin/byobu-launch + elif [ -e "/etc/byobu/autolaunch" ]; then + . @prefix@/bin/byobu-launch + elif [ "$LC_TERMTYPE" = "byobu" ]; then + . @prefix@/bin/byobu-launch + elif [ "$LC_TERMTYPE" = "byobu-screen" ]; then + export BYOBU_BACKEND="screen" + . @prefix@/bin/byobu-launch + elif [ "$LC_TERMTYPE" = "byobu-tmux" ]; then + export BYOBU_BACKEND="tmux" + . @prefix@/bin/byobu-launch + fi fi # vi: syntax=sh ts=4 noexpandtab diff --git a/usr/share/byobu/profiles/Makefile.am b/usr/share/byobu/profiles/Makefile.am index 14763c2d..e7fb2e4f 100644 --- a/usr/share/byobu/profiles/Makefile.am +++ b/usr/share/byobu/profiles/Makefile.am @@ -1,2 +1,2 @@ profilesdir = $(datadir)/@PACKAGE@/profiles -profiles_DATA = bashrc byoburc dircolors screenrc common tmux tmuxrc NONE Z97-byobu.sh +profiles_DATA = bashrc byoburc dircolors screenrc common tmux tmuxrc NONE