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

Diff of /eclass/subversion.eclass

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

Revision 1.33 Revision 1.34
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2006 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.33 2006/07/22 13:52:38 hattya Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/subversion.eclass,v 1.34 2006/09/03 13:01:57 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
136 local protocol=${repo_uri%%:*} 136 local protocol=${repo_uri%%:*}
137 137
138 case "${protocol}" in 138 case "${protocol}" in
139 http|https) 139 http|https)
140 if built_with_use dev-util/subversion nowebdav; then 140 if built_with_use dev-util/subversion nowebdav; then
141 echo
141 eerror "In order to emerge this package, you need to" 142 eerror "In order to emerge this package, you need to"
142 eerror "re-emerge subversion with USE=-nowebdav" 143 eerror "re-emerge subversion with USE=-nowebdav"
144 echo
143 die "Please run 'USE=-nowebdav emerge subversion'" 145 die "${ESVN}: please run 'USE=-nowebdav emerge subversion'"
144 fi 146 fi
145 ;; 147 ;;
146 svn|svn+ssh) 148 svn|svn+ssh)
147 ;; 149 ;;
148 *) 150 *)
151 esac 153 esac
152 154
153 if [[ ! -d "${ESVN_STORE_DIR}" ]]; then 155 if [[ ! -d "${ESVN_STORE_DIR}" ]]; then
154 debug-print "${FUNCNAME}: initial checkout. creating subversion directory" 156 debug-print "${FUNCNAME}: initial checkout. creating subversion directory"
155 157
156 addwrite /
157 mkdir -p "${ESVN_STORE_DIR}" || die "${ESVN}: can't mkdir ${ESVN_STORE_DIR}." 158 mkdir -p "${ESVN_STORE_DIR}" || die "${ESVN}: can't mkdir ${ESVN_STORE_DIR}."
158 export SANDBOX_WRITE=${SANDBOX_WRITE%%:/}
159 fi 159 fi
160 160
161 cd "${ESVN_STORE_DIR}" || die "${ESVN}: can't chdir to ${ESVN_STORE_DIR}" 161 cd "${ESVN_STORE_DIR}" || die "${ESVN}: can't chdir to ${ESVN_STORE_DIR}"
162 162
163 # every time 163 # every time
164 addwrite "/etc/subversion" 164 addread "/etc/subversion"
165 addwrite "${ESVN_STORE_DIR}"
166 165
167 if ! has userpriv ${FEATURES}; then
168 # -userpriv
169 addwrite "/root/.subversion"
170
171 else
172 # +userpriv
173 ESVN_OPTIONS="${ESVN_OPTIONS} --config-dir ${ESVN_STORE_DIR}/.subversion" 166 ESVN_OPTIONS="${ESVN_OPTIONS} --config-dir ${ESVN_STORE_DIR}/.subversion"
174
175 fi
176 167
177 local wc_path=${ESVN_PROJECT}/${repo_uri##*/} 168 local wc_path=${ESVN_PROJECT}/${repo_uri##*/}
178 169
179 debug-print "${FUNCNAME}: ESVN_OPTIONS = \"${ESVN_OPTIONS}\"" 170 debug-print "${FUNCNAME}: ESVN_OPTIONS = \"${ESVN_OPTIONS}\""
180 171
186 mkdir -p "${ESVN_PROJECT}" || die "${ESVN}: can't mkdir ${ESVN_PROJECT}." 177 mkdir -p "${ESVN_PROJECT}" || die "${ESVN}: can't mkdir ${ESVN_PROJECT}."
187 cd "${ESVN_PROJECT}" 178 cd "${ESVN_PROJECT}"
188 ${ESVN_FETCH_CMD} ${ESVN_OPTIONS} "${repo_uri}" || die "${ESVN}: can't fetch from ${repo_uri}." 179 ${ESVN_FETCH_CMD} ${ESVN_OPTIONS} "${repo_uri}" || die "${ESVN}: can't fetch from ${repo_uri}."
189 180
190 else 181 else
182 subversion_wc_info || die "${ESVN}: unknown problem occurred while accessing working copy."
183
184 if [[ "${ESVN_WC_URL}" != "${ESVN_REPO_URI}" ]]; then
185 die "${ESVN}: ESVN_REPO_URI and working copy's URL are not matched."
186 fi
187
191 # update working copy 188 # update working copy
192 einfo "subversion update start -->" 189 einfo "subversion update start -->"
193 einfo " repository: ${repo_uri}" 190 einfo " repository: ${repo_uri}"
194 191
195 cd "${wc_path}" 192 cd "${wc_path}"
270 267
271## -- subversion_src_unpack() ------------------------------------------------ # 268## -- subversion_src_unpack() ------------------------------------------------ #
272 269
273function subversion_src_unpack() { 270function subversion_src_unpack() {
274 271
275 subversion_fetch || die "${ESVN}: unknown problem in subversion_fetch()." 272 subversion_fetch || die "${ESVN}: unknown problem occurred in subversion_fetch."
276 subversion_bootstrap || die "${ESVN}: unknown problem in subversion_bootstrap()." 273 subversion_bootstrap || die "${ESVN}: unknown problem occurred in subversion_bootstrap."
277 274
278} 275}
279 276
280 277
281## -- subversion_wc_info() --------------------------------------------------- # 278## -- subversion_wc_info() --------------------------------------------------- #

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

  ViewVC Help
Powered by ViewVC 1.1.20