summaryrefslogtreecommitdiff
path: root/eclass/base.eclass
diff options
context:
space:
mode:
authorTomas Chvatal <scarabeus@gentoo.org>2010-01-02 17:30:40 +0100
committerTomas Chvatal <scarabeus@gentoo.org>2010-01-02 17:30:40 +0100
commit98c1b4f07e725104d3a964f40af0781d60e980dc (patch)
treee47f1627c7870ad434dc299aac0b9e4b822e1da6 /eclass/base.eclass
parent7666a84f725cb899680a5fd4247a6dd6d759aa1c (diff)
downloadkde-98c1b4f07e725104d3a964f40af0781d60e980dc.tar.gz
kde-98c1b4f07e725104d3a964f40af0781d60e980dc.tar.bz2
kde-98c1b4f07e725104d3a964f40af0781d60e980dc.zip
[base] Update to use bash tests everywhere [[ ]] And detect arrays properly (thx to ulm).
Diffstat (limited to 'eclass/base.eclass')
-rw-r--r--eclass/base.eclass20
1 files changed, 10 insertions, 10 deletions
diff --git a/eclass/base.eclass b/eclass/base.eclass
index baaab145463..000308f6ccd 100644
--- a/eclass/base.eclass
+++ b/eclass/base.eclass
@@ -52,7 +52,7 @@ esac
base_src_unpack() {
debug-print-function $FUNCNAME "$@"
- if [ -z "$1" ]; then
+ if [[ -z "$1" ]]; then
case "${EAPI:-0}" in
2)
base_src_util unpack
@@ -86,13 +86,13 @@ base_src_util() {
local x oldval
- while [ "$1" ]; do
+ while [[ "$1" ]]; do
case $1 in
unpack)
debug-print-section unpack
pushd "${WORKDIR}" > /dev/null
- [ ! -z "$A" ] && unpack ${A}
+ [[ ! -z "${A}" ]] && unpack ${A}
popd > /dev/null
;;
autopatch)
@@ -101,7 +101,7 @@ base_src_util() {
pushd "${S}" > /dev/null
- if [[ ${#PATCHES[@]} -gt 1 ]] ; then
+ if [[ $(declare -p PATCHES) == "declare -a "* ]]; then
for x in "${PATCHES[@]}"; do
debug-print "$FUNCNAME: autopatch: applying patch from ${x}"
[[ -f "${x}" ]] && epatch "${x}"
@@ -157,7 +157,7 @@ base_src_configure() {
base_src_compile() {
debug-print-function $FUNCNAME "$@"
- if [ -z "$1" ]; then
+ if [[ -z "$1" ]]; then
case "${EAPI:-0}" in
2)
base_src_work make
@@ -181,7 +181,7 @@ base_src_work() {
pushd "${S}" > /dev/null
- while [ "$1" ]; do
+ while [[ "$1" ]]; do
case $1 in
configure)
debug-print-section configure
@@ -216,11 +216,11 @@ base_src_install() {
debug-print-function $FUNCNAME "$@"
local x
- [ -z "$1" ] && base_src_install all
+ [[ -z "$1" ]] && base_src_install all
pushd "${S}" > /dev/null
- while [ "$1" ]; do
+ while [[ "$1" ]]; do
case $1 in
make)
debug-print-section make
@@ -228,13 +228,13 @@ base_src_install() {
;;
docs)
debug-print-section docs
- if [[ ${#DOCS[@]} -gt 1 ]] ; then
+ if [[ $(declare -p DOCS) == "declare -a "* ]]; then
for x in "${DOCS[@]}"; do
debug-print "$FUNCNAME: docs: creating document from ${x}"
dodoc -r "${x}" || die "dodoc failed"
done
fi
- if [[ ${#HTML_DOCS[@]} -gt 1 ]] ; then
+ if [[ $(declare -p HTML_DOCS) == "declare -a "* ]]; then
for x in "${HTML_DOCS[@]}"; do
debug-print "$FUNCNAME: docs: creating html document from ${x}"
dohtml -r "${x}" || die "dohtml failed"