mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 06:23:19 -07:00
* debian/rules, usr/bin/byobu, usr/bin/byobu-launch,
usr/lib/byobu/include/common, usr/lib/byobu/include/constants: - clean up some bashisms (better portability) - checkbashisms at build time
This commit is contained in:
parent
e6c6d633c6
commit
e619919927
6 changed files with 27 additions and 19 deletions
4
debian/changelog
vendored
4
debian/changelog
vendored
|
@ -2,6 +2,10 @@ byobu (5.32) unreleased; urgency=low
|
|||
|
||||
* usr/lib/byobu/mail: LP: #1118364
|
||||
- support maildir format
|
||||
* debian/rules, usr/bin/byobu, usr/bin/byobu-launch,
|
||||
usr/lib/byobu/include/common, usr/lib/byobu/include/constants:
|
||||
- clean up some bashisms (better portability)
|
||||
- checkbashisms at build time
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 06 Feb 2013 23:16:22 -0600
|
||||
|
||||
|
|
2
debian/rules
vendored
2
debian/rules
vendored
|
@ -5,6 +5,8 @@
|
|||
override_dh_auto_build:
|
||||
# Check syntax
|
||||
pep8 --verbose --repeat --ignore W191,E501 usr/bin/byobu-config usr/bin/byobu-select-session
|
||||
# Check for bashisms in shell scripts
|
||||
checkbashisms `find . -type f -exec grep -l "^\#\!/bin/sh" '{}' \;`
|
||||
dh_auto_build
|
||||
|
||||
override_dh_perl:
|
||||
|
|
|
@ -64,11 +64,12 @@ if [ "$#" = "1" ]; then
|
|||
case "$1" in
|
||||
-v|--version)
|
||||
echo "$PKG version $VERSION"
|
||||
if [ -n "$BYOBU_ULIMIT" ]; then
|
||||
# Check ulimits
|
||||
[ $($BYOBU_ULIMIT -n) -ge 15 ] || echo "WARNING: ulimit -n is too low" 1>&2
|
||||
[ $($BYOBU_ULIMIT -u) -ge 1600 ] || echo "WARNING: ulimit -u is too low" 1>&2
|
||||
fi
|
||||
exec $BYOBU_BACKEND $BYOBU_ARG_VERSION
|
||||
# Check ulimits
|
||||
[ $(ulimit -n) -ge 15 ] || echo "WARNING: ulimit -n is too low" 1>&2
|
||||
[ $(ulimit -u) -ge 1600 ] || echo "WARNING: ulimit -u is too low" 1>&2
|
||||
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
@ -85,7 +86,7 @@ byobu-janitor --force
|
|||
# Set the window title
|
||||
[ -r "$BYOBU_CONFIG_DIR/statusrc" ] && . "$BYOBU_CONFIG_DIR/statusrc"
|
||||
. $BYOBU_PREFIX/lib/$PKG/ip_address
|
||||
[ -n "$BYOBU_NO_TITLE" ] || printf "\033]0;${USER}@${HOSTNAME:-$(hostname)} ($(__ip_address t)) - ${PKG}\007"
|
||||
[ -n "$BYOBU_NO_TITLE" ] || printf "\033]0;${USER}@$(hostname) ($(__ip_address t)) - ${PKG}\007"
|
||||
|
||||
# Drop a symlink to the ssh socket in $HOME, since we can ensure that exists
|
||||
if [ -S "$SSH_AUTH_SOCK" ] && [ ! -h "$SSH_AUTH_SOCK" ]; then
|
||||
|
|
|
@ -49,13 +49,15 @@ elif [ "$BYOBU_SOURCED_PROFILE" != "1" ] && [ "$LC_BYOBU" != "0" ] && [ "$BYOBU_
|
|||
if [ ! -r "$BYOBU_CONFIG_DIR/disable-autolaunch" ]; then
|
||||
case "$-" in
|
||||
*i*)
|
||||
# Attempt to merge shell history across sessions/windows (works with a few exceptions)
|
||||
if $BYOBU_TEST shopt >/dev/null; then
|
||||
shopt -s histappend || true
|
||||
elif $BYOBU_TEST setopt >/dev/null; then
|
||||
# Support zsh too
|
||||
setopt appendhistory
|
||||
fi
|
||||
# Attempt to merge shell history across sessions/windows (works with some exceptions)
|
||||
for i in shopt setopt; do
|
||||
if $BYOBU_TEST $i >/dev/null;
|
||||
case $i in
|
||||
shopt) $i -s histappend || true ;;
|
||||
setopt) $i appendhistory || true ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
[ -n "$PROMPT_COMMAND" ] && PROMPT_COMMAND="$PROMPT_COMMAND;history -a;history -r" || PROMPT_COMMAND="history -a;history -r"
|
||||
# Source profile, if necessary
|
||||
[ -z "$_byobu_sourced" ] && [ -r "$HOME/.profile" ] && . "$HOME/.profile"
|
||||
|
|
|
@ -23,13 +23,9 @@ if [ -z "${BYOBU_INCLUDED_LIBS}" ]; then
|
|||
. "${BYOBU_PREFIX}/lib/${PKG}/include/dirs"
|
||||
|
||||
# Find command/type/which
|
||||
if command -v 2>/dev/null; then
|
||||
BYOBU_TEST="command -v"
|
||||
elif type 2>/dev/null; then
|
||||
BYOBU_TEST="type"
|
||||
else
|
||||
BYOBU_TEST="which"
|
||||
fi
|
||||
for BYOBU_TEST in "command -v" "type" "which"; do
|
||||
$BYOBU_TEST >/dev/null && break
|
||||
done
|
||||
|
||||
# If the backend is already set (eg. running `byobu-tmux`), do nothing.
|
||||
if [ -z "${BYOBU_BACKEND}" ]; then
|
||||
|
|
|
@ -101,6 +101,9 @@ $BYOBU_TEST sensible-pager >/dev/null 2>&1 && export BYOBU_PAGER="sensible-pager
|
|||
# Check sed's follow-symlinks feature
|
||||
$BYOBU_SED --follow-symlinks "s///" </dev/null 2>/dev/null && BYOBU_SED="$BYOBU_SED --follow-symlinks" || true
|
||||
|
||||
# Determine if we have ulimit support
|
||||
$BYOBU_TEST ulimit >/dev/null 2>&1 && export BYOBU_ULIMIT="ulimit" || export BYOBU_ULIMIT=
|
||||
|
||||
# Default colors
|
||||
export BYOBU_DARK="black"
|
||||
export BYOBU_LIGHT="white"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue