* usr/bin/byobu-launch: LP: #809525

- no need to search path on sourcing (thanks, Scott Moser)
* usr/bin/byobu-launcher-install: LP: #809525
  - prevent profile from getting sourced twice (thanks, Scott Moser)
This commit is contained in:
Dustin Kirkland 2011-07-19 12:13:55 -05:00
commit de1de53452
3 changed files with 24 additions and 23 deletions

4
debian/changelog vendored
View file

@ -94,6 +94,10 @@ byobu (4.18) unreleased; urgency=low
usr/lib/byobu/menu, usr/lib/byobu/network,
usr/lib/byobu/updates_available, usr/share/byobu/keybindings/f-keys:
- comprehensively use $SED for MacOSX compatibility, LP: #812973
* usr/bin/byobu-launch: LP: #809525
- no need to search path on sourcing (thanks, Scott Moser)
* usr/bin/byobu-launcher-install: LP: #809525
- prevent profile from getting sourced twice (thanks, Scott Moser)
[ James Spencer ]
* usr/lib/byobu/.constants:

View file

@ -17,12 +17,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
PKG="byobu"
[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX
. "${BYOBU_PREFIX}/lib/${PKG}/.common"
# Respect an environment variable passable over SSH to disable
# Byobu launch. This put that configurability on the SSH client,
# 1) Prevent recursion, and multiple sourcing of profiles with the BYOBU_SOURCED_PROFILE environment variable.
# 2) Respect environment variables (LC_BYOBU and BYOBU_DISABLE) passable over SSH to disable
# Byobu launch. This puts that configurability on the SSH client,
# in addition to the server.
# To use over SSH, your /etc/ssh/sshd_config and /etc/ssh/ssh_config
# must pass this variable with AcceptEnv and SendEnv.
@ -32,17 +29,18 @@ PKG="byobu"
# $HOME/.bashrc: export LC_BYOBU=0
# or edit your sshd_config, ssh_config, and set:
# $HOME/.bashrc: export BYOBU_DISABLE=1
if [ "$LC_BYOBU" != "0" ] && [ "$BYOBU_DISABLE" != "1" ]; then
if [ "$BYOBU_SOURCED_PROFILE" != "1" ] && [ "$LC_BYOBU" != "0" ] && [ "$BYOBU_DISABLE" != "1" ]; then
BYOBU_SOURCED_PROFILE=1
PKG="byobu"
[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX
. "${BYOBU_PREFIX}/lib/${PKG}/.common"
case "$-" in
*i*)
# Attempt to merge shell history across sessions/windows (works with a few exceptions)
shopt -s histappend || true
[ -n "$PROMPT_COMMAND" ] && PROMPT_COMMAND="$PROMPT_COMMAND;history -a" || PROMPT_COMMAND="history -a"
# Source profile, as long as we won't recurse
if [ -r "$HOME/.profile" ] && [ "$BYOBU_SOURCED_PROFILE" != "1" ]; then
BYOBU_SOURCED_PROFILE=1
. "$HOME/.profile"
fi
# Source profile
[ -r "$HOME/.profile" ] && . "$HOME/.profile"
if byobu-launcher; then
# Wait very briefly for the no-logout flag to get written?
sleep 0.1
@ -58,5 +56,4 @@ if [ "$LC_BYOBU" != "0" ] && [ "$BYOBU_DISABLE" != "1" ]; then
esac
fi
true
# vi: syntax=sh ts=4 noexpandtab

View file

@ -42,7 +42,7 @@ update_flag() {
}
install_launcher() {
printf ". \$(which byobu-launch)\n" >> "$1"
printf ". byobu-launch\n" >> "$1"
}
# Sanitize the environment