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

Diff of /eclass/subversion.eclass

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

Revision 1.51 Revision 1.52
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2008 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.51 2008/02/20 22:28:49 zlin Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/subversion.eclass,v 1.52 2008/02/20 22:35:40 zlin Exp $
4 4
5# @ECLASS: subversion.eclass 5# @ECLASS: subversion.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Akinori Hattori <hattya@gentoo.org> 7# Akinori Hattori <hattya@gentoo.org>
8# Bo ├śrsted Andresen <zlin@gentoo.org> 8# Bo ├śrsted Andresen <zlin@gentoo.org>
126# @DESCRIPTION: 126# @DESCRIPTION:
127# Set this variable to a non-empty value to disable the automatic updating of 127# Set this variable to a non-empty value to disable the automatic updating of
128# an svn source tree. This is intended to be set outside the subversion source 128# an svn source tree. This is intended to be set outside the subversion source
129# tree by users. 129# tree by users.
130ESVN_OFFLINE="${ESVN_OFFLINE:-${ESCM_OFFLINE}}" 130ESVN_OFFLINE="${ESVN_OFFLINE:-${ESCM_OFFLINE}}"
131
132# @ECLASS-VARIABLE: ESVN_UP_FREQ
133# @DESCRIPTION:
134# Set the minimum number of hours between svn up'ing in any given svn module. This is particularly
135# useful for split KDE ebuilds where we want to ensure that all submodules are compiled for the same
136# revision. It should also be kept user overrideable.
137ESVN_UP_FREQ="${ESVN_UP_FREQ:=}"
131 138
132# @ECLASS-VARIABLE: ESCM_LOGDIR 139# @ECLASS-VARIABLE: ESCM_LOGDIR
133# @DESCRIPTION: 140# @DESCRIPTION:
134# User configuration variable. If set to a path such as e.g. /var/log/scm any 141# User configuration variable. If set to a path such as e.g. /var/log/scm any
135# package inheriting from subversion.eclass will record svn revision to 142# package inheriting from subversion.eclass will record svn revision to
219 fi 226 fi
220 einfo "Fetching disabled: Using existing repository copy" 227 einfo "Fetching disabled: Using existing repository copy"
221 else 228 else
222 subversion_wc_info "${repo_uri}" || die "${ESVN}: unknown problem occurred while accessing working copy." 229 subversion_wc_info "${repo_uri}" || die "${ESVN}: unknown problem occurred while accessing working copy."
223 230
231 local esvn_up_freq=
232 if [[ -n ${ESVN_UP_FREQ} ]]; then
233 if [[ -n ${ESVN_UP_FREQ//[[:digit:]]} ]]; then
234 die "${ESVN}: ESVN_UP_FREQ must be an integer value corresponding to the minimum number of hours between svn up."
235 elif [[ -z $(find "${wc_path}/.svn/entries" -mmin "+$((ESVN_UP_FREQ*60))") ]]; then
236 einfo "Fetching disabled since ${ESVN_UP_FREQ} hours hasn't passed since last update."
237 esvn_up_freq=no_update
238 fi
239 fi
240
241 if [[ -z ${esvn_up_freq} ]]; then
224 if [[ ${ESVN_WC_URL} != $(subversion__get_repository_uri "${repo_uri}") ]]; then 242 if [[ ${ESVN_WC_URL} != $(subversion__get_repository_uri "${repo_uri}") ]]; then
225 einfo "suversion switch start -->" 243 einfo "suversion switch start -->"
226 einfo " old repository: ${ESVN_WC_URL}@${ESVN_WC_REVISION}" 244 einfo " old repository: ${ESVN_WC_URL}@${ESVN_WC_REVISION}"
227 einfo " new repository: ${repo_uri}${revision:+@}${revision}" 245 einfo " new repository: ${repo_uri}${revision:+@}${revision}"
228 246
229 debug-print "${FUNCNAME}: ${ESVN_SWITCH_CMD} ${options} ${repo_uri}" 247 debug-print "${FUNCNAME}: ${ESVN_SWITCH_CMD} ${options} ${repo_uri}"
230 248
231 cd "${wc_path}" || die "${ESVN}: can't chdir to ${wc_path}" 249 cd "${wc_path}" || die "${ESVN}: can't chdir to ${wc_path}"
232 ${ESVN_SWITCH_CMD} ${options} ${repo_uri} || die "${ESVN}: can't update from ${repo_uri}" 250 ${ESVN_SWITCH_CMD} ${options} ${repo_uri} || die "${ESVN}: can't update from ${repo_uri}"
233 else 251 else
234 # update working copy 252 # update working copy
235 einfo "subversion update start -->" 253 einfo "subversion update start -->"
236 einfo " repository: ${repo_uri}${revision:+@}${revision}" 254 einfo " repository: ${repo_uri}${revision:+@}${revision}"
237 255
238 debug-print "${FUNCNAME}: ${ESVN_UPDATE_CMD} ${options}" 256 debug-print "${FUNCNAME}: ${ESVN_UPDATE_CMD} ${options}"
239 257
240 cd "${wc_path}" || die "${ESVN}: can't chdir to ${wc_path}" 258 cd "${wc_path}" || die "${ESVN}: can't chdir to ${wc_path}"
241 ${ESVN_UPDATE_CMD} ${options} || die "${ESVN}: can't update from ${repo_uri}." 259 ${ESVN_UPDATE_CMD} ${options} || die "${ESVN}: can't update from ${repo_uri}."
242 fi 260 fi
243 261 fi
244 fi 262 fi
245 263
246 einfo " working copy: ${wc_path}" 264 einfo " working copy: ${wc_path}"
247 265
248 if ! has "export" ${ESVN_RESTRICT}; then 266 if ! has "export" ${ESVN_RESTRICT}; then

Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52

  ViewVC Help
Powered by ViewVC 1.1.20