From ac6c1b2e76577788c421734e9a5b3ee29b21b320 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Tue, 9 Feb 2010 12:31:39 -0600 Subject: [PATCH] debian/postinst, usr/bin/byobu-config, usr/bin/byobu-launcher, usr/bin/byobu-launcher-uninstall: install the profile.d script at Z98-* to ensure that it's sourced last-ish; clean up and check for the new location; check if shell is interactive before exec'ing in the launcher --- debian/changelog | 6 +++++- debian/postinst | 4 ++-- usr/bin/byobu-config | 2 +- usr/bin/byobu-launcher | 2 +- usr/bin/byobu-launcher-uninstall | 6 +++--- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index bc6f5f76..8c783eb9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,10 @@ byobu (2.57) unreleased; urgency=low - * UNRELEASED + * debian/postinst, usr/bin/byobu-config, usr/bin/byobu-launcher, + usr/bin/byobu-launcher-uninstall: install the profile.d script + at Z98-* to ensure that it's sourced last-ish; clean up and check + for the new location; check if shell is interactive before exec'ing + in the launcher -- Dustin Kirkland Tue, 09 Feb 2010 00:07:27 -0600 diff --git a/debian/postinst b/debian/postinst index da2d6275..b7eebb39 100644 --- a/debian/postinst +++ b/debian/postinst @@ -7,9 +7,9 @@ PKG="byobu" db_get byobu/launch-by-default if [ "$RET" = true ]; then - ln -sf /usr/bin/$PKG-launcher /etc/profile.d/95-$PKG.sh + ln -sf /usr/bin/$PKG-launcher /etc/profile.d/Z98-$PKG.sh else - rm -f /etc/profile.d/95-$PKG.sh + rm -f /etc/profile.d/Z98-$PKG.sh fi # The target of the diversion somehow disappeared which will cause diff --git a/usr/bin/byobu-config b/usr/bin/byobu-config index 0ac2bdbc..0e454c90 100755 --- a/usr/bin/byobu-config +++ b/usr/bin/byobu-config @@ -501,7 +501,7 @@ def autolaunch(): return 0 if commands.getoutput('grep -qs byobu-launcher %s/.profile' % HOME): return 1 - if os.path.exists("/etc/profile.d/%s.sh" % PKG): + if os.path.exists("/etc/profile.d/Z98-%s.sh" % PKG): return 1 return 0 diff --git a/usr/bin/byobu-launcher b/usr/bin/byobu-launcher index dc508a05..3120baf9 100755 --- a/usr/bin/byobu-launcher +++ b/usr/bin/byobu-launcher @@ -18,7 +18,7 @@ # along with this program. If not, see . if [ ! -r "$HOME/.byobu/disable-autolaunch" ]; then - if [ -r "$HOME/.byobu/disable-exec" ]; then + if echo $- | grep -qs i; then /usr/bin/byobu else exec /usr/bin/byobu diff --git a/usr/bin/byobu-launcher-uninstall b/usr/bin/byobu-launcher-uninstall index dcf63431..69aa9915 100755 --- a/usr/bin/byobu-launcher-uninstall +++ b/usr/bin/byobu-launcher-uninstall @@ -26,11 +26,11 @@ remove_launcher() { sed -i "/$PKG-launcher$/d" "$dest" sed -i "/screen-launcher$/d" "$dest" fi - touch "$HOME/.$PKG/disable-autolaunch" - # the install disabled motd printing; re-enable - rm -f "$HOME"/.hushlogin } for i in ".profile" ".bashrc" ".bash_profile" ".zprofile"; do remove_launcher "$HOME/$i" done +touch "$HOME/.$PKG/disable-autolaunch" +# install disabled motd printing; re-enable +rm -f "$HOME"/.hushlogin