diff options
author | Mike Frysinger <vapier@gentoo.org> | 2013-01-22 07:25:59 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2013-01-22 07:25:59 +0000 |
commit | daeaabbe640f212ca9dd972f27c5abb4c40e4014 (patch) | |
tree | d1e146e15a1ced393945fad3f8130aaca5e96524 /eclass | |
parent | Version bump. Update shared-color-profile dependency since it has been merged... (diff) | |
download | gentoo-2-daeaabbe640f212ca9dd972f27c5abb4c40e4014.tar.gz gentoo-2-daeaabbe640f212ca9dd972f27c5abb4c40e4014.tar.bz2 gentoo-2-daeaabbe640f212ca9dd972f27c5abb4c40e4014.zip |
convert to bash style through out
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/cvs.eclass | 261 |
1 files changed, 125 insertions, 136 deletions
diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass index a2e0a604f41c..5b40f92f3abb 100644 --- a/eclass/cvs.eclass +++ b/eclass/cvs.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.78 2013/01/22 07:02:06 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.79 2013/01/22 07:25:59 vapier Exp $ # @ECLASS: cvs.eclass # @MAINTAINER: @@ -93,7 +93,7 @@ inherit eutils # @ECLASS-VARIABLE: ECVS_TOP_DIR # @DESCRIPTION: # The directory under which CVS modules are checked out. -[ -z "$ECVS_TOP_DIR" ] && ECVS_TOP_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/cvs-src" +: ${ECVS_TOP_DIR:="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/cvs-src"} # @ECLASS-VARIABLE: ECVS_SERVER # @DESCRIPTION: @@ -106,7 +106,7 @@ inherit eutils # # Set this to "offline" to disable fetching (i.e. to assume the module # is already checked out in ECVS_TOP_DIR). -[ -z "$ECVS_SERVER" ] && ECVS_SERVER="offline" +: ${ECVS_SERVER:="offline"} # @ECLASS-VARIABLE: ECVS_MODULE # @REQUIRED @@ -115,8 +115,7 @@ inherit eutils # # This must be set when cvs_src_unpack is called. This can include # several directory levels, i.e. "foo/bar/baz" - -#[ -z "$ECVS_MODULE" ] && die "$ECLASS: error: ECVS_MODULE not set, cannot continue" +#[[ -z ${ECVS_MODULE} ]] && die "$ECLASS: error: ECVS_MODULE not set, cannot continue" # @ECLASS-VARIABLE: ECVS_BRANCH # @DEFAULT_UNSET @@ -125,8 +124,7 @@ inherit eutils # # The default is "HEAD". The following default _will_ reset your # branch checkout to head if used. - -#[ -z "$ECVS_BRANCH" ] && ECVS_BRANCH="HEAD" +#: ${ECVS_BRANCH:="HEAD"} # @ECLASS-VARIABLE: ECVS_AUTH # @DESCRIPTION: @@ -143,17 +141,17 @@ inherit eutils # e.g. # "cvs -danoncvs@savannah.gnu.org:/cvsroot/backbone co System" # ( from gnustep-apps/textedit ) -[ -z "$ECVS_AUTH" ] && ECVS_AUTH="pserver" +: ${ECVS_AUTH:="pserver"} # @ECLASS-VARIABLE: ECVS_USER # @DESCRIPTION: # Username to use for authentication on the remote server. -[ -z "$ECVS_USER" ] && ECVS_USER="anonymous" +: ${ECVS_USER:="anonymous"} # @ECLASS-VARIABLE: ECVS_PASS +# @DEFAULT_UNSET # @DESCRIPTION: # Password to use for authentication on the remote server -[ -z "$ECVS_PASS" ] && ECVS_PASS="" # @ECLASS-VARIABLE: ECVS_SSH_HOST_KEY # @DEFAULT_UNSET @@ -178,25 +176,25 @@ inherit eutils # b0rked and wouldn't work with portage userpriv anyway without # special magic. -# [ -z "$ECVS_RUNAS" ] && ECVS_RUNAS="`whoami`" +# : ${ECVS_RUNAS:=$(whoami)} # ECVS_SUBDIR -- deprecated, do not use -[ -n "$ECVS_SUBDIR" ] && die "ERROR: deprecated ECVS_SUBDIR defined. Please fix this ebuild." +[[ -n ${ECVS_SUBDIR} ]] && die "ERROR: deprecated ECVS_SUBDIR defined. Please fix this ebuild." # add cvs to deps # ssh is used for ext auth # sudo is used to run as a specified user DEPEND="dev-vcs/cvs" -[ -n "$ECVS_RUNAS" ] && DEPEND="$DEPEND app-admin/sudo" +[[ -n ${ECVS_RUNAS} ]] && DEPEND+=" app-admin/sudo" -if [ "$ECVS_AUTH" == "ext" ]; then +if [[ ${ECVS_AUTH} == "ext" ]] ; then #default to ssh - [ -z "$CVS_RSH" ] && export CVS_RSH="ssh" - if [ "$CVS_RSH" != "ssh" ]; then + [[ -z ${CVS_RSH} ]] && export CVS_RSH="ssh" + if [[ ${CVS_RSH} != "ssh" ]] ; then die "Support for ext auth with clients other than ssh has not been implemented yet" fi - DEPEND="${DEPEND} net-misc/openssh" + DEPEND+=" net-misc/openssh" fi # called from cvs_src_unpack @@ -205,11 +203,11 @@ cvs_fetch() { # Make these options local variables so that the global values are # not affected by modifications in this function. - local ECVS_COMMAND="${ECVS_COMMAND}" - local ECVS_UP_OPTS="${ECVS_UP_OPTS}" - local ECVS_CO_OPTS="${ECVS_CO_OPTS}" + local ECVS_COMMAND=${ECVS_COMMAND} + local ECVS_UP_OPTS=${ECVS_UP_OPTS} + local ECVS_CO_OPTS=${ECVS_CO_OPTS} - debug-print-function $FUNCNAME $* + debug-print-function ${FUNCNAME} "$@" # Update variables that are modified by ebuild parameters, which # should be effective every time cvs_fetch is called, and not just @@ -217,9 +215,9 @@ cvs_fetch() { # Handle parameter for local (non-recursive) fetching - if [ -n "$ECVS_LOCAL" ]; then - ECVS_UP_OPTS="$ECVS_UP_OPTS -l" - ECVS_CO_OPTS="$ECVS_CO_OPTS -l" + if [[ -n ${ECVS_LOCAL} ]] ; then + ECVS_UP_OPTS+=" -l" + ECVS_CO_OPTS+=" -l" fi # Handle ECVS_BRANCH option @@ -227,38 +225,35 @@ cvs_fetch() { # Because CVS auto-switches branches, we just have to pass the # correct -rBRANCH option when updating. - if [ -n "$ECVS_BRANCH" ]; then - ECVS_UP_OPTS="$ECVS_UP_OPTS -r$ECVS_BRANCH" - ECVS_CO_OPTS="$ECVS_CO_OPTS -r$ECVS_BRANCH" + if [[ -n ${ECVS_BRANCH} ]] ; then + ECVS_UP_OPTS+=" -r${ECVS_BRANCH}" + ECVS_CO_OPTS+=" -r${ECVS_BRANCH}" fi # Handle ECVS_LOCALNAME, which specifies the local directory name # to use. Note that the -d command option is not equivalent to # the global -d option. - if [ "$ECVS_LOCALNAME" != "$ECVS_MODULE" ]; then - ECVS_CO_OPTS="$ECVS_CO_OPTS -d $ECVS_LOCALNAME" + if [[ ${ECVS_LOCALNAME} != "${ECVS_MODULE}" ]] ; then + ECVS_CO_OPTS+=" -d ${ECVS_LOCALNAME}" fi - - if [ -n "$ECVS_CLEAN" ]; then - ECVS_UP_OPTS="$ECVS_UP_OPTS -C" + if [[ -n ${ECVS_CLEAN} ]] ; then + ECVS_UP_OPTS+=" -C" fi - # It would be easiest to always be in "run-as mode", logic-wise, # if sudo didn't ask for a password even when sudo'ing to `whoami`. - if [ -z "$ECVS_RUNAS" ]; then + if [[ -z ${ECVS_RUNAS} ]] ; then run="" else - run="sudo -u $ECVS_RUNAS" + run="sudo -u ${ECVS_RUNAS}" fi # Create the top dir if needed - if [ ! -d "$ECVS_TOP_DIR" ]; then - + if [[ ! -d ${ECVS_TOP_DIR} ]] ; then # Note that the addwrite statements in this block are only # there to allow creating ECVS_TOP_DIR; we allow writing # inside it separately. @@ -268,67 +263,64 @@ cvs_fetch() { # real path and not a symlink for things to work (so we can't # just remove the last path element in the string) - debug-print "$FUNCNAME: checkout mode. creating cvs directory" + debug-print "${FUNCNAME}: checkout mode. creating cvs directory" addwrite /foobar addwrite / - $run mkdir -p "/$ECVS_TOP_DIR" + ${run} mkdir -p "/${ECVS_TOP_DIR}" export SANDBOX_WRITE="${SANDBOX_WRITE//:\/foobar:\/}" fi # In case ECVS_TOP_DIR is a symlink to a dir, get the real path, # otherwise addwrite() doesn't work. - cd -P "$ECVS_TOP_DIR" > /dev/null - ECVS_TOP_DIR="`/bin/pwd`" + cd -P "${ECVS_TOP_DIR}" >/dev/null + ECVS_TOP_DIR=$(pwd) # Disable the sandbox for this dir - addwrite "$ECVS_TOP_DIR" + addwrite "${ECVS_TOP_DIR}" # Chown the directory and all of its contents - if [ -n "$ECVS_RUNAS" ]; then - $run chown -R "$ECVS_RUNAS" "/$ECVS_TOP_DIR" + if [[ -n ${ECVS_RUNAS} ]] ; then + ${run} chown -R "${ECVS_RUNAS}" "/${ECVS_TOP_DIR}" fi # Determine the CVS command mode (checkout or update) - if [ ! -d "$ECVS_TOP_DIR/$ECVS_LOCALNAME/CVS" ]; then + if [[ ! -d ${ECVS_TOP_DIR}/${ECVS_LOCALNAME}/CVS ]] ; then mode=checkout else mode=update fi - # Our server string (i.e. CVSROOT) without the password so it can # be put in Root - if [ "$ECVS_AUTH" == "no" ] - then + if [[ ${ECVS_AUTH} == "no" ]] ; then local server="${ECVS_USER}@${ECVS_SERVER}" else local connection="${ECVS_AUTH}" - [[ -n ${ECVS_PROXY} ]] && connection="${connection};proxy=${ECVS_PROXY}" - [[ -n ${ECVS_PROXY_PORT} ]] && connection="${connection};proxyport=${ECVS_PROXY_PORT}" + [[ -n ${ECVS_PROXY} ]] && connection+=";proxy=${ECVS_PROXY}" + [[ -n ${ECVS_PROXY_PORT} ]] && connection+=";proxyport=${ECVS_PROXY_PORT}" local server=":${connection}:${ECVS_USER}@${ECVS_SERVER}" fi # Switch servers automagically if needed - if [ "$mode" == "update" ]; then - cd /$ECVS_TOP_DIR/$ECVS_LOCALNAME - local oldserver="`$run cat CVS/Root`" - if [ "$server" != "$oldserver" ]; then - - einfo "Changing the CVS server from $oldserver to $server:" - debug-print "$FUNCNAME: Changing the CVS server from $oldserver to $server:" + if [[ ${mode} == "update" ]] ; then + cd "/${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" + local oldserver=$(${run} cat CVS/Root) + if [[ ${server} != "${oldserver}" ]] ; then + einfo "Changing the CVS server from ${oldserver} to ${server}:" + debug-print "${FUNCNAME}: Changing the CVS server from ${oldserver} to ${server}:" einfo "Searching for CVS directories ..." - local cvsdirs="`$run find . -iname CVS -print`" - debug-print "$FUNCNAME: CVS directories found:" - debug-print "$cvsdirs" + local cvsdirs=$(${run} find . -iname CVS -print) + debug-print "${FUNCNAME}: CVS directories found:" + debug-print "${cvsdirs}" einfo "Modifying CVS directories ..." - for x in $cvsdirs; do - debug-print "In $x" - $run echo "$server" > "$x/Root" + local x + for x in ${cvsdirs} ; do + debug-print "In ${x}" + ${run} echo "${server}" > "${x}/Root" done - fi fi @@ -336,8 +328,8 @@ cvs_fetch() { # mess with ~/.cvspass touch "${T}/cvspass" export CVS_PASSFILE="${T}/cvspass" - if [ -n "$ECVS_RUNAS" ]; then - chown "$ECVS_RUNAS" "${T}/cvspass" + if [[ -n ${ECVS_RUNAS} ]] ; then + chown "${ECVS_RUNAS}" "${T}/cvspass" fi # The server string with the password in it, for login @@ -345,8 +337,7 @@ cvs_fetch() { # Ditto without the password, for checkout/update after login, so # that the CVS/Root files don't contain the password in plaintext - if [ "$ECVS_AUTH" == "no" ] - then + if [[ ${ECVS_AUTH} == "no" ]] ; then cvsroot_nopass="${ECVS_USER}@${ECVS_SERVER}" else cvsroot_nopass=":${ECVS_AUTH}:${ECVS_USER}@${ECVS_SERVER}" @@ -360,37 +351,35 @@ cvs_fetch() { # Execute commands cd "${ECVS_TOP_DIR}" - if [ "${ECVS_AUTH}" == "pserver" ]; then - einfo "Running $cmdlogin" - eval $cmdlogin || die "cvs login command failed" - if [ "${mode}" == "update" ]; then - einfo "Running $cmdupdate" - eval $cmdupdate || die "cvs update command failed" - elif [ "${mode}" == "checkout" ]; then - einfo "Running $cmdcheckout" - eval $cmdcheckout|| die "cvs checkout command failed" + if [[ ${ECVS_AUTH} == "pserver" ]] ; then + einfo "Running ${cmdlogin}" + eval ${cmdlogin} || die "cvs login command failed" + if [[ ${mode} == "update" ]] ; then + einfo "Running ${cmdupdate}" + eval ${cmdupdate} || die "cvs update command failed" + elif [[ ${mode} == "checkout" ]] ; then + einfo "Running ${cmdcheckout}" + eval ${cmdcheckout} || die "cvs checkout command failed" fi - elif [ "${ECVS_AUTH}" == "ext" ] || [ "${ECVS_AUTH}" == "no" ]; then - + elif [[ ${ECVS_AUTH} == "ext" || ${ECVS_AUTH} == "no" ]] ; then # Hack to support SSH password authentication # Backup environment variable values local CVS_ECLASS_ORIG_CVS_RSH="${CVS_RSH}" - if [ "${SSH_ASKPASS+set}" == "set" ]; then + if [[ ${SSH_ASKPASS+set} == "set" ]] ; then local CVS_ECLASS_ORIG_SSH_ASKPASS="${SSH_ASKPASS}" else unset CVS_ECLASS_ORIG_SSH_ASKPASS fi - if [ "${DISPLAY+set}" == "set" ]; then + if [[ ${DISPLAY+set} == "set" ]] ; then local CVS_ECLASS_ORIG_DISPLAY="${DISPLAY}" else unset CVS_ECLASS_ORIG_DISPLAY fi - if [ "${CVS_RSH}" == "ssh" ]; then - + if [[ ${CVS_RSH} == "ssh" ]] ; then # Force SSH to use SSH_ASKPASS by creating python wrapper export CVS_RSH="${T}/cvs_sshwrapper" @@ -425,7 +414,7 @@ EOF echo "newarglist.insert(1, '-oUserKnownHostsFile=${CVS_ECLASS_KNOWN_HOSTS}')" \ >> "${CVS_RSH}" - if [ -z "${ECVS_SSH_HOST_KEY}" ]; then + if [[ -z ${ECVS_SSH_HOST_KEY} ]] ; then ewarn "Warning: The SSH host key of the remote server will not be verified." einfo "A temporary known hosts list will be used." local CVS_ECLASS_STRICT_HOST_CHECKING="no" @@ -447,40 +436,39 @@ EOF # Make sure DISPLAY is set (SSH will not use SSH_ASKPASS # if DISPLAY is not set) - [ -z "${DISPLAY}" ] && DISPLAY="DISPLAY" + : ${DISPLAY:="DISPLAY"} export DISPLAY - # Create a dummy executable to echo $ECVS_PASS + # Create a dummy executable to echo ${ECVS_PASS} export SSH_ASKPASS="${T}/cvs_sshechopass" - if [ "${ECVS_AUTH}" != "no" ]; then - echo -en "#!/bin/bash\necho \"$ECVS_PASS\"\n" \ + if [[ ${ECVS_AUTH} != "no" ]] ; then + echo -en "#!/bin/bash\necho \"${ECVS_PASS}\"\n" \ > "${SSH_ASKPASS}" else echo -en "#!/bin/bash\nreturn\n" \ > "${SSH_ASKPASS}" - fi chmod a+x "${SSH_ASKPASS}" fi - if [ "${mode}" == "update" ]; then - einfo "Running $cmdupdate" - eval $cmdupdate || die "cvs update command failed" - elif [ "${mode}" == "checkout" ]; then - einfo "Running $cmdcheckout" - eval $cmdcheckout|| die "cvs checkout command failed" + if [[ ${mode} == "update" ]] ; then + einfo "Running ${cmdupdate}" + eval ${cmdupdate} || die "cvs update command failed" + elif [[ ${mode} == "checkout" ]] ; then + einfo "Running ${cmdcheckout}" + eval ${cmdcheckout} || die "cvs checkout command failed" fi # Restore environment variable values export CVS_RSH="${CVS_ECLASS_ORIG_CVS_RSH}" - if [ "${CVS_ECLASS_ORIG_SSH_ASKPASS+set}" == "set" ]; then + if [[ ${CVS_ECLASS_ORIG_SSH_ASKPASS+set} == "set" ]] ; then export SSH_ASKPASS="${CVS_ECLASS_ORIG_SSH_ASKPASS}" else unset SSH_ASKPASS fi - if [ "${CVS_ECLASS_ORIG_DISPLAY+set}" == "set" ]; then + if [[ ${CVS_ECLASS_ORIG_DISPLAY+set} == "set" ]] ; then export DISPLAY="${CVS_ECLASS_ORIG_DISPLAY}" else unset DISPLAY @@ -489,8 +477,8 @@ EOF # Restore ownership. Not sure why this is needed, but someone # added it in the orig ECVS_RUNAS stuff. - if [ -n "$ECVS_RUNAS" ]; then - chown `whoami` "${T}/cvspass" + if [[ -n ${ECVS_RUNAS} ]] ; then + chown $(whoami) "${T}/cvspass" fi } @@ -500,76 +488,77 @@ EOF # The cvs src_unpack function, which will be exported cvs_src_unpack() { - debug-print-function $FUNCNAME $* - - debug-print "$FUNCNAME: init: - ECVS_CVS_COMMAND=$ECVS_CVS_COMMAND - ECVS_UP_OPTS=$ECVS_UP_OPTS - ECVS_CO_OPTS=$ECVS_CO_OPTS - ECVS_TOP_DIR=$ECVS_TOP_DIR - ECVS_SERVER=$ECVS_SERVER - ECVS_USER=$ECVS_USER - ECVS_PASS=$ECVS_PASS - ECVS_MODULE=$ECVS_MODULE - ECVS_LOCAL=$ECVS_LOCAL - ECVS_RUNAS=$ECVS_RUNAS - ECVS_LOCALNAME=$ECVS_LOCALNAME" + debug-print-function ${FUNCNAME} "$@" - [ -z "$ECVS_MODULE" ] && die "ERROR: CVS module not set, cannot continue." + debug-print "${FUNCNAME}: init: + ECVS_CVS_COMMAND=${ECVS_CVS_COMMAND} + ECVS_UP_OPTS=${ECVS_UP_OPTS} + ECVS_CO_OPTS=${ECVS_CO_OPTS} + ECVS_TOP_DIR=${ECVS_TOP_DIR} + ECVS_SERVER=${ECVS_SERVER} + ECVS_USER=${ECVS_USER} + ECVS_PASS=${ECVS_PASS} + ECVS_MODULE=${ECVS_MODULE} + ECVS_LOCAL=${ECVS_LOCAL} + ECVS_RUNAS=${ECVS_RUNAS} + ECVS_LOCALNAME=${ECVS_LOCALNAME}" - local ECVS_LOCALNAME="${ECVS_LOCALNAME}" + [[ -z ${ECVS_MODULE} ]] && die "ERROR: CVS module not set, cannot continue." - if [ -z "$ECVS_LOCALNAME" ]; then - ECVS_LOCALNAME="$ECVS_MODULE" - fi + local ECVS_LOCALNAME=${ECVS_LOCALNAME:-${ECVS_MODULE}} local sanitized_pn=$(echo "${PN}" | LC_ALL=C sed -e 's:[^A-Za-z0-9_]:_:g') local offline_pkg_var="ECVS_OFFLINE_${sanitized_pn}" - if [[ -n ${!offline_pkg_var}${ECVS_OFFLINE} ]] || [[ "$ECVS_SERVER" == "offline" ]] ; then + if [[ -n ${!offline_pkg_var}${ECVS_OFFLINE} ]] || [[ ${ECVS_SERVER} == "offline" ]] ; then # We're not required to fetch anything; the module already # exists and shouldn't be updated. - if [ -d "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" ]; then - debug-print "$FUNCNAME: offline mode" + if [[ -d ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} ]] ; then + debug-print "${FUNCNAME}: offline mode" else - debug-print "$FUNCNAME: Offline mode specified but directory ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} not found, exiting with error" + debug-print "${FUNCNAME}: Offline mode specified but directory ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} not found, exiting with error" die "ERROR: Offline mode specified, but directory ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} not found. Aborting." fi - elif [ -n "$ECVS_SERVER" ]; then # ECVS_SERVER!=offline --> real fetching mode - einfo "Fetching CVS module $ECVS_MODULE into $ECVS_TOP_DIR ..." + elif [[ -n ${ECVS_SERVER} ]] ; then # ECVS_SERVER!=offline --> real fetching mode + einfo "Fetching CVS module ${ECVS_MODULE} into ${ECVS_TOP_DIR} ..." cvs_fetch else # ECVS_SERVER not set die "ERROR: CVS server not specified, cannot continue." fi - einfo "Copying $ECVS_MODULE from $ECVS_TOP_DIR ..." - debug-print "Copying module $ECVS_MODULE local_mode=$ECVS_LOCAL from $ECVS_TOP_DIR ..." + einfo "Copying ${ECVS_MODULE} from ${ECVS_TOP_DIR} ..." + debug-print "Copying module ${ECVS_MODULE} local_mode=${ECVS_LOCAL} from ${ECVS_TOP_DIR} ..." # This is probably redundant, but best to make sure. - mkdir -p "$WORKDIR/$ECVS_LOCALNAME" + mkdir -p "${WORKDIR}/${ECVS_LOCALNAME}" - if [ -n "$ECVS_LOCAL" ]; then - cp -f "$ECVS_TOP_DIR/$ECVS_LOCALNAME"/* "$WORKDIR/$ECVS_LOCALNAME" + if [[ -n ${ECVS_LOCAL} ]] ; then + cp -f "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}"/* "${WORKDIR}/${ECVS_LOCALNAME}" else - cp -Rf "$ECVS_TOP_DIR/$ECVS_LOCALNAME" "$WORKDIR/$ECVS_LOCALNAME/.." + cp -Rf "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" "${WORKDIR}/${ECVS_LOCALNAME}/.." fi # Not exactly perfect, but should be pretty close #333773 - export ECVS_VERSION=$(find "$ECVS_TOP_DIR/$ECVS_LOCALNAME/" -ipath '*/CVS/Entries' -exec cat {} + | LC_ALL=C sort | sha1sum | awk '{print $1}') + export ECVS_VERSION=$( + find "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}/" -ipath '*/CVS/Entries' -exec cat {} + | \ + LC_ALL=C sort | \ + sha1sum | \ + awk '{print $1}' + ) # If the directory is empty, remove it; empty directories cannot # exist in cvs. This happens when, for example, kde-source # requests module/doc/subdir which doesn't exist. Still create # the empty directory in workdir though. - if [ "`ls -A \"${ECVS_TOP_DIR}/${ECVS_LOCALNAME}\"`" == "CVS" ]; then - debug-print "$FUNCNAME: removing empty CVS directory $ECVS_LOCALNAME" + if [[ $(ls -A "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}") == "CVS" ]] ; then + debug-print "${FUNCNAME}: removing empty CVS directory ${ECVS_LOCALNAME}" rm -rf "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" fi # Implement some of base_src_unpack's functionality; note however # that base.eclass may not have been inherited! - if [ -n "$PATCHES" ]; then - debug-print "$FUNCNAME: PATCHES=$PATCHES, S=$S, autopatching" - cd "$S" + if [[ -n ${PATCHES} ]] ; then + debug-print "${FUNCNAME}: PATCHES=${PATCHES,} S=${S}, autopatching" + cd "${S}" epatch ${PATCHES} # Make sure we don't try to apply patches more than once, # since cvs_src_unpack is usually called several times from |