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

Diff of /eclass/cvs.eclass

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

Revision 1.31 Revision 1.32
1# Copyright 1999-2003 Gentoo Technologies, Inc. 1# Copyright 1999-2003 Gentoo Technologies, Inc.
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.31 2003/02/16 04:26:21 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.32 2003/02/21 14:07:46 phoenix Exp $
4# 4#
5# Author Dan Armak <danarmak@gentoo.org> 5# Author Dan Armak <danarmak@gentoo.org>
6# 6#
7# This eclass provides the generic cvs fetching functions. 7# This eclass provides the generic cvs fetching functions.
8 8
49[ -z "$ECVS_RUNAS" ] && ECVS_RUNAS="`whoami`" 49[ -z "$ECVS_RUNAS" ] && ECVS_RUNAS="`whoami`"
50 50
51# Username to use 51# Username to use
52[ -z "$ECVS_USER" ] && ECVS_USER="anonymous" 52[ -z "$ECVS_USER" ] && ECVS_USER="anonymous"
53 53
54# Password to use if anonymous login is off 54# Password to use if anonymous login is off, or if 'anonymous' pserver access
55# uses a password and ECVS_ANON = yes
55[ -z "$ECVS_PASS" ] && ECVS_PASS="" 56[ -z "$ECVS_PASS" ] && ECVS_PASS=""
56 57
57# Module to be fetched, must be set explicitly - 58# Module to be fetched, must be set explicitly -
58# I don't like the former ="$PN" default setting 59# I don't like the former ="$PN" default setting
59[ -z "$ECVS_MODULE" ] && debug-print "$ECLASS: error: ECVS_MODULE not set, cannot continue" 60[ -z "$ECVS_MODULE" ] && debug-print "$ECLASS: error: ECVS_MODULE not set, cannot continue"
271 os.system(mycommand) 272 os.system(mycommand)
272 273
273EndOfFile 274EndOfFile
274########################### End of inline-python ################################## 275########################### End of inline-python ##################################
275 else 276 else
277 # is anonymous cvs.
276 debug-print "$FUNCNAME: using anonymous cvs login" 278 debug-print "$FUNCNAME: using anonymous cvs login"
279 # is there a password to use for login with this "anonymous" login
280 if [ -n $ECVS_PASS ]; then
281 debug-print "$FUNCNAME: using anonymous cvs login with password"
282
283# inline-python #
284/usr/bin/env python << EndOfFile
285
286import pexpect,os
287
288myuser = "${ECVS_USER}"
289mypasswd = "${ECVS_PASS}"
290
291mytimeout = 10
292
293# implicitly myauth == "pserver" here.
294mycommand = "cvs login"
295child = pexpect.spawn(mycommand)
296child.expect("CVS password:",mytimeout)
297child.sendline(mypasswd)
298child.expect(pexpect.EOF)
299EndOfFile
300# End of inline-python #
301
302 fi
277 $ECVS_CVS_COMMAND update $ECVS_CVS_OPTIONS || die "died running cvs update" 303 $ECVS_CVS_COMMAND update $ECVS_CVS_OPTIONS || die "died running cvs update"
304
278 fi 305 fi
279 306
280 # log out and restore ownership 307 # log out and restore ownership
281 if [ "$ECVS_RUNAS" == "`whoami`" ]; then 308 if [ "$ECVS_RUNAS" == "`whoami`" ]; then
282 cvs logout &> /dev/null 309 cvs logout &> /dev/null

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32

  ViewVC Help
Powered by ViewVC 1.1.20