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

Diff of /eclass/cvs.eclass

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

Revision 1.59 Revision 1.67
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.59 2005/08/13 08:10:53 phreak Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.67 2006/12/11 00:11:46 vapier Exp $
4#
5# Maintainer: vapier@gentoo.org (and anyone who wants to help)
4 6
5# Current Maintainer: Tal Peer <coredumb@gentoo.org> 7inherit eutils
6# Original Author: Dan Armak <danarmak@gentoo.org>
7
8# SSH auth code by Danny <danny.milo@gmx.net>
9
10# SSH password authentication support and host key verification
11# support by Jeremy Maitin-Shepard <jbms@gentoo.org>
12
13 8
14# This eclass provides the generic cvs fetching functions. To use 9# This eclass provides the generic cvs fetching functions. To use
15# this from an ebuild, set the `ebuild-configurable settings' as 10# this from an ebuild, set the `ebuild-configurable settings' as
16# specified below in your ebuild before inheriting. Then either leave 11# specified below in your ebuild before inheriting. Then either leave
17# the default src_unpack or extend over cvs_src_unpack. If you find 12# the default src_unpack or extend over cvs_src_unpack. If you find
38# You can set, for example, "cvs -t" for extensive debug information 33# You can set, for example, "cvs -t" for extensive debug information
39# 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
40# quiet, to disregard the ~/.cvsrc config file and to use maximum 35# quiet, to disregard the ~/.cvsrc config file and to use maximum
41# compression. 36# compression.
42 37
43[ -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}"
44 41
45 42
46# 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
47# command (update or checkout). 44# command (update or checkout).
48# 45#
69 66
70 67
71# ECVS_TOP_DIR -- The directory under which CVS modules are checked 68# ECVS_TOP_DIR -- The directory under which CVS modules are checked
72# out. 69# out.
73 70
74[ -z "$ECVS_TOP_DIR" ] && ECVS_TOP_DIR="${DISTDIR}/cvs-src" 71[ -z "$ECVS_TOP_DIR" ] && ECVS_TOP_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/cvs-src"
75 72
76# ECVS_SERVER -- CVS path 73# ECVS_SERVER -- CVS path
77# 74#
78# 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".
79# 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
118[ -z "$ECVS_AUTH" ] && ECVS_AUTH="pserver" 115[ -z "$ECVS_AUTH" ] && ECVS_AUTH="pserver"
119 116
120# ECVS_USER -- Username to use for authentication on the remote server 117# ECVS_USER -- Username to use for authentication on the remote server
121[ -z "$ECVS_USER" ] && ECVS_USER="anonymous" 118[ -z "$ECVS_USER" ] && ECVS_USER="anonymous"
122 119
123
124# ECVS_PASS -- Password to use for authentication on the remote server 120# ECVS_PASS -- Password to use for authentication on the remote server
125[ -z "$ECVS_PASS" ] && ECVS_PASS="" 121[ -z "$ECVS_PASS" ] && ECVS_PASS=""
126 122
127 123
128# ECVS_SSH_HOST_KEY 124# ECVS_SSH_HOST_KEY
155# --- end ebuild-configurable settings --- 151# --- end ebuild-configurable settings ---
156 152
157# add cvs to deps 153# add cvs to deps
158# ssh is used for ext auth 154# ssh is used for ext auth
159# sudo is used to run as a specified user 155# sudo is used to run as a specified user
160DEPEND="dev-util/cvs app-admin/sudo" 156DEPEND="dev-util/cvs"
157
158[ -n "$ECVS_RUNAS" ] && DEPEND="$DEPEND app-admin/sudo"
161 159
162if [ "$ECVS_AUTH" == "ext" ]; then 160if [ "$ECVS_AUTH" == "ext" ]; then
163 #default to ssh 161 #default to ssh
164 [ -z "$CVS_RSH" ] && export CVS_RSH="ssh" 162 [ -z "$CVS_RSH" ] && export CVS_RSH="ssh"
165 if [ "$CVS_RSH" != "ssh" ]; then 163 if [ "$CVS_RSH" != "ssh" ]; then
175 # not affected by modifications in this function. 173 # not affected by modifications in this function.
176 174
177 local ECVS_COMMAND="${ECVS_COMMAND}" 175 local ECVS_COMMAND="${ECVS_COMMAND}"
178 local ECVS_UP_OPTS="${ECVS_UP_OPTS}" 176 local ECVS_UP_OPTS="${ECVS_UP_OPTS}"
179 local ECVS_CO_OPTS="${ECVS_CO_OPTS}" 177 local ECVS_CO_OPTS="${ECVS_CO_OPTS}"
180
181 # Fix for sourceforge which doesnt want -z>3 anymore.
182
183 (echo $ECVS_SERVER | grep -q sourceforge) \
184 && [ "$ECVS_CVS_COMMAND" == "cvs -q -f -z4" ] \
185 && ECVS_CVS_COMMAND="cvs -q -f -z3"
186 178
187 debug-print-function $FUNCNAME $* 179 debug-print-function $FUNCNAME $*
188 180
189 # Update variables that are modified by ebuild parameters, which 181 # Update variables that are modified by ebuild parameters, which
190 # 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
276 # be put in Root 268 # be put in Root
277 if [ "$ECVS_AUTH" == "no" ] 269 if [ "$ECVS_AUTH" == "no" ]
278 then 270 then
279 local server="${ECVS_USER}@${ECVS_SERVER}" 271 local server="${ECVS_USER}@${ECVS_SERVER}"
280 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}"
281 local server=":${ECVS_AUTH}:${ECVS_USER}@${ECVS_SERVER}" 276 local server=":${connection}:${ECVS_USER}@${ECVS_SERVER}"
282 fi 277 fi
283 278
284 # Switch servers automagically if needed 279 # Switch servers automagically if needed
285 if [ "$mode" == "update" ]; then 280 if [ "$mode" == "update" ]; then
286 cd /$ECVS_TOP_DIR/$ECVS_LOCALNAME 281 cd /$ECVS_TOP_DIR/$ECVS_LOCALNAME
488 [ -z "$ECVS_MODULE" ] && die "ERROR: CVS module not set, cannot continue." 483 [ -z "$ECVS_MODULE" ] && die "ERROR: CVS module not set, cannot continue."
489 484
490 local ECVS_LOCALNAME="${ECVS_LOCALNAME}" 485 local ECVS_LOCALNAME="${ECVS_LOCALNAME}"
491 486
492 if [ -z "$ECVS_LOCALNAME" ]; then 487 if [ -z "$ECVS_LOCALNAME" ]; then
493 ECVS_LOCALNAME="$ECVS_MODULE" 488 ECVS_LOCALNAME="$ECVS_MODULE"
494 fi 489 fi
495 490
496 if [ "$ECVS_SERVER" == "offline" ]; then 491 local offline_pkg_var="ECVS_OFFLINE_${PN}"
492 if [ "${!offline_pkg_var}" == "1" -o "$ECVS_OFFLINE" == "1" -o "$ECVS_SERVER" == "offline" ]; then
497 # We're not required to fetch anything; the module already 493 # We're not required to fetch anything; the module already
498 # exists and shouldn't be updated. 494 # exists and shouldn't be updated.
499 if [ -d "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" ]; then 495 if [ -d "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" ]; then
500 debug-print "$FUNCNAME: offline mode" 496 debug-print "$FUNCNAME: offline mode"
501 else 497 else
502 debug-print "$FUNCNAME: Offline mode specified but directory ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} not found, exiting with error" 498 debug-print "$FUNCNAME: Offline mode specified but directory ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} not found, exiting with error"
503 die "ERROR: Offline mode specified, but directory ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} not found. Aborting." 499 die "ERROR: Offline mode specified, but directory ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} not found. Aborting."
504 fi 500 fi
533 # Implement some of base_src_unpack's functionality; note however 529 # Implement some of base_src_unpack's functionality; note however
534 # that base.eclass may not have been inherited! 530 # that base.eclass may not have been inherited!
535 if [ -n "$PATCHES" ]; then 531 if [ -n "$PATCHES" ]; then
536 debug-print "$FUNCNAME: PATCHES=$PATCHES, S=$S, autopatching" 532 debug-print "$FUNCNAME: PATCHES=$PATCHES, S=$S, autopatching"
537 cd "$S" 533 cd "$S"
538 for x in $PATCHES; do 534 epatch ${PATCHES}
539 debug-print "patching from $x"
540 patch -p0 < "$x"
541 done
542 # Make sure we don't try to apply patches more than once, 535 # Make sure we don't try to apply patches more than once,
543 # since cvs_src_unpack is usually called several times from 536 # since cvs_src_unpack is usually called several times from
544 # e.g. kde-source_src_unpack 537 # e.g. kde-source_src_unpack
545 export PATCHES="" 538 export PATCHES=""
546 fi 539 fi

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

  ViewVC Help
Powered by ViewVC 1.1.20