This commit is contained in:
Jephté Clain 2014-09-19 14:54:31 +04:00
parent 4d40820308
commit e4ce6c5d18

View File

@ -2,10 +2,27 @@
## Fonctions de base: support des fonctions obsolètes et des versions de bash < 4.x ## Fonctions de base: support des fonctions obsolètes et des versions de bash < 4.x
##@cooked nocomments ##@cooked nocomments
uprovide base.compat uprovide base.compat
urequire base.string
## Fonctions obsolètes
# base.core
function rawecho() { recho "$@"; }
function rawecho_() { recho_ "$@"; }
function quote_arg() { _qval "$@"; }
function quoted_arg() { qvalm "$@"; }
function quoted_args() { qvals "$@"; }
# base.quote
function quote_awk() { _qawk "$@"; }
function quoted_awk() { qawk "$@"; }
function quote_seds() { qseds "$@"; }
function quote_form() { _qform "$@"; }
function quoted_form() { qform "$@"; }
## Compatibilité avec bash >=2.x
if [ -n "$BASH_VERSINFO" -a "${BASH_VERSINFO[0]}" -lt 4 ]; then if [ -n "$BASH_VERSINFO" -a "${BASH_VERSINFO[0]}" -lt 4 ]; then
if uprovided base.string; then # base.string
function strlower() { tr A-Z a-z <<<"$*"; } function strlower() { tr A-Z a-z <<<"$*"; }
function strlower1() { function strlower1() {
local str="$*" local str="$*"
@ -55,19 +72,4 @@ if [ -n "$BASH_VERSINFO" -a "${BASH_VERSINFO[0]}" -lt 4 ]; then
esac esac
return 1 return 1
} }
fi
fi fi
## base.core
function rawecho() { recho "$@"; }
function rawecho_() { recho_ "$@"; }
function quote_arg() { _qval "$@"; }
function quoted_arg() { qvalm "$@"; }
function quoted_args() { qvals "$@"; }
## base.quote
function quote_awk() { _qawk "$@"; }
function quoted_awk() { qawk "$@"; }
function quote_seds() { qseds "$@"; }
function quote_form() { _qform "$@"; }
function quoted_form() { qform "$@"; }