From 598d4be565009e2bda3a39427d9c01b691a5130d Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sat, 22 Oct 2011 01:44:27 -0500 Subject: [PATCH] * usr/bin/byobu-launcher-install, usr/bin/byobu-launcher-uninstall: - LP: #861534 - ensure launcher command removed from each file before installing --- debian/changelog | 3 +++ usr/bin/byobu-launcher-install | 13 +++++++------ usr/bin/byobu-launcher-uninstall | 11 ++++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7e4cbf44..42a0e23c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,9 @@ byobu (4.43) unreleased; urgency=low - configure should not change files under vcs control - compiling users need to ensure that BYOBU_PREFIX is set in their environment + * usr/bin/byobu-launcher-install, usr/bin/byobu-launcher-uninstall: + - LP: #861534 + - ensure launcher command removed from each file before installing [ Daniel Hahler ] * usr/bin/byobu, usr/bin/byobu-launcher-install, usr/bin/byobu- diff --git a/usr/bin/byobu-launcher-install b/usr/bin/byobu-launcher-install index 93d251b2..3702d6cb 100755 --- a/usr/bin/byobu-launcher-install +++ b/usr/bin/byobu-launcher-install @@ -42,17 +42,12 @@ update_flag() { } install_launcher() { + $PKG-launcher-uninstall "$1" || true printf "_byobu_sourced=1 . ${BYOBU_PREFIX}/bin/byobu-launch\n" >> "$1" } # Sanitize the environment $PKG-launcher-uninstall || true -# Hush login, since we will handle motd printing -touch "$HOME"/.hushlogin -rm -f "$BYOBU_CONFIG_DIR/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 @@ -74,5 +69,11 @@ case "$SHELL" in ;; esac +# Hush login, since we will handle motd printing +touch "$HOME"/.hushlogin +rm -f "$BYOBU_CONFIG_DIR/disable-autolaunch" + +# Update the logout/nologout flag +update_flag # vi: syntax=sh ts=4 noexpandtab diff --git a/usr/bin/byobu-launcher-uninstall b/usr/bin/byobu-launcher-uninstall index 9ad5b208..b573bf44 100755 --- a/usr/bin/byobu-launcher-uninstall +++ b/usr/bin/byobu-launcher-uninstall @@ -30,9 +30,14 @@ remove_launcher() { fi } -for i in ".profile" ".bashrc" ".bash_profile" ".zprofile"; do - remove_launcher "$HOME/$i" -done +if [ -f "$1" ]; then + remove_launcher "$1" +else + for i in ".profile" ".bashrc" ".bash_profile" ".bash_login" ".zprofile"; do + remove_launcher "$HOME/$i" + done +fi + mkdir -p "$BYOBU_CONFIG_DIR" touch "$BYOBU_CONFIG_DIR/disable-autolaunch" # install disabled motd printing; re-enable