summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTilman Klar <phoenix@gentoo.org>2003-02-21 14:07:46 +0000
committerTilman Klar <phoenix@gentoo.org>2003-02-21 14:07:46 +0000
commit492f99114918e70eb8012eec91700ace0768ebf8 (patch)
tree08c437d11439bd2aaf9c61cc179372fa9a65f265 /eclass/cvs.eclass
parentadd ~x86 keyword (diff)
downloadgentoo-2-492f99114918e70eb8012eec91700ace0768ebf8.tar.gz
gentoo-2-492f99114918e70eb8012eec91700ace0768ebf8.tar.bz2
gentoo-2-492f99114918e70eb8012eec91700ace0768ebf8.zip
modified cvs.eclass to use 'anonymous' pservers with password - see bug #11497 for details
Diffstat (limited to 'eclass/cvs.eclass')
-rw-r--r--eclass/cvs.eclass31
1 files changed, 29 insertions, 2 deletions
diff --git a/eclass/cvs.eclass b/eclass/cvs.eclass
index bb279a861894..a1dbf3664ebd 100644
--- a/eclass/cvs.eclass
+++ b/eclass/cvs.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.31 2003/02/16 04:26:21 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.32 2003/02/21 14:07:46 phoenix Exp $
#
# Author Dan Armak <danarmak@gentoo.org>
#
@@ -51,7 +51,8 @@ INHERITED="$INHERITED $ECLASS"
# Username to use
[ -z "$ECVS_USER" ] && ECVS_USER="anonymous"
-# Password to use if anonymous login is off
+# Password to use if anonymous login is off, or if 'anonymous' pserver access
+# uses a password and ECVS_ANON = yes
[ -z "$ECVS_PASS" ] && ECVS_PASS=""
# Module to be fetched, must be set explicitly -
@@ -273,8 +274,34 @@ elif myauth == "pserver":
EndOfFile
########################### End of inline-python ##################################
else
+ # is anonymous cvs.
debug-print "$FUNCNAME: using anonymous cvs login"
+ # is there a password to use for login with this "anonymous" login
+ if [ -n $ECVS_PASS ]; then
+ debug-print "$FUNCNAME: using anonymous cvs login with password"
+
+# inline-python #
+/usr/bin/env python << EndOfFile
+
+import pexpect,os
+
+myuser = "${ECVS_USER}"
+mypasswd = "${ECVS_PASS}"
+
+mytimeout = 10
+
+# implicitly myauth == "pserver" here.
+mycommand = "cvs login"
+child = pexpect.spawn(mycommand)
+child.expect("CVS password:",mytimeout)
+child.sendline(mypasswd)
+child.expect(pexpect.EOF)
+EndOfFile
+# End of inline-python #
+
+ fi
$ECVS_CVS_COMMAND update $ECVS_CVS_OPTIONS || die "died running cvs update"
+
fi
# log out and restore ownership