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

Diff of /eclass/subversion.eclass

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

Revision 1.65 Revision 1.67
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2009 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.65 2009/04/29 22:26:31 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/subversion.eclass,v 1.67 2009/05/10 20:33:38 arfrever 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>
17 17
18inherit eutils 18inherit eutils
19 19
20ESVN="${ECLASS}" 20ESVN="${ECLASS}"
21 21
22EXPORTED_FUNCTIONS="src_unpack pkg_preinst"
23case "${EAPI:-0}" in 22case "${EAPI:-0}" in
24 2) EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare" ;; 23 0|1)
25 1|0) ;; 24 EXPORT_FUNCTIONS src_unpack pkg_preinst
26 *) die "Unknown EAPI, Bug eclass maintainers." ;; 25 ;;
26 *)
27 EXPORT_FUNCTIONS src_unpack src_prepare pkg_preinst
28 ;;
27esac 29esac
28EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
29 30
30DESCRIPTION="Based on the ${ECLASS} eclass" 31DESCRIPTION="Based on the ${ECLASS} eclass"
31 32
32DEPEND="dev-util/subversion 33SUBVERSION_DEPEND="dev-util/subversion
33 net-misc/rsync" 34 net-misc/rsync"
35
36if [[ -z "${ESVN_DISABLE_DEPENDENCIES}" ]]; then
37 DEPEND="${SUBVERSION_DEPEND}"
38fi
34 39
35# @ECLASS-VARIABLE: ESVN_STORE_DIR 40# @ECLASS-VARIABLE: ESVN_STORE_DIR
36# @DESCRIPTION: 41# @DESCRIPTION:
37# subversion sources store directory. Users may override this in /etc/make.conf 42# subversion sources store directory. Users may override this in /etc/make.conf
38[[ -z ${ESVN_STORE_DIR} ]] && ESVN_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/svn-src" 43[[ -z ${ESVN_STORE_DIR} ]] && ESVN_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/svn-src"
136# this should be a space delimited list of subversion eclass features to 141# this should be a space delimited list of subversion eclass features to
137# restrict. 142# restrict.
138# export) 143# export)
139# don't export the working copy to S. 144# don't export the working copy to S.
140ESVN_RESTRICT="${ESVN_RESTRICT:-}" 145ESVN_RESTRICT="${ESVN_RESTRICT:-}"
146
147# @ECLASS-VARIABLE: ESVN_DISABLE_DEPENDENCIES
148# @DESCRIPTION:
149# Set this variable to a non-empty value to disable the automatic inclusion of
150# Subversion in dependencies.
151ESVN_DISABLE_DEPENDENCIES="${ESVN_DISABLE_DEPENDENCIES:-}"
141 152
142# @ECLASS-VARIABLE: ESVN_OFFLINE 153# @ECLASS-VARIABLE: ESVN_OFFLINE
143# @DESCRIPTION: 154# @DESCRIPTION:
144# Set this variable to a non-empty value to disable the automatic updating of 155# Set this variable to a non-empty value to disable the automatic updating of
145# an svn source tree. This is intended to be set outside the subversion source 156# an svn source tree. This is intended to be set outside the subversion source
184 # check for the protocol 195 # check for the protocol
185 local protocol="${repo_uri%%:*}" 196 local protocol="${repo_uri%%:*}"
186 197
187 case "${protocol}" in 198 case "${protocol}" in
188 http|https) 199 http|https)
189 if ! built_with_use --missing true -o dev-util/subversion webdav-neon webdav-serf || \ 200 if ! built_with_use -o dev-util/subversion webdav-neon webdav-serf; then
190 built_with_use --missing false dev-util/subversion nowebdav; then
191 echo 201 echo
192 eerror "In order to emerge this package, you need to" 202 eerror "In order to emerge this package, you need to"
193 eerror "reinstall Subversion with support for WebDAV." 203 eerror "reinstall Subversion with support for WebDAV."
194 eerror "Subversion requires either Neon or Serf to support WebDAV." 204 eerror "Subversion requires either Neon or Serf to support WebDAV."
195 echo 205 echo
248 else 258 else
249 ${ESVN_FETCH_CMD} ${options} "${repo_uri}" || die "${ESVN}: can't fetch to ${wc_path} from ${repo_uri}." 259 ${ESVN_FETCH_CMD} ${options} "${repo_uri}" || die "${ESVN}: can't fetch to ${wc_path} from ${repo_uri}."
250 fi 260 fi
251 261
252 elif [[ -n ${ESVN_OFFLINE} ]]; then 262 elif [[ -n ${ESVN_OFFLINE} ]]; then
263 svn upgrade "${wc_path}" &>/dev/null
253 svn cleanup "${wc_path}" 264 svn cleanup "${wc_path}" &>/dev/null
254 subversion_wc_info "${repo_uri}" || die "${ESVN}: unknown problem occurred while accessing working copy." 265 subversion_wc_info "${repo_uri}" || die "${ESVN}: unknown problem occurred while accessing working copy."
255 if [[ -n ${ESVN_REVISION} && ${ESVN_REVISION} != ${ESVN_WC_REVISION} ]]; then 266 if [[ -n ${ESVN_REVISION} && ${ESVN_REVISION} != ${ESVN_WC_REVISION} ]]; then
256 die "${ESVN}: You requested off-line updating and revision ${ESVN_REVISION} but only revision ${ESVN_WC_REVISION} is available locally." 267 die "${ESVN}: You requested off-line updating and revision ${ESVN_REVISION} but only revision ${ESVN_WC_REVISION} is available locally."
257 fi 268 fi
258 einfo "Fetching disabled: Using existing repository copy at revision ${ESVN_WC_REVISION}." 269 einfo "Fetching disabled: Using existing repository copy at revision ${ESVN_WC_REVISION}."
259 else 270 else
271 svn upgrade "${wc_path}" &>/dev/null
260 svn cleanup "${wc_path}" 272 svn cleanup "${wc_path}" &>/dev/null
261 subversion_wc_info "${repo_uri}" || die "${ESVN}: unknown problem occurred while accessing working copy." 273 subversion_wc_info "${repo_uri}" || die "${ESVN}: unknown problem occurred while accessing working copy."
262 274
263 local esvn_up_freq= 275 local esvn_up_freq=
264 if [[ -n ${ESVN_UP_FREQ} ]]; then 276 if [[ -n ${ESVN_UP_FREQ} ]]; then
265 if [[ -n ${ESVN_UP_FREQ//[[:digit:]]} ]]; then 277 if [[ -n ${ESVN_UP_FREQ//[[:digit:]]} ]]; then
373# @FUNCTION: subversion_src_unpack 385# @FUNCTION: subversion_src_unpack
374# @DESCRIPTION: 386# @DESCRIPTION:
375# Default src_unpack. Fetch and, in older EAPIs, bootstrap. 387# Default src_unpack. Fetch and, in older EAPIs, bootstrap.
376subversion_src_unpack() { 388subversion_src_unpack() {
377 subversion_fetch || die "${ESVN}: unknown problem occurred in subversion_fetch." 389 subversion_fetch || die "${ESVN}: unknown problem occurred in subversion_fetch."
378 has src_prepare ${EXPORTED_FUNCTIONS} || git_src_prepare 390 if has "${EAPI:-0}" 0 1; then
391 subversion_bootstrap || die "${ESVN}: unknown problem occurred in subversion_bootstrap."
392 fi
379} 393}
380 394
381# @FUNCTION: subversion_src_prepare 395# @FUNCTION: subversion_src_prepare
382# @DESCRIPTION: 396# @DESCRIPTION:
383# Default src_prepare. Bootstrap. 397# Default src_prepare. Bootstrap.

Legend:
Removed from v.1.65  
changed lines
  Added in v.1.67

  ViewVC Help
Powered by ViewVC 1.1.20