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

Diff of /eclass/subversion.eclass

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

Revision 1.46 Revision 1.63
1# Copyright 1999-2008 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.46 2008/02/20 17:11:34 zlin Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/subversion.eclass,v 1.63 2009/04/26 02:18:09 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>
9# Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
9# 10#
10# Original Author: Akinori Hattori <hattya@gentoo.org> 11# Original Author: Akinori Hattori <hattya@gentoo.org>
11# 12#
12# @BLURB: The subversion eclass is written to fetch software sources from subversion repositories 13# @BLURB: The subversion eclass is written to fetch software sources from subversion repositories
13# @DESCRIPTION: 14# @DESCRIPTION:
14# The subversion eclass provides functions to fetch, patch and bootstrap 15# The subversion eclass provides functions to fetch, patch and bootstrap
15# software sources from subversion repositories. 16# software sources from subversion repositories.
16#
17# You must define the ESVN_REPO_URI variable before inheriting this eclass.
18 17
19inherit eutils 18inherit eutils
20 19
21ESVN="${ECLASS}" 20ESVN="${ECLASS}"
22 21
23EXPORT_FUNCTIONS src_unpack 22EXPORT_FUNCTIONS src_unpack pkg_preinst
24 23
25DESCRIPTION="Based on the ${ECLASS} eclass" 24DESCRIPTION="Based on the ${ECLASS} eclass"
26 25
27DEPEND="dev-util/subversion 26DEPEND="dev-util/subversion
28 net-misc/rsync" 27 net-misc/rsync"
39 38
40# @ECLASS-VARIABLE: ESVN_UPDATE_CMD 39# @ECLASS-VARIABLE: ESVN_UPDATE_CMD
41# @DESCRIPTION: 40# @DESCRIPTION:
42# subversion update command 41# subversion update command
43ESVN_UPDATE_CMD="svn update" 42ESVN_UPDATE_CMD="svn update"
43
44# @ECLASS-VARIABLE: ESVN_SWITCH_CMD
45# @DESCRIPTION:
46# subversion switch command
47ESVN_SWITCH_CMD="svn switch"
44 48
45# @ECLASS-VARIABLE: ESVN_OPTIONS 49# @ECLASS-VARIABLE: ESVN_OPTIONS
46# @DESCRIPTION: 50# @DESCRIPTION:
47# the options passed to checkout or update. If you want a specific revision see 51# the options passed to checkout or update. If you want a specific revision see
48# ESVN_REPO_URI instead of using -rREV. 52# ESVN_REPO_URI instead of using -rREV.
61# svn+ssh:// 65# svn+ssh://
62# 66#
63# to peg to a specific revision, append @REV to the repo's uri 67# to peg to a specific revision, append @REV to the repo's uri
64ESVN_REPO_URI="${ESVN_REPO_URI:-}" 68ESVN_REPO_URI="${ESVN_REPO_URI:-}"
65 69
70# @ECLASS-VARIABLE: ESVN_REVISION
71# @DESCRIPTION:
72# User configurable revision checkout or update to from the repository
73#
74# Useful for live svn or trunk svn ebuilds allowing the user to peg
75# to a specific revision
76#
77# Note: This should never be set in an ebuild!
78ESVN_REVISION="${ESVN_REVISION:-}"
79
80# @ECLASS-VARIABLE: ESVN_USER
81# @DESCRIPTION:
82# User name
83ESVN_USER="${ESVN_USER:-}"
84
85# @ECLASS-VARIABLE: ESVN_PASSWORD
86# @DESCRIPTION:
87# Password
88ESVN_PASSWORD="${ESVN_PASSWORD:-}"
89
66# @ECLASS-VARIABLE: ESVN_PROJECT 90# @ECLASS-VARIABLE: ESVN_PROJECT
67# @DESCRIPTION: 91# @DESCRIPTION:
68# project name of your ebuild (= name space) 92# project name of your ebuild (= name space)
69# 93#
70# subversion eclass will check out the subversion repository like: 94# subversion eclass will check out the subversion repository like:
107# restrict. 131# restrict.
108# export) 132# export)
109# don't export the working copy to S. 133# don't export the working copy to S.
110ESVN_RESTRICT="${ESVN_RESTRICT:-}" 134ESVN_RESTRICT="${ESVN_RESTRICT:-}"
111 135
136# @ECLASS-VARIABLE: ESVN_OFFLINE
137# @DESCRIPTION:
138# Set this variable to a non-empty value to disable the automatic updating of
139# an svn source tree. This is intended to be set outside the subversion source
140# tree by users.
141ESVN_OFFLINE="${ESVN_OFFLINE:-${ESCM_OFFLINE}}"
142
143# @ECLASS-VARIABLE: ESVN_UP_FREQ
144# @DESCRIPTION:
145# Set the minimum number of hours between svn up'ing in any given svn module. This is particularly
146# useful for split KDE ebuilds where we want to ensure that all submodules are compiled for the same
147# revision. It should also be kept user overrideable.
148ESVN_UP_FREQ="${ESVN_UP_FREQ:=}"
149
150# @ECLASS-VARIABLE: ESCM_LOGDIR
151# @DESCRIPTION:
152# User configuration variable. If set to a path such as e.g. /var/log/scm any
153# package inheriting from subversion.eclass will record svn revision to
154# ${CATEGORY}/${PN}.log in that path in pkg_preinst. This is not supposed to be
155# set by ebuilds/eclasses. It defaults to empty so users need to opt in.
156ESCM_LOGDIR="${ESCM_LOGDIR:=}"
157
112# @FUNCTION: subversion_fetch 158# @FUNCTION: subversion_fetch
113# @USAGE: [repo_uri] [destination] 159# @USAGE: [repo_uri] [destination]
114# @DESCRIPTION: 160# @DESCRIPTION:
115# Wrapper function to fetch sources from subversion via svn checkout or svn update, 161# Wrapper function to fetch sources from subversion via svn checkout or svn update,
116# depending on whether there is an existing working copy in ${ESVN_STORE_DIR}. 162# depending on whether there is an existing working copy in ${ESVN_STORE_DIR}.
117# 163#
118# Can take two optional parameters: 164# Can take two optional parameters:
119# repo_uri - a repository URI. default is ESVN_REPO_URI. 165# repo_uri - a repository URI. default is ESVN_REPO_URI.
120# destination - a check out path in S. 166# destination - a check out path in S.
121subversion_fetch() { 167subversion_fetch() {
122 local repo_uri="$(subversion__get_repository_uri "${1}")" 168 local repo_uri="$(subversion__get_repository_uri "${1:-${ESVN_REPO_URI}}")"
169 local revision="$(subversion__get_peg_revision "${1:-${ESVN_REPO_URI}}")"
123 local S_dest="${2}" 170 local S_dest="${2}"
171
172 if [[ -z ${repo_uri} ]]; then
173 die "${ESVN}: ESVN_REPO_URI (or specified URI) is empty."
174 fi
175
176 [[ -n "${ESVN_REVISION}" ]] && revision="${ESVN_REVISION}"
124 177
125 # check for the protocol 178 # check for the protocol
126 local protocol="${repo_uri%%:*}" 179 local protocol="${repo_uri%%:*}"
127 180
128 case "${protocol}" in 181 case "${protocol}" in
129 http|https) 182 http|https)
183 if ! built_with_use --missing true -o dev-util/subversion webdav-neon webdav-serf || \
130 if built_with_use dev-util/subversion nowebdav; then 184 built_with_use --missing false dev-util/subversion nowebdav; then
131 echo 185 echo
132 eerror "In order to emerge this package, you need to" 186 eerror "In order to emerge this package, you need to"
133 eerror "re-emerge subversion with USE=-nowebdav" 187 eerror "reinstall Subversion with support for WebDAV."
188 eerror "Subversion requires either Neon or Serf to support WebDAV."
134 echo 189 echo
135 die "${ESVN}: please run 'USE=-nowebdav emerge subversion'" 190 die "${ESVN}: reinstall Subversion with support for WebDAV."
136 fi 191 fi
137 ;; 192 ;;
138 svn|svn+ssh) 193 svn|svn+ssh)
139 ;; 194 ;;
140 *) 195 *)
153 cd "${ESVN_STORE_DIR}" || die "${ESVN}: can't chdir to ${ESVN_STORE_DIR}" 208 cd "${ESVN_STORE_DIR}" || die "${ESVN}: can't chdir to ${ESVN_STORE_DIR}"
154 209
155 local wc_path="$(subversion__get_wc_path "${repo_uri}")" 210 local wc_path="$(subversion__get_wc_path "${repo_uri}")"
156 local options="${ESVN_OPTIONS} --config-dir ${ESVN_STORE_DIR}/.subversion" 211 local options="${ESVN_OPTIONS} --config-dir ${ESVN_STORE_DIR}/.subversion"
157 212
213 [[ -n "${revision}" ]] && options="${options} -r ${revision}"
214
215 if [[ "${ESVN_OPTIONS}" = *-r* ]]; then
216 ewarn "\${ESVN_OPTIONS} contains -r, this usage is unsupported. Please"
217 ewarn "see \${ESVN_REPO_URI}"
218 fi
219
220 if has_version ">=dev-util/subversion-1.6.0"; then
221 options="${options} --config-option=config:auth:password-stores="
222 fi
223
158 debug-print "${FUNCNAME}: wc_path = \"${wc_path}\"" 224 debug-print "${FUNCNAME}: wc_path = \"${wc_path}\""
159 debug-print "${FUNCNAME}: ESVN_OPTIONS = \"${ESVN_OPTIONS}\"" 225 debug-print "${FUNCNAME}: ESVN_OPTIONS = \"${ESVN_OPTIONS}\""
160 debug-print "${FUNCNAME}: options = \"${options}\"" 226 debug-print "${FUNCNAME}: options = \"${options}\""
161 227
162 if [[ ! -d ${wc_path}/.svn ]]; then 228 if [[ ! -d ${wc_path}/.svn ]]; then
229 if [[ -n ${ESVN_OFFLINE} ]]; then
230 ewarn "ESVN_OFFLINE cannot be used when there is no existing checkout."
231 fi
163 # first check out 232 # first check out
164 einfo "subversion check out start -->" 233 einfo "subversion check out start -->"
165 einfo " repository: ${repo_uri}" 234 einfo " repository: ${repo_uri}${revision:+@}${revision}"
166 235
167 debug-print "${FUNCNAME}: ${ESVN_FETCH_CMD} ${options} ${repo_uri}" 236 debug-print "${FUNCNAME}: ${ESVN_FETCH_CMD} ${options} ${repo_uri}"
168 237
169 mkdir -p "${ESVN_PROJECT}" || die "${ESVN}: can't mkdir ${ESVN_PROJECT}." 238 mkdir -p "${ESVN_PROJECT}" || die "${ESVN}: can't mkdir ${ESVN_PROJECT}."
170 cd "${ESVN_PROJECT}" || die "${ESVN}: can't chdir to ${ESVN_PROJECT}" 239 cd "${ESVN_PROJECT}" || die "${ESVN}: can't chdir to ${ESVN_PROJECT}"
240 if [[ -n "${ESVN_USER}" ]]; then
241 ${ESVN_FETCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" "${repo_uri}" || die "${ESVN}: can't fetch to ${wc_path} from ${repo_uri}."
242 else
171 ${ESVN_FETCH_CMD} ${options} "${repo_uri}" || die "${ESVN}: can't fetch from ${repo_uri}." 243 ${ESVN_FETCH_CMD} ${options} "${repo_uri}" || die "${ESVN}: can't fetch to ${wc_path} from ${repo_uri}."
244 fi
172 245
246 elif [[ -n ${ESVN_OFFLINE} ]]; then
247 svn cleanup "${wc_path}"
248 subversion_wc_info "${repo_uri}" || die "${ESVN}: unknown problem occurred while accessing working copy."
249 if [[ -n ${ESVN_REVISION} && ${ESVN_REVISION} != ${ESVN_WC_REVISION} ]]; then
250 die "${ESVN}: You requested off-line updating and revision ${ESVN_REVISION} but only revision ${ESVN_WC_REVISION} is available locally."
251 fi
252 einfo "Fetching disabled: Using existing repository copy at revision ${ESVN_WC_REVISION}."
173 else 253 else
254 svn cleanup "${wc_path}"
174 subversion_wc_info "${repo_uri}" || die "${ESVN}: unknown problem occurred while accessing working copy." 255 subversion_wc_info "${repo_uri}" || die "${ESVN}: unknown problem occurred while accessing working copy."
175 256
257 local esvn_up_freq=
258 if [[ -n ${ESVN_UP_FREQ} ]]; then
259 if [[ -n ${ESVN_UP_FREQ//[[:digit:]]} ]]; then
260 die "${ESVN}: ESVN_UP_FREQ must be an integer value corresponding to the minimum number of hours between svn up."
261 elif [[ -z $(find "${wc_path}/.svn/entries" -mmin "+$((ESVN_UP_FREQ*60))") ]]; then
262 einfo "Fetching disabled since ${ESVN_UP_FREQ} hours has not passed since last update."
263 einfo "Using existing repository copy at revision ${ESVN_WC_REVISION}."
264 esvn_up_freq=no_update
265 fi
266 fi
267
268 if [[ -z ${esvn_up_freq} ]]; then
176 if [[ ${ESVN_WC_URL} != $(subversion__get_repository_uri "${repo_uri}" 1) ]]; then 269 if [[ ${ESVN_WC_URL} != $(subversion__get_repository_uri "${repo_uri}") ]]; then
177 die "${ESVN}: ESVN_REPO_URI (or specified URI) and working copy's URL are not matched."
178 fi
179
180 # update working copy
181 einfo "subversion update start -->" 270 einfo "subversion switch start -->"
182 einfo " repository: ${repo_uri}" 271 einfo " old repository: ${ESVN_WC_URL}@${ESVN_WC_REVISION}"
272 einfo " new repository: ${repo_uri}${revision:+@}${revision}"
183 273
184 debug-print "${FUNCNAME}: ${ESVN_UPDATE_CMD} ${options}" 274 debug-print "${FUNCNAME}: ${ESVN_SWITCH_CMD} ${options} ${repo_uri}"
185 275
186 cd "${wc_path}" || die "${ESVN}: can't chdir to ${wc_path}" 276 cd "${wc_path}" || die "${ESVN}: can't chdir to ${wc_path}"
277 if [[ -n "${ESVN_USER}" ]]; then
278 ${ESVN_SWITCH_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" ${repo_uri} || die "${ESVN}: can't update ${wc_path} from ${repo_uri}."
279 else
280 ${ESVN_SWITCH_CMD} ${options} ${repo_uri} || die "${ESVN}: can't update ${wc_path} from ${repo_uri}."
281 fi
282 else
283 # update working copy
284 einfo "subversion update start -->"
285 einfo " repository: ${repo_uri}${revision:+@}${revision}"
286
287 debug-print "${FUNCNAME}: ${ESVN_UPDATE_CMD} ${options}"
288
289 cd "${wc_path}" || die "${ESVN}: can't chdir to ${wc_path}"
290 if [[ -n "${ESVN_USER}" ]]; then
291 ${ESVN_UPDATE_CMD} ${options} --username "${ESVN_USER}" --password "${ESVN_PASSWORD}" || die "${ESVN}: can't update ${wc_path} from ${repo_uri}."
292 else
187 ${ESVN_UPDATE_CMD} ${options} || die "${ESVN}: can't update from ${repo_uri}." 293 ${ESVN_UPDATE_CMD} ${options} || die "${ESVN}: can't update ${wc_path} from ${repo_uri}."
188 294 fi
295 fi
296 fi
189 fi 297 fi
190 298
191 einfo " working copy: ${wc_path}" 299 einfo " working copy: ${wc_path}"
192 300
193 if ! has "export" ${ESVN_RESTRICT}; then 301 if ! has "export" ${ESVN_RESTRICT}; then
194 cd "${wc_path}" || die "${ESVN}: can't chdir to ${wc_path}" 302 cd "${wc_path}" || die "${ESVN}: can't chdir to ${wc_path}"
195 303
196 local S="${S}/${S_dest}" 304 local S="${S}/${S_dest}"
305 mkdir -p "${S}"
197 306
198 # export to the ${WORKDIR} 307 # export to the ${WORKDIR}
199 #* "svn export" has a bug. see http://bugs.gentoo.org/119236 308 #* "svn export" has a bug. see http://bugs.gentoo.org/119236
200 #* svn export . "${S}" || die "${ESVN}: can't export to ${S}." 309 #* svn export . "${S}" || die "${ESVN}: can't export to ${S}."
201 rsync -rlpgo --exclude=".svn/" . "${S}" || die "${ESVN}: can't export to ${S}." 310 rsync -rlpgo --exclude=".svn/" . "${S}" || die "${ESVN}: can't export to ${S}."
263 subversion_bootstrap || die "${ESVN}: unknown problem occurred in subversion_bootstrap." 372 subversion_bootstrap || die "${ESVN}: unknown problem occurred in subversion_bootstrap."
264} 373}
265 374
266# @FUNCTION: subversion_wc_info 375# @FUNCTION: subversion_wc_info
267# @USAGE: [repo_uri] 376# @USAGE: [repo_uri]
268# @RETURN: ESVN_WC_URL, ESVN_WC_REVISION and ESVN_WC_PATH 377# @RETURN: ESVN_WC_URL, ESVN_WC_ROOT, ESVN_WC_UUID, ESVN_WC_REVISION and ESVN_WC_PATH
269# @DESCRIPTION: 378# @DESCRIPTION:
270# Get svn info for the specified repo_uri. The default repo_uri is ESVN_REPO_URI. 379# Get svn info for the specified repo_uri. The default repo_uri is ESVN_REPO_URI.
271# 380#
272# The working copy information on the specified repository URI are set to 381# The working copy information on the specified repository URI are set to
273# ESVN_WC_* variables. 382# ESVN_WC_* variables.
274subversion_wc_info() { 383subversion_wc_info() {
275 local repo_uri="$(subversion__get_repository_uri "${1}")" 384 local repo_uri="$(subversion__get_repository_uri "${1:-${ESVN_REPO_URI}}")"
276 local wc_path="$(subversion__get_wc_path "${repo_uri}")" 385 local wc_path="$(subversion__get_wc_path "${repo_uri}")"
277 386
278 debug-print "${FUNCNAME}: repo_uri = ${repo_uri}" 387 debug-print "${FUNCNAME}: repo_uri = ${repo_uri}"
279 debug-print "${FUNCNAME}: wc_path = ${wc_path}" 388 debug-print "${FUNCNAME}: wc_path = ${wc_path}"
280 389
281 if [[ ! -d ${wc_path} ]]; then 390 if [[ ! -d ${wc_path} ]]; then
282 return 1 391 return 1
283 fi 392 fi
284 393
285 local k 394 export ESVN_WC_URL="$(subversion__svn_info "${wc_path}" "URL")"
286 395 export ESVN_WC_ROOT="$(subversion__svn_info "${wc_path}" "Repository Root")"
287 for k in url revision; do 396 export ESVN_WC_UUID="$(subversion__svn_info "${wc_path}" "Repository UUID")"
288 export ESVN_WC_$(subversion__to_upper_case "${k}")="$(subversion__svn_info "${wc_path}" "${k}")" 397 export ESVN_WC_REVISION="$(subversion__svn_info "${wc_path}" "Revision")"
289 done
290
291 export ESVN_WC_PATH="${wc_path}" 398 export ESVN_WC_PATH="${wc_path}"
292} 399}
293 400
294## -- Private Functions 401## -- Private Functions
295 402
306} 413}
307 414
308## -- subversion__get_repository_uri() --------------------------------------- # 415## -- subversion__get_repository_uri() --------------------------------------- #
309# 416#
310# param $1 - a repository URI. 417# param $1 - a repository URI.
311# param $2 - a peg revision is deleted from a return value if this is
312# specified.
313subversion__get_repository_uri() { 418subversion__get_repository_uri() {
314 local repo_uri="${1:-${ESVN_REPO_URI}}" 419 local repo_uri="${1}"
315 local remove_peg_revision="${2}"
316 420
317 debug-print "${FUNCNAME}: repo_uri = ${repo_uri}" 421 debug-print "${FUNCNAME}: repo_uri = ${repo_uri}"
318 debug-print "${FUNCNAME}: remove_peg_revision = ${remove_peg_revision}"
319 422
320 if [[ -z ${repo_uri} ]]; then 423 if [[ -z ${repo_uri} ]]; then
321 die "${ESVN}: ESVN_REPO_URI (or specified URI) is empty." 424 die "${ESVN}: ESVN_REPO_URI (or specified URI) is empty."
322 fi 425 fi
323 426
324 # delete trailing slash 427 # delete trailing slash
325 if [[ -z ${repo_uri##*/} ]]; then 428 if [[ -z ${repo_uri##*/} ]]; then
326 repo_uri="${repo_uri%/}" 429 repo_uri="${repo_uri%/}"
327 fi 430 fi
328 431
329 if [[ -n ${remove_peg_revision} ]]; then
330 if subversion__has_peg_revision "${repo_uri}"; then
331 repo_uri="${repo_uri%@*}" 432 repo_uri="${repo_uri%@*}"
332
333 debug-print "${FUNCNAME}: repo_uri has a peg revision"
334 debug-print "${FUNCNAME}: repo_uri = ${repo_uri}"
335 fi
336 fi
337 433
338 echo "${repo_uri}" 434 echo "${repo_uri}"
339} 435}
340 436
341## -- subversion__get_wc_path() ---------------------------------------------- # 437## -- subversion__get_wc_path() ---------------------------------------------- #
342# 438#
343# param $1 - a repository URI. 439# param $1 - a repository URI.
344subversion__get_wc_path() { 440subversion__get_wc_path() {
345 local repo_uri="$(subversion__get_repository_uri "${1}" 1)" 441 local repo_uri="$(subversion__get_repository_uri "${1}")"
346 442
347 debug-print "${FUNCNAME}: repo_uri = ${repo_uri}" 443 debug-print "${FUNCNAME}: repo_uri = ${repo_uri}"
348 444
349 echo "${ESVN_STORE_DIR}/${ESVN_PROJECT}/${repo_uri##*/}" 445 echo "${ESVN_STORE_DIR}/${ESVN_PROJECT}/${repo_uri##*/}"
350} 446}
351 447
352## -- subversion__has_peg_revision() ----------------------------------------- # 448## -- subversion__get_peg_revision() ----------------------------------------- #
353# 449#
354# param $1 - a repository URI. 450# param $1 - a repository URI.
355subversion__has_peg_revision() { 451subversion__get_peg_revision() {
356 local repo_uri="${1}" 452 local repo_uri="${1}"
357 453
358 debug-print "${FUNCNAME}: repo_uri = ${repo_uri}" 454 debug-print "${FUNCNAME}: repo_uri = ${repo_uri}"
359 455
360 # repo_uri has peg revision ? 456 # repo_uri has peg revision ?
361 if [[ ${repo_uri} != *@* ]]; then 457 if [[ ${repo_uri} != *@* ]]; then
362 debug-print "${FUNCNAME}: repo_uri does not have a peg revision." 458 debug-print "${FUNCNAME}: repo_uri does not have a peg revision."
363 return 1
364 fi 459 fi
365 460
366 local peg_rev="${repo_uri##*@}" 461 local peg_rev=
367 462 [[ ${repo_uri} = *@* ]] && peg_rev="${repo_uri##*@}"
368 case "$(subversion__to_upper_case "${peg_rev}")" in
369 [[:digit:]]*)
370 # NUMBER
371 ;;
372 HEAD|BASE|COMMITED|PREV)
373 ;;
374 {[^}]*})
375 # DATE
376 ;;
377 *)
378 debug-print "${FUNCNAME}: repo_uri does not have a peg revision."
379 return 1
380 ;;
381 esac
382 463
383 debug-print "${FUNCNAME}: peg_rev = ${peg_rev}" 464 debug-print "${FUNCNAME}: peg_rev = ${peg_rev}"
384 465
385 return 0 466 echo "${peg_rev}"
386} 467}
387 468
388## -- subversion__to_upper_case() ----------------------------------------- # 469# @FUNCTION: subversion_pkg_preinst
389# 470# @USAGE: [repo_uri]
390# param $@ - the strings to upper case. 471# @DESCRIPTION:
391subversion__to_upper_case() { 472# Log the svn revision of source code. Doing this in pkg_preinst because we
392 echo "${@}" | tr "[:lower:]" "[:upper:]" 473# want the logs to stick around if packages are uninstalled without messing with
474# config protection.
475subversion_pkg_preinst() {
476 local pkgdate=$(date "+%Y%m%d %H:%M:%S")
477 subversion_wc_info "${1:-${ESVN_REPO_URI}}"
478 if [[ -n ${ESCM_LOGDIR} ]]; then
479 local dir="${ROOT}/${ESCM_LOGDIR}/${CATEGORY}"
480 if [[ ! -d ${dir} ]]; then
481 mkdir -p "${dir}" || \
482 eerror "Failed to create '${dir}' for logging svn revision to '${PORTDIR_SCM}'"
483 fi
484 local logmessage="svn: ${pkgdate} - ${PF}:${SLOT} was merged at revision ${ESVN_WC_REVISION}"
485 if [[ -d ${dir} ]]; then
486 echo "${logmessage}" >> "${dir}/${PN}.log"
487 else
488 eerror "Could not log the message '${logmessage}' to '${dir}/${PN}.log'"
489 fi
490 fi
393} 491}

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.63

  ViewVC Help
Powered by ViewVC 1.1.20