Change from using a single [ to using [[.
authorChris Gianelloni <wolf31o2@gentoo.org>
Wed, 7 Mar 2007 15:23:39 +0000 (15:23 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Wed, 7 Mar 2007 15:23:39 +0000 (15:23 +0000)
eclass/games-etmod.eclass
eclass/games-q3mod.eclass
eclass/games-ut2k4mod.eclass

index e318a8a7ed15d328212ef5a1f1a013301afef0b5..4dcb60592cfc81997d8ec4c0f08bd35d06c0ab60 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/games-etmod.eclass,v 1.12 2006/10/02 06:31:40 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/games-etmod.eclass,v 1.13 2007/03/07 15:23:39 wolf31o2 Exp $
 
 inherit games
 
@@ -24,21 +24,21 @@ RDEPEND="sys-libs/glibc
 S=${WORKDIR}
 
 games-etmod_src_install() {
-       [ -z "${MOD_NAME}" ] && die "what is the name of this etmod ?"
+       [[ -z "${MOD_NAME}" ]] && die "what is the name of this etmod ?"
 
        local bdir=${GAMES_PREFIX_OPT}/enemy-territory
        local mdir=${bdir}/${MOD_NAME}
        MOD_BINS=${MOD_BINS:-${MOD_NAME}}
 
-       if [ -d ${MOD_NAME} ] ; then
+       if [[ -d ${MOD_NAME} ]] ; then
                dodir "${bdir}"
                cp -PR ${MOD_NAME} "${D}/${bdir}/"
        fi
-       if [ -d etmain ] ; then
+       if [[ -d etmain ]] ; then
                dodir "${bdir}"
                cp -PR etmain "${D}/${bdir}/"
        fi
-       if [ ! -z "`ls "${S}"/* 2> /dev/null`" ] ; then
+       if [[ ! -z "`ls "${S}"/* 2> /dev/null`" ]] ; then
                dodir "${mdir}"
                cp -PR "${S}"/* "${D}/${mdir}/"
        fi
@@ -73,7 +73,7 @@ games-etmod_pkg_postinst() {
        local samplecfg=${FILESDIR}/server.cfg
        local realcfg=${GAMES_PREFIX_OPT}/enemy-territory/${MOD_NAME}/server.cfg
 
-       if [ -e "${samplecfg}" ] && [ ! -e "${realcfg}" ] ; then
+       if [[ -e "${samplecfg}" ]] && [[ ! -e "${realcfg}" ]] ; then
                cp "${samplecfg}" "${realcfg}"
        fi
 
@@ -118,12 +118,12 @@ start() {
 stop() {
        ebegin "Stopping ${MOD_NAME} dedicated"
        local pid=\`screen -list | grep et-${MOD_BINS}-ded | awk -F . '{print \$1}' | sed -e s/.//\`
-       if [ -z "\${pid}" ] ; then
+       if [[ -z "\${pid}" ]] ; then
                eend 1 "Lost screen session"
        else
                pid=\`pstree -p \${pid} | sed -e 's:^.*etded\.x86::'\`
                pid=\${pid:1:\${#pid}-2}
-               if [ -z "\${pid}" ] ; then
+               if [[ -z "\${pid}" ]] ; then
                        eend 1 "Lost etded session"
                else
                        kill \${pid}
@@ -139,7 +139,7 @@ EOF
 }
 
 games-etmod_make_conf.d() {
-       if [ -e "${FILESDIR}"/${MOD_NAME}.conf.d ] ; then
+       if [[ -e "${FILESDIR}"/${MOD_NAME}.conf.d ]] ; then
                cp "${FILESDIR}"/${MOD_NAME}.conf.d "${T}"/et-${MOD_NAME}-ded.conf.d
                return 0
        fi
index f8900b1385c00922d4850dc5d955985890863403..3440889a3f198fa6063893dce197e31b6129e2da 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/games-q3mod.eclass,v 1.35 2006/10/05 18:54:37 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/games-q3mod.eclass,v 1.36 2007/03/07 15:23:39 wolf31o2 Exp $
 
 inherit games
 
@@ -110,12 +110,12 @@ start() {
 stop() {
        ebegin "Stopping ${MOD_NAME} dedicated"
        local pid=\`screen -list | grep q3${MOD_BINS}-ded | awk -F . '{print \$1}' | sed -e s/.//\`
-       if [ -z "\${pid}" ] ; then
+       if [[ -z "\${pid}" ]] ; then
                eend 1 "Lost screen session"
        else
                pid=\`pstree -p \${pid} | sed -e 's:^.*q3ded::'\`
                pid=\${pid:1:\${#pid}-2}
-               if [ -z "\${pid}" ] ; then
+               if [[ -z "\${pid}" ]] ; then
                        eend 1 "Lost q3ded session"
                else
                        kill \${pid}
index 0889160315935592c856947738cbcc724bd7b187..7a01b96fc98bc556a6f2cca75c928b8a395738a0 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/games-ut2k4mod.eclass,v 1.9 2006/09/28 21:32:12 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/games-ut2k4mod.eclass,v 1.10 2007/03/07 15:23:39 wolf31o2 Exp $
 
 inherit games
 
@@ -29,16 +29,16 @@ check_dvd() {
        # to bugs.gentoo.org as I know it is a very ugly hack.
        USE_DVD=
        USE_ECE_DVD=
-       if [ -n "${CD_ROOT}" ]
+       if [[ -n "${CD_ROOT}" ]]
        then
-               [ -d "${CD_ROOT}/CD1" ] && USE_DVD=1
-               [ -d "${CD_ROOT}/CD7" ] && USE_ECE_DVD=1
+               [[ -d "${CD_ROOT}/CD1" ]] && USE_DVD=1
+               [[ -d "${CD_ROOT}/CD7" ]] && USE_ECE_DVD=1
        else
                local mline=""
                for mline in `mount | egrep -e '(iso|cdrom)' | awk '{print $3}'`
                do
-                       [ -d "${mline}/CD1" ] && USE_DVD=1
-                       [ -d "${mline}/CD7" ] && USE_ECE_DVD=1
+                       [[ -d "${mline}/CD1" ]] && USE_DVD=1
+                       [[ -d "${mline}/CD7" ]] && USE_ECE_DVD=1
                done
        fi
 }
@@ -49,8 +49,8 @@ games-ut2k4mod_pkg_nofetch() {
 }
 
 games-ut2k4mod_src_unpack() {
-       [ -z "${MOD_TBZ2}" ] && die "what are we supposed to unpack ?"
-       [ -z "${MOD_NAME}" ] && die "what is the name of this ut2k4mod ?"
+       [[ -z "${MOD_TBZ2}" ]] && die "what are we supposed to unpack ?"
+       [[ -z "${MOD_NAME}" ]] && die "what is the name of this ut2k4mod ?"
 
        for src_uri in ${A}
        do
@@ -73,15 +73,15 @@ games-ut2k4mod_src_unpack() {
        mkdir ${S}/unpack
        for tarball in ${MOD_TBZ2}
        do
-               if [ -e "${tarball}_${PV}-english.tar.bz2" ]
+               if [[ -e "${tarball}_${PV}-english.tar.bz2" ]]
                then
                        tar xjf ${tarball}_${PV}-english.tar.bz2 -C ${S}/unpack \
                                || die "uncompressing tarball"
-               elif [ -e "${tarball}_${PV}.tar.bz2" ]
+               elif [[ -e "${tarball}_${PV}.tar.bz2" ]]
                then
                        tar xjf ${tarball}_${PV}.tar.bz2 -C ${S}/unpack \
                                || die "uncompressing tarball"
-               else [ -e "${tarball}.tar.bz2" ]
+               else [[ -e "${tarball}.tar.bz2" ]]
                        tar xjf ${tarball}.tar.bz2 -C ${S}/unpack \
                                || die "uncompressing tarball"
                fi
@@ -96,7 +96,7 @@ games-ut2k4mod_src_install() {
        do
                dodoc ${readme} || die "dodoc failed"
        done
-       if [ -n "${MOD_BINS}" ]
+       if [[ -n "${MOD_BINS}" ]]
        then
                exeinto ${dir}
                doexe bin/${MOD_BINS} || die "doexe failed"
@@ -110,7 +110,7 @@ games-ut2k4mod_src_install() {
 }
 
 games-ut2k4mod_pkg_postinst() {
-       if [ -n "${MOD_BINS}" ]
+       if [[ -n "${MOD_BINS}" ]]
        then
                einfo "To play this mod run:"
                einfo " ${MOD_BINS}"