/[gentoo-x86]/eclass/subversion.eclass
Gentoo

Diff of /eclass/subversion.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.39 Revision 1.41
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/subversion.eclass,v 1.39 2007/01/19 10:39:51 hattya Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/subversion.eclass,v 1.41 2007/04/01 14:48:37 hattya Exp $
4 4
5## --------------------------------------------------------------------------- # 5## --------------------------------------------------------------------------- #
6# Author: Akinori Hattori <hattya@gentoo.org> 6# Author: Akinori Hattori <hattya@gentoo.org>
7# 7#
8# The subversion eclass is written to fetch the software sources from 8# The subversion eclass is written to fetch the software sources from
119 119
120 120
121## -- subversion_fetch() ----------------------------------------------------- # 121## -- subversion_fetch() ----------------------------------------------------- #
122# 122#
123# @param $1 - a repository URI. default is the ESVN_REPO_URI. 123# @param $1 - a repository URI. default is the ESVN_REPO_URI.
124# @param $2 - a check out path in S.
124# 125#
125function subversion_fetch() { 126function subversion_fetch() {
126 127
127 local repo_uri="$(subversion__get_repository_uri "${1}")" 128 local repo_uri="$(subversion__get_repository_uri "${1}")"
128 local S_dest="${2}" 129 local S_dest="${2}"
294 fi 295 fi
295 296
296 local k 297 local k
297 298
298 for k in url revision; do 299 for k in url revision; do
299 export ESVN_WC_$(echo "${k}" | tr "[a-z]" "[A-Z]")="$(subversion__svn_info "${wc_path}" "${k}")" 300 export ESVN_WC_$(subversion__to_upper_case "${k}")="$(subversion__svn_info "${wc_path}" "${k}")"
300 done 301 done
301 302
302} 303}
303 304
304 305
387 debug-print "${FUNCNAME}: repo_uri does not have a peg revision." 388 debug-print "${FUNCNAME}: repo_uri does not have a peg revision."
388 return 1 389 return 1
389 fi 390 fi
390 391
391 local peg_rev="${repo_uri##*@}" 392 local peg_rev="${repo_uri##*@}"
392 local rev=$(subversion__svn_info "${repo_uri}" "revision") 393
394 case "$(subversion__to_upper_case "${peg_rev}")" in
395 [[:digit:]]*)
396 # NUMBER
397 ;;
398 HEAD|BASE|COMMITED|PREV)
399 ;;
400 {[^}]*})
401 # DATE
402 ;;
403 *)
404 debug-print "${FUNCNAME}: repo_uri does not have a peg revision."
405 return 1
406 ;;
407 esac
393 408
394 debug-print "${FUNCNAME}: peg_rev = ${peg_rev}" 409 debug-print "${FUNCNAME}: peg_rev = ${peg_rev}"
395 debug-print "${FUNCNAME}: rev = ${rev} "
396 410
397 if [[ "${peg_rev}" -eq "${rev}" ]]; then
398 return 0 411 return 0
399 fi
400 412
401 return 1
402
403} 413}
414
415
416## -- subversion__to_upper_case() ----------------------------------------- #
417#
418# @param $@ - the strings to upper case.
419#
420function subversion__to_upper_case() {
421 echo "${@}" | tr "[a-z]" "[A-Z]"
422}

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.41

  ViewVC Help
Powered by ViewVC 1.1.20