usr/bin/byobu-launch, usr/bin/byobu-launcher-install: fix handling

of logout behavior, when dpkg-configured globally by the sysadmin,
LP: #741281
This commit is contained in:
Dustin Kirkland 2011-04-14 16:16:04 -05:00
commit e6c3593588
3 changed files with 19 additions and 1 deletions

3
debian/changelog vendored
View file

@ -10,6 +10,9 @@ byobu (3.30) unreleased; urgency=low
LP: #760696 LP: #760696
* usr/bin/byobu-launcher: don't disrupt work flow, but rather inform * usr/bin/byobu-launcher: don't disrupt work flow, but rather inform
user about launching byobu in a nested screen session, LP: #747649 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 ] [ Chaskiel Grundman ]
* debian/postinst: correctly fix old-school screen-profiles era diversions * debian/postinst: correctly fix old-school screen-profiles era diversions

View file

@ -17,4 +17,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
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

View file

@ -20,6 +20,7 @@
PKG="byobu" PKG="byobu"
DATA="$HOME/.$PKG" DATA="$HOME/.$PKG"
FLAG="$DATA/no-logout-on-detach"
LOGOUT_ON_DETACH=1 LOGOUT_ON_DETACH=1
for i in $@; do for i in $@; do
@ -30,6 +31,14 @@ for i in $@; do
esac esac
done done
update_flag() {
if [ "$LOGOUT_ON_DETACH" = "1" ]; then
rm -f "$FLAG"
else
touch "$FLAG"
fi
}
install_launcher() { install_launcher() {
if [ "$LOGOUT_ON_DETACH" = "1" ]; then if [ "$LOGOUT_ON_DETACH" = "1" ]; then
printf "%s\n" 'case "$-" in *i*) byobu-launcher && exit 0; esac;' >> "$1" printf "%s\n" 'case "$-" in *i*) byobu-launcher && exit 0; esac;' >> "$1"
@ -44,6 +53,9 @@ $PKG-launcher-uninstall || true
touch "$HOME"/.hushlogin touch "$HOME"/.hushlogin
rm -f "$DATA/disable-autolaunch" rm -f "$DATA/disable-autolaunch"
# Update the logout/nologout flag
update_flag
# Handle bourne shells, if not set globally in /etc/profile.d # Handle bourne shells, if not set globally in /etc/profile.d
if [ ! -h "/etc/profile.d/Z98-$PKG.sh" ]; then if [ ! -h "/etc/profile.d/Z98-$PKG.sh" ]; then
# Install in $HOME/.profile unconditionally # Install in $HOME/.profile unconditionally