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

Diff of /eclass/cvs.eclass

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

Revision 1.61 Revision 1.68
1# Copyright 1999-2004 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/cvs.eclass,v 1.61 2005/09/21 23:22:56 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.68 2006/12/11 00:16:28 vapier Exp $
4#
5# Maintainer: vapier@gentoo.org (and anyone who wants to help)
4 6
5inherit eutils 7inherit eutils
6 8
7# This eclass provides the generic cvs fetching functions. To use 9# This eclass provides the generic cvs fetching functions. To use
8# this from an ebuild, set the `ebuild-configurable settings' as 10# this from an ebuild, set the `ebuild-configurable settings' as
31# You can set, for example, "cvs -t" for extensive debug information 33# You can set, for example, "cvs -t" for extensive debug information
32# on the cvs connection. The default of "cvs -q -f -z4" means to be 34# on the cvs connection. The default of "cvs -q -f -z4" means to be
33# quiet, to disregard the ~/.cvsrc config file and to use maximum 35# quiet, to disregard the ~/.cvsrc config file and to use maximum
34# compression. 36# compression.
35 37
36[ -z "$ECVS_CVS_COMMAND" ] && ECVS_CVS_COMMAND="cvs -q -f -z4" 38[[ -z ${ECVS_CVS_COMPRESS} ]] && ECVS_CVS_COMPRESS="-z1"
39[[ -z ${ECVS_CVS_OPTIONS} ]] && ECVS_CVS_OPTIONS="-q -f"
40[[ -z ${ECVS_CVS_COMMAND} ]] && ECVS_CVS_COMMAND="cvs ${ECVS_CVS_OPTIONS} ${ECVS_CVS_COMPRESS}"
37 41
38 42
39# ECVS_UP_OPTS, ECVS_CO_OPTS -- CVS options given after the cvs 43# ECVS_UP_OPTS, ECVS_CO_OPTS -- CVS options given after the cvs
40# command (update or checkout). 44# command (update or checkout).
41# 45#
62 66
63 67
64# ECVS_TOP_DIR -- The directory under which CVS modules are checked 68# ECVS_TOP_DIR -- The directory under which CVS modules are checked
65# out. 69# out.
66 70
67[ -z "$ECVS_TOP_DIR" ] && ECVS_TOP_DIR="${DISTDIR}/cvs-src" 71[ -z "$ECVS_TOP_DIR" ] && ECVS_TOP_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/cvs-src"
68 72
69# ECVS_SERVER -- CVS path 73# ECVS_SERVER -- CVS path
70# 74#
71# The format is "server:/dir", e.g. "anoncvs.kde.org:/home/kde". 75# The format is "server:/dir", e.g. "anoncvs.kde.org:/home/kde".
72# Remove the other parts of the full CVSROOT, which might look like 76# Remove the other parts of the full CVSROOT, which might look like
111[ -z "$ECVS_AUTH" ] && ECVS_AUTH="pserver" 115[ -z "$ECVS_AUTH" ] && ECVS_AUTH="pserver"
112 116
113# ECVS_USER -- Username to use for authentication on the remote server 117# ECVS_USER -- Username to use for authentication on the remote server
114[ -z "$ECVS_USER" ] && ECVS_USER="anonymous" 118[ -z "$ECVS_USER" ] && ECVS_USER="anonymous"
115 119
116
117# ECVS_PASS -- Password to use for authentication on the remote server 120# ECVS_PASS -- Password to use for authentication on the remote server
118[ -z "$ECVS_PASS" ] && ECVS_PASS="" 121[ -z "$ECVS_PASS" ] && ECVS_PASS=""
119 122
120 123
121# ECVS_SSH_HOST_KEY 124# ECVS_SSH_HOST_KEY
170 # not affected by modifications in this function. 173 # not affected by modifications in this function.
171 174
172 local ECVS_COMMAND="${ECVS_COMMAND}" 175 local ECVS_COMMAND="${ECVS_COMMAND}"
173 local ECVS_UP_OPTS="${ECVS_UP_OPTS}" 176 local ECVS_UP_OPTS="${ECVS_UP_OPTS}"
174 local ECVS_CO_OPTS="${ECVS_CO_OPTS}" 177 local ECVS_CO_OPTS="${ECVS_CO_OPTS}"
175
176 # Fix for sourceforge which doesnt want -z>3 anymore.
177
178 (echo $ECVS_SERVER | grep -q sourceforge) \
179 && [ "$ECVS_CVS_COMMAND" == "cvs -q -f -z4" ] \
180 && ECVS_CVS_COMMAND="cvs -q -f -z3"
181 178
182 debug-print-function $FUNCNAME $* 179 debug-print-function $FUNCNAME $*
183 180
184 # Update variables that are modified by ebuild parameters, which 181 # Update variables that are modified by ebuild parameters, which
185 # should be effective every time cvs_fetch is called, and not just 182 # should be effective every time cvs_fetch is called, and not just
271 # be put in Root 268 # be put in Root
272 if [ "$ECVS_AUTH" == "no" ] 269 if [ "$ECVS_AUTH" == "no" ]
273 then 270 then
274 local server="${ECVS_USER}@${ECVS_SERVER}" 271 local server="${ECVS_USER}@${ECVS_SERVER}"
275 else 272 else
273 local connection="${ECVS_AUTH}"
274 [[ -n ${ECVS_PROXY} ]] && connection="${connection};proxy=${ECVS_PROXY}"
275 [[ -n ${ECVS_PROXY_PORT} ]] && connection="${connection};proxyport=${ECVS_PROXY_PORT}"
276 local server=":${ECVS_AUTH}:${ECVS_USER}@${ECVS_SERVER}" 276 local server=":${connection}:${ECVS_USER}@${ECVS_SERVER}"
277 fi 277 fi
278 278
279 # Switch servers automagically if needed 279 # Switch servers automagically if needed
280 if [ "$mode" == "update" ]; then 280 if [ "$mode" == "update" ]; then
281 cd /$ECVS_TOP_DIR/$ECVS_LOCALNAME 281 cd /$ECVS_TOP_DIR/$ECVS_LOCALNAME
483 [ -z "$ECVS_MODULE" ] && die "ERROR: CVS module not set, cannot continue." 483 [ -z "$ECVS_MODULE" ] && die "ERROR: CVS module not set, cannot continue."
484 484
485 local ECVS_LOCALNAME="${ECVS_LOCALNAME}" 485 local ECVS_LOCALNAME="${ECVS_LOCALNAME}"
486 486
487 if [ -z "$ECVS_LOCALNAME" ]; then 487 if [ -z "$ECVS_LOCALNAME" ]; then
488 ECVS_LOCALNAME="$ECVS_MODULE" 488 ECVS_LOCALNAME="$ECVS_MODULE"
489 fi 489 fi
490 490
491 if [ "$ECVS_SERVER" == "offline" ]; then 491 local sanitized_pn=$(echo "${PN}" | LC_ALL=C sed -e 's:[^A-Za-z0-9_]:_:g')
492 local offline_pkg_var="ECVS_OFFLINE_${sanitized_pn}"
493 if [ "${!offline_pkg_var}" == "1" -o "$ECVS_OFFLINE" == "1" -o "$ECVS_SERVER" == "offline" ]; then
492 # We're not required to fetch anything; the module already 494 # We're not required to fetch anything; the module already
493 # exists and shouldn't be updated. 495 # exists and shouldn't be updated.
494 if [ -d "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" ]; then 496 if [ -d "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" ]; then
495 debug-print "$FUNCNAME: offline mode" 497 debug-print "$FUNCNAME: offline mode"
496 else 498 else
497 debug-print "$FUNCNAME: Offline mode specified but directory ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} not found, exiting with error" 499 debug-print "$FUNCNAME: Offline mode specified but directory ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} not found, exiting with error"
498 die "ERROR: Offline mode specified, but directory ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} not found. Aborting." 500 die "ERROR: Offline mode specified, but directory ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} not found. Aborting."
499 fi 501 fi

Legend:
Removed from v.1.61  
changed lines
  Added in v.1.68

  ViewVC Help
Powered by ViewVC 1.1.20