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

Diff of /eclass/cvs.eclass

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

Revision 1.50 Revision 1.53
1# Copyright 1999-2003 Gentoo Technologies, Inc. 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/cvs.eclass,v 1.50 2004/01/04 14:35:12 coredumb Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.53 2004/10/19 19:51:12 vapier Exp $
4 4
5# Current Maintainer: Tal Peer <coredumb@gentoo.org> 5# Current Maintainer: Tal Peer <coredumb@gentoo.org>
6# Original Author: Dan Armak <danarmak@gentoo.org> 6# Original Author: Dan Armak <danarmak@gentoo.org>
7 7
8# SSH auth code by Danny <danny.milo@gmx.net> 8# SSH auth code by Danny <danny.milo@gmx.net>
108# 108#
109# Possible values are "pserver" and "ext". If `ext' authentication is 109# Possible values are "pserver" and "ext". If `ext' authentication is
110# used, the remote shell to use can be specified in CVS_RSH (SSH is 110# used, the remote shell to use can be specified in CVS_RSH (SSH is
111# used by default). Currently, the only supported remote shell for 111# used by default). Currently, the only supported remote shell for
112# `ext' authentication is SSH. 112# `ext' authentication is SSH.
113#
114# Armando Di Cianno <fafhrd@gentoo.org> 2004/09/27
115# - Added "no" as a server type, which uses no AUTH method, nor
116# does it login
117# e.g.
118# "cvs -danoncvs@savannah.gnu.org:/cvsroot/backbone co System"
119# ( from gnustep-apps/textedit )
113[ -z "$ECVS_AUTH" ] && ECVS_AUTH="pserver" 120[ -z "$ECVS_AUTH" ] && ECVS_AUTH="pserver"
114 121
115# ECVS_USER -- Username to use for authentication on the remote server 122# ECVS_USER -- Username to use for authentication on the remote server
116[ -z "$ECVS_USER" ] && ECVS_USER="anonymous" 123[ -z "$ECVS_USER" ] && ECVS_USER="anonymous"
117 124
268 fi 275 fi
269 276
270 277
271 # Our server string (i.e. CVSROOT) without the password so it can 278 # Our server string (i.e. CVSROOT) without the password so it can
272 # be put in Root 279 # be put in Root
280 if [ "$ECVS_AUTH" == "no" ]
281 then
282 local server="${ECVS_USER}@${ECVS_SERVER}"
283 else
273 local server=":${ECVS_AUTH}:${ECVS_USER}@${ECVS_SERVER}" 284 local server=":${ECVS_AUTH}:${ECVS_USER}@${ECVS_SERVER}"
285 fi
274 286
275 # Switch servers automagically if needed 287 # Switch servers automagically if needed
276 if [ "$mode" == "update" ]; then 288 if [ "$mode" == "update" ]; then
277 cd /$ECVS_TOP_DIR/$ECVS_LOCALNAME 289 cd /$ECVS_TOP_DIR/$ECVS_LOCALNAME
278 local oldserver="`$run cat CVS/Root`" 290 local oldserver="`$run cat CVS/Root`"
279 if [ "$server" != "$oldserver" ]; then 291 if [ "$server" != "$oldserver" ]; then
280 292
281 einfo "Changing the CVS server from $oldserver to $server:" 293 einfo "Changing the CVS server from $oldserver to $server:"
282 debug-print "$FUNCNAME: Changing the CVS server from $oldserver to $server:" 294 debug-print "$FUNCNAME: Changing the CVS server from $oldserver to $server:"
283 295
284 einfo "Searching for CVS directories..." 296 einfo "Searching for CVS directories ..."
285 local cvsdirs="`$run find . -iname CVS -print`" 297 local cvsdirs="`$run find . -iname CVS -print`"
286 debug-print "$FUNCNAME: CVS directories found:" 298 debug-print "$FUNCNAME: CVS directories found:"
287 debug-print "$cvsdirs" 299 debug-print "$cvsdirs"
288 300
289 einfo "Modifying CVS directories..." 301 einfo "Modifying CVS directories ..."
290 for x in $cvsdirs; do 302 for x in $cvsdirs; do
291 debug-print "In $x" 303 debug-print "In $x"
292 $run echo "$server" > "$x/Root" 304 $run echo "$server" > "$x/Root"
293 done 305 done
294 306
306 # The server string with the password in it, for login 318 # The server string with the password in it, for login
307 cvsroot_pass=":${ECVS_AUTH}:${ECVS_USER}:${ECVS_PASS}@${ECVS_SERVER}" 319 cvsroot_pass=":${ECVS_AUTH}:${ECVS_USER}:${ECVS_PASS}@${ECVS_SERVER}"
308 320
309 # Ditto without the password, for checkout/update after login, so 321 # Ditto without the password, for checkout/update after login, so
310 # that the CVS/Root files don't contain the password in plaintext 322 # that the CVS/Root files don't contain the password in plaintext
323 if [ "$ECVS_AUTH" == "no" ]
324 then
325 cvsroot_nopass="${ECVS_USER}@${ECVS_SERVER}"
326 else
311 cvsroot_nopass=":${ECVS_AUTH}:${ECVS_USER}@${ECVS_SERVER}" 327 cvsroot_nopass=":${ECVS_AUTH}:${ECVS_USER}@${ECVS_SERVER}"
328 fi
312 329
313 # Commands to run 330 # Commands to run
314 cmdlogin="${run} ${ECVS_CVS_COMMAND} -d \"${cvsroot_pass}\" login" 331 cmdlogin="${run} ${ECVS_CVS_COMMAND} -d \"${cvsroot_pass}\" login"
315 cmdupdate="${run} ${ECVS_CVS_COMMAND} -d \"${cvsroot_nopass}\" update ${ECVS_UP_OPTS} ${ECVS_LOCALNAME}" 332 cmdupdate="${run} ${ECVS_CVS_COMMAND} -d \"${cvsroot_nopass}\" update ${ECVS_UP_OPTS} ${ECVS_LOCALNAME}"
316 cmdcheckout="${run} ${ECVS_CVS_COMMAND} -d \"${cvsroot_nopass}\" checkout ${ECVS_CO_OPTS} ${ECVS_MODULE}" 333 cmdcheckout="${run} ${ECVS_CVS_COMMAND} -d \"${cvsroot_nopass}\" checkout ${ECVS_CO_OPTS} ${ECVS_MODULE}"
432 if [ "${CVS_ECLASS_ORIG_DISPLAY+set}" == "set" ]; then 449 if [ "${CVS_ECLASS_ORIG_DISPLAY+set}" == "set" ]; then
433 export DISPLAY="${CVS_ECLASS_ORIG_DISPLAY}" 450 export DISPLAY="${CVS_ECLASS_ORIG_DISPLAY}"
434 else 451 else
435 unset DISPLAY 452 unset DISPLAY
436 fi 453 fi
454 elif [ "${ECVS_AUTH}" == "no" ]; then
455 if [ "${mode}" == "update" ]; then
456 einfo "Running $cmdupdate"
457 eval $cmdupdate || die "cvs update command failed"
458 elif [ "${mode}" == "checkout" ]; then
459 einfo "Running $cmdcheckout"
460 eval $cmdcheckout|| die "cvs checkout command failed"
461 fi
437 fi 462 fi
438 463
439 # Restore ownership. Not sure why this is needed, but someone 464 # Restore ownership. Not sure why this is needed, but someone
440 # added it in the orig ECVS_RUNAS stuff. 465 # added it in the orig ECVS_RUNAS stuff.
441 if [ -n "$ECVS_RUNAS" ]; then 466 if [ -n "$ECVS_RUNAS" ]; then
478 else 503 else
479 debug-print "$FUNCNAME: Offline mode specified but directory ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} not found, exiting with error" 504 debug-print "$FUNCNAME: Offline mode specified but directory ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} not found, exiting with error"
480 die "ERROR: Offline mode specified, but directory ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} not found. Aborting." 505 die "ERROR: Offline mode specified, but directory ${ECVS_TOP_DIR}/${ECVS_LOCALNAME} not found. Aborting."
481 fi 506 fi
482 elif [ -n "$ECVS_SERVER" ]; then # ECVS_SERVER!=offline --> real fetching mode 507 elif [ -n "$ECVS_SERVER" ]; then # ECVS_SERVER!=offline --> real fetching mode
483 einfo "Fetching CVS module $ECVS_MODULE into $ECVS_TOP_DIR..." 508 einfo "Fetching CVS module $ECVS_MODULE into $ECVS_TOP_DIR ..."
484 cvs_fetch 509 cvs_fetch
485 else # ECVS_SERVER not set 510 else # ECVS_SERVER not set
486 die "ERROR: CVS server not specified, cannot continue." 511 die "ERROR: CVS server not specified, cannot continue."
487 fi 512 fi
488 513
489 einfo "Copying $ECVS_MODULE from $ECVS_TOP_DIR..." 514 einfo "Copying $ECVS_MODULE from $ECVS_TOP_DIR ..."
490 debug-print "Copying module $ECVS_MODULE local_mode=$ECVS_LOCAL from $ECVS_TOP_DIR..." 515 debug-print "Copying module $ECVS_MODULE local_mode=$ECVS_LOCAL from $ECVS_TOP_DIR ..."
491 516
492 # This is probably redundant, but best to make sure. 517 # This is probably redundant, but best to make sure.
493 mkdir -p "$WORKDIR/$ECVS_LOCALNAME" 518 mkdir -p "$WORKDIR/$ECVS_LOCALNAME"
494 519
495 if [ -n "$ECVS_LOCAL" ]; then 520 if [ -n "$ECVS_LOCAL" ]; then

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.53

  ViewVC Help
Powered by ViewVC 1.1.20