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

Diff of /eclass/subversion.eclass

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

Revision 1.16 Revision 1.17
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 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.16 2004/10/23 10:05:39 hattya Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/subversion.eclass,v 1.17 2005/01/20 09:51:17 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
100[ -z "${ESVN_PATCHES}" ] && ESVN_PATCHES="" 100[ -z "${ESVN_PATCHES}" ] && ESVN_PATCHES=""
101 101
102 102
103## -- subversion_svn_fetch() ------------------------------------------------- # 103## -- subversion_svn_fetch() ------------------------------------------------- #
104 104
105subversion_svn_fetch() { 105function subversion_svn_fetch() {
106 106
107 # ESVN_REPO_URI is empty. 107 # ESVN_REPO_URI is empty.
108 [ -z "${ESVN_REPO_URI}" ] && die "${ESVN}: ESVN_REPO_URI is empty." 108 [ -z "${ESVN_REPO_URI}" ] && die "${ESVN}: ESVN_REPO_URI is empty."
109 109
110 # check for the protocol. 110 # check for the protocol.
115 *) 115 *)
116 die "${ESVN}: fetch from "${ESVN_REPO_URI%:*}" is not yet implemented." 116 die "${ESVN}: fetch from "${ESVN_REPO_URI%:*}" is not yet implemented."
117 ;; 117 ;;
118 esac 118 esac
119 119
120 if [ ! -d "${ESVN_STORE_IR}" ]; then
121 debug-print "${FUNCNAME}: initial checkout. creating subversion directory"
122
123 addwrite /
124 mkdir -p "${ESVN_STORE_DIR}" || die "${ESVN}: can't mkdir ${ESVN_STORE_DIR}."
125 chmod -f o+rw "${ESVN_STORE_DIR}" || die "${ESVN}: can't chmod ${ESVN_STORE_DIR}."
126 export SANDBOX_WRITE="${SANDBOX_WRITE%%:/}"
127 fi
128
129 cd -P "${ESVN_STORE_DIR}" || die "${ESVN}: can't chdir to ${ESVN_STORE_DIR}"
130 ESVN_STORE_DIR=${PWD}
131
120 # every time 132 # every time
133 addwrite "/etc/subversion"
121 addwrite "${ESVN_STORE_DIR}" 134 addwrite "${ESVN_STORE_DIR}"
122 addwrite "/etc/subversion"
123 135
124 # -userpriv 136 # -userpriv
125 ! has userpriv ${FEATURE} && addwrite "/root/.subversion" 137 ! has userpriv ${FEATURE} && addwrite "/root/.subversion"
126 138
127 if [ ! -d "${ESVN_STORE_DIR}" ]; then 139 [ -z "${ESVN_REPO_URI##*/}" ] && ESVN_REPO_URI="${ESVN_REPO_URI%/}"
128 mkdir -p "${ESVN_STORE_DIR}" || die "${ESVN}: can't mkdir ${ESVN_STORE_DIR}."
129 chmod -f o+rw "${ESVN_STORE_DIR}" || die "${ESVN}: can't chmod ${ESVN_STORE_DIR}."
130
131 einfo "created store directory: ${ESVN_STORE_DIR}"
132 einfo
133 fi
134
135 cd "${ESVN_STORE_DIR}"
136
137 if [ -z "${ESVN_REPO_URI##*/}" ]; then
138 ESVN_REPO_FIX="${ESVN_REPO_URI%/}"
139
140 else
141 ESVN_REPO_FIX="${ESVN_REPO_URI}"
142
143 fi
144
145 ESVN_CO_DIR="${ESVN_PROJECT}/${ESVN_REPO_FIX##*/}" 140 ESVN_CO_DIR="${ESVN_PROJECT}/${ESVN_REPO_URI##*/}"
146 141
147 if [ ! -d "${ESVN_CO_DIR}/.svn" ]; then 142 if [ ! -d "${ESVN_CO_DIR}/.svn" ]; then
148 # first check out 143 # first check out
149 einfo "subversion check out start -->" 144 einfo "subversion check out start -->"
150 einfo " checkout from: ${ESVN_REPO_URI}" 145 einfo " checkout from: ${ESVN_REPO_URI}"
173 168
174 einfo " updated in: ${ESVN_STORE_DIR}/${ESVN_CO_DIR}" 169 einfo " updated in: ${ESVN_STORE_DIR}/${ESVN_CO_DIR}"
175 170
176 fi 171 fi
177 172
178 # permission fix for NFS (root_squash) with -userpriv
179 find ! -perm -o+rw -exec chmod o+rw {} \; 2>/dev/null
180
181 # copy to the ${WORKDIR} 173 # copy to the ${WORKDIR}
182 cp -Rf "${ESVN_STORE_DIR}/${ESVN_CO_DIR}" "${S}" || die "${ESVN}: can't copy to ${S}." 174 cp -Rf "${ESVN_STORE_DIR}/${ESVN_CO_DIR}" "${S}" || die "${ESVN}: can't copy to ${S}."
183 einfo " copied to: ${S}" 175 einfo " copied to: ${S}"
184 echo 176 echo
185 177
186} 178}
187 179
188 180
189## -- subversion_bootstrap() ------------------------------------------------ # 181## -- subversion_bootstrap() ------------------------------------------------ #
190 182
191subversion_bootstrap() { 183function subversion_bootstrap() {
184
185 local patch lpatch
192 186
193 cd "${S}" 187 cd "${S}"
194 188
195 if [ "${ESVN_PATCHES}" ]; then 189 if [ "${ESVN_PATCHES}" ]; then
196 einfo "apply patches -->" 190 einfo "apply patches -->"
197 191
198 for PATCH in ${ESVN_PATCHES}; do 192 for patch in ${ESVN_PATCHES}; do
199 if [ -f "${PATCH}" ]; then 193 if [ -f "${patch}" ]; then
200 epatch ${PATCH} 194 epatch ${patch}
201 195
202 else 196 else
203 for fPATCH in ${FILESDIR}/${PATCH}; do 197 for lpatch in ${FILESDIR}/${patch}; do
204 if [ -f "${fPATCH}" ]; then 198 if [ -f "${lpatch}" ]; then
205 epatch ${fPATCH} 199 epatch ${lpatch}
206 200
207 else 201 else
208 die "${ESVN}; ${PATCH} is not found" 202 die "${ESVN}; ${patch} is not found"
209 203
210 fi 204 fi
211 done 205 done
212 fi 206 fi
213 done 207 done
231} 225}
232 226
233 227
234## -- subversion_src_unpack() ------------------------------------------------ # 228## -- subversion_src_unpack() ------------------------------------------------ #
235 229
236subversion_src_unpack() { 230function subversion_src_unpack() {
237 231
238 subversion_svn_fetch || die "${ESVN}: unknown problem in subversion_svn_fetch()." 232 subversion_svn_fetch || die "${ESVN}: unknown problem in subversion_svn_fetch()."
239 subversion_bootstrap || die "${ESVN}: unknown problem in subversion_bootstrap()." 233 subversion_bootstrap || die "${ESVN}: unknown problem in subversion_bootstrap()."
240 234
241} 235}

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.20