* 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:
Dustin Kirkland 2013-02-07 14:46:56 -06:00
commit e619919927
6 changed files with 27 additions and 19 deletions

4
debian/changelog vendored
View file

@ -2,6 +2,10 @@ byobu (5.32) unreleased; urgency=low
* usr/lib/byobu/mail: LP: #1118364 * usr/lib/byobu/mail: LP: #1118364
- support maildir format - 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 -- Dustin Kirkland <kirkland@ubuntu.com> Wed, 06 Feb 2013 23:16:22 -0600

2
debian/rules vendored
View file

@ -5,6 +5,8 @@
override_dh_auto_build: override_dh_auto_build:
# Check syntax # Check syntax
pep8 --verbose --repeat --ignore W191,E501 usr/bin/byobu-config usr/bin/byobu-select-session 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 dh_auto_build
override_dh_perl: override_dh_perl:

View file

@ -64,11 +64,12 @@ if [ "$#" = "1" ]; then
case "$1" in case "$1" in
-v|--version) -v|--version)
echo "$PKG version $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 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 exit 0
;; ;;
esac esac
@ -85,7 +86,7 @@ byobu-janitor --force
# Set the window title # Set the window title
[ -r "$BYOBU_CONFIG_DIR/statusrc" ] && . "$BYOBU_CONFIG_DIR/statusrc" [ -r "$BYOBU_CONFIG_DIR/statusrc" ] && . "$BYOBU_CONFIG_DIR/statusrc"
. $BYOBU_PREFIX/lib/$PKG/ip_address . $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 # 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 if [ -S "$SSH_AUTH_SOCK" ] && [ ! -h "$SSH_AUTH_SOCK" ]; then

View file

@ -49,13 +49,15 @@ elif [ "$BYOBU_SOURCED_PROFILE" != "1" ] && [ "$LC_BYOBU" != "0" ] && [ "$BYOBU_
if [ ! -r "$BYOBU_CONFIG_DIR/disable-autolaunch" ]; then if [ ! -r "$BYOBU_CONFIG_DIR/disable-autolaunch" ]; then
case "$-" in case "$-" in
*i*) *i*)
# Attempt to merge shell history across sessions/windows (works with a few exceptions) # Attempt to merge shell history across sessions/windows (works with some exceptions)
if $BYOBU_TEST shopt >/dev/null; then for i in shopt setopt; do
shopt -s histappend || true if $BYOBU_TEST $i >/dev/null;
elif $BYOBU_TEST setopt >/dev/null; then case $i in
# Support zsh too shopt) $i -s histappend || true ;;
setopt appendhistory setopt) $i appendhistory || true ;;
fi esac
fi
done
[ -n "$PROMPT_COMMAND" ] && PROMPT_COMMAND="$PROMPT_COMMAND;history -a;history -r" || PROMPT_COMMAND="history -a;history -r" [ -n "$PROMPT_COMMAND" ] && PROMPT_COMMAND="$PROMPT_COMMAND;history -a;history -r" || PROMPT_COMMAND="history -a;history -r"
# Source profile, if necessary # Source profile, if necessary
[ -z "$_byobu_sourced" ] && [ -r "$HOME/.profile" ] && . "$HOME/.profile" [ -z "$_byobu_sourced" ] && [ -r "$HOME/.profile" ] && . "$HOME/.profile"

View file

@ -23,13 +23,9 @@ if [ -z "${BYOBU_INCLUDED_LIBS}" ]; then
. "${BYOBU_PREFIX}/lib/${PKG}/include/dirs" . "${BYOBU_PREFIX}/lib/${PKG}/include/dirs"
# Find command/type/which # Find command/type/which
if command -v 2>/dev/null; then for BYOBU_TEST in "command -v" "type" "which"; do
BYOBU_TEST="command -v" $BYOBU_TEST >/dev/null && break
elif type 2>/dev/null; then done
BYOBU_TEST="type"
else
BYOBU_TEST="which"
fi
# If the backend is already set (eg. running `byobu-tmux`), do nothing. # If the backend is already set (eg. running `byobu-tmux`), do nothing.
if [ -z "${BYOBU_BACKEND}" ]; then if [ -z "${BYOBU_BACKEND}" ]; then

View file

@ -101,6 +101,9 @@ $BYOBU_TEST sensible-pager >/dev/null 2>&1 && export BYOBU_PAGER="sensible-pager
# Check sed's follow-symlinks feature # Check sed's follow-symlinks feature
$BYOBU_SED --follow-symlinks "s///" </dev/null 2>/dev/null && BYOBU_SED="$BYOBU_SED --follow-symlinks" || true $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 # Default colors
export BYOBU_DARK="black" export BYOBU_DARK="black"
export BYOBU_LIGHT="white" export BYOBU_LIGHT="white"