| 1 | # Copyright 1999-2004 Gentoo Foundation |
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.53 2004/10/19 19:51:12 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.56 2005/07/06 20:20:03 agriffis 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> |
| … | |
… | |
| 24 | |
24 | |
| 25 | # Support additional remote shells with `ext' authentication (does |
25 | # Support additional remote shells with `ext' authentication (does |
| 26 | # anyone actually need to use it with anything other than SSH?) |
26 | # anyone actually need to use it with anything other than SSH?) |
| 27 | |
27 | |
| 28 | |
28 | |
| 29 | ECLASS=cvs |
|
|
| 30 | INHERITED="$INHERITED $ECLASS" |
29 | INHERITED="$INHERITED $ECLASS" |
| 31 | |
30 | |
| 32 | # Users shouldn't change these settings! The ebuild/eclass inheriting |
31 | # Users shouldn't change these settings! The ebuild/eclass inheriting |
| 33 | # this eclass will take care of that. If you want to set the global |
32 | # this eclass will take care of that. If you want to set the global |
| 34 | # KDE cvs ebuilds' settings, see the comments in kde-source.eclass. |
33 | # KDE cvs ebuilds' settings, see the comments in kde-source.eclass. |
| … | |
… | |
| 73 | # ECVS_TOP_DIR -- The directory under which CVS modules are checked |
72 | # ECVS_TOP_DIR -- The directory under which CVS modules are checked |
| 74 | # out. |
73 | # out. |
| 75 | |
74 | |
| 76 | [ -z "$ECVS_TOP_DIR" ] && ECVS_TOP_DIR="${DISTDIR}/cvs-src" |
75 | [ -z "$ECVS_TOP_DIR" ] && ECVS_TOP_DIR="${DISTDIR}/cvs-src" |
| 77 | |
76 | |
| 78 | # ECVS_NAME -- CVS path |
77 | # ECVS_SERVER -- CVS path |
| 79 | # |
78 | # |
| 80 | # The format is "server:/dir", e.g. "anoncvs.kde.org:/home/kde". |
79 | # The format is "server:/dir", e.g. "anoncvs.kde.org:/home/kde". |
| 81 | # Remove the other parts of the full CVSROOT, which might look like |
80 | # Remove the other parts of the full CVSROOT, which might look like |
| 82 | # ":pserver:anonymous@anoncvs.kde.org:/home/kde"; this is generated |
81 | # ":pserver:anonymous@anoncvs.kde.org:/home/kde"; this is generated |
| 83 | # using other settings also. |
82 | # using other settings also. |
| … | |
… | |
| 343 | eval $cmdupdate || die "cvs update command failed" |
342 | eval $cmdupdate || die "cvs update command failed" |
| 344 | elif [ "${mode}" == "checkout" ]; then |
343 | elif [ "${mode}" == "checkout" ]; then |
| 345 | einfo "Running $cmdcheckout" |
344 | einfo "Running $cmdcheckout" |
| 346 | eval $cmdcheckout|| die "cvs checkout command failed" |
345 | eval $cmdcheckout|| die "cvs checkout command failed" |
| 347 | fi |
346 | fi |
| 348 | elif [ "${ECVS_AUTH}" == "ext" ]; then |
347 | elif [ "${ECVS_AUTH}" == "ext" ] || [ "${ECVS_AUTH}" == "no" ]; then |
| 349 | |
348 | |
| 350 | # Hack to support SSH password authentication |
349 | # Hack to support SSH password authentication |
| 351 | |
350 | |
| 352 | # Backup environment variable values |
351 | # Backup environment variable values |
| 353 | local CVS_ECLASS_ORIG_CVS_RSH="${CVS_RSH}" |
352 | local CVS_ECLASS_ORIG_CVS_RSH="${CVS_RSH}" |
| … | |
… | |
| 385 | except: |
384 | except: |
| 386 | pass |
385 | pass |
| 387 | newarglist = sys.argv[:] |
386 | newarglist = sys.argv[:] |
| 388 | EOF |
387 | EOF |
| 389 | |
388 | |
|
|
389 | # disable X11 forwarding which causes .xauth access violations |
|
|
390 | # - 20041205 Armando Di Cianno <fafhrd@gentoo.org> |
|
|
391 | echo "newarglist.insert(1, '-oClearAllForwardings=yes')" \ |
|
|
392 | >> "${CVS_RSH}" |
|
|
393 | echo "newarglist.insert(1, '-oForwardX11=no')" \ |
|
|
394 | >> "${CVS_RSH}" |
|
|
395 | |
| 390 | # Handle SSH host key checking |
396 | # Handle SSH host key checking |
| 391 | |
397 | |
| 392 | local CVS_ECLASS_KNOWN_HOSTS="${T}/cvs_ssh_known_hosts" |
398 | local CVS_ECLASS_KNOWN_HOSTS="${T}/cvs_ssh_known_hosts" |
| 393 | echo "newarglist.insert(1, '-oUserKnownHostsFile=${CVS_ECLASS_KNOWN_HOSTS}')" \ |
399 | echo "newarglist.insert(1, '-oUserKnownHostsFile=${CVS_ECLASS_KNOWN_HOSTS}')" \ |
| 394 | >> "${CVS_RSH}" |
400 | >> "${CVS_RSH}" |
| … | |
… | |
| 396 | if [ -z "${ECVS_SSH_HOST_KEY}" ]; then |
402 | if [ -z "${ECVS_SSH_HOST_KEY}" ]; then |
| 397 | ewarn "Warning: The SSH host key of the remote server will not be verified." |
403 | ewarn "Warning: The SSH host key of the remote server will not be verified." |
| 398 | einfo "A temporary known hosts list will be used." |
404 | einfo "A temporary known hosts list will be used." |
| 399 | local CVS_ECLASS_STRICT_HOST_CHECKING="no" |
405 | local CVS_ECLASS_STRICT_HOST_CHECKING="no" |
| 400 | touch "${CVS_ECLASS_KNOWN_HOSTS}" |
406 | touch "${CVS_ECLASS_KNOWN_HOSTS}" |
| 401 | echo "newarglist.insert(1, '-oStrictHostKeyChecking=no')" \ |
|
|
| 402 | >> "${CVS_RSH}" |
|
|
| 403 | else |
407 | else |
| 404 | local CVS_ECLASS_STRICT_HOST_CHECKING="yes" |
408 | local CVS_ECLASS_STRICT_HOST_CHECKING="yes" |
| 405 | echo "${ECVS_SSH_HOST_KEY}" > "${CVS_ECLASS_KNOWN_HOSTS}" |
409 | echo "${ECVS_SSH_HOST_KEY}" > "${CVS_ECLASS_KNOWN_HOSTS}" |
| 406 | fi |
410 | fi |
| 407 | |
411 | |
| … | |
… | |
| 421 | export DISPLAY |
425 | export DISPLAY |
| 422 | |
426 | |
| 423 | # Create a dummy executable to echo $ECVS_PASS |
427 | # Create a dummy executable to echo $ECVS_PASS |
| 424 | |
428 | |
| 425 | export SSH_ASKPASS="${T}/cvs_sshechopass" |
429 | export SSH_ASKPASS="${T}/cvs_sshechopass" |
| 426 | |
430 | if [ "${ECVS_AUTH}" != "no" ]; then |
| 427 | echo -en "#!/bin/bash\necho \"$ECVS_PASS\"\n" \ |
431 | echo -en "#!/bin/bash\necho \"$ECVS_PASS\"\n" \ |
| 428 | > "${SSH_ASKPASS}" |
432 | > "${SSH_ASKPASS}" |
|
|
433 | else |
|
|
434 | echo -en "#!/bin/bash\nreturn\n" \ |
|
|
435 | > "${SSH_ASKPASS}" |
| 429 | |
436 | |
|
|
437 | fi |
| 430 | chmod a+x "${SSH_ASKPASS}" |
438 | chmod a+x "${SSH_ASKPASS}" |
| 431 | fi |
439 | fi |
| 432 | |
440 | |
| 433 | if [ "${mode}" == "update" ]; then |
441 | if [ "${mode}" == "update" ]; then |
| 434 | einfo "Running $cmdupdate" |
442 | einfo "Running $cmdupdate" |
| … | |
… | |
| 448 | |
456 | |
| 449 | if [ "${CVS_ECLASS_ORIG_DISPLAY+set}" == "set" ]; then |
457 | if [ "${CVS_ECLASS_ORIG_DISPLAY+set}" == "set" ]; then |
| 450 | export DISPLAY="${CVS_ECLASS_ORIG_DISPLAY}" |
458 | export DISPLAY="${CVS_ECLASS_ORIG_DISPLAY}" |
| 451 | else |
459 | else |
| 452 | unset DISPLAY |
460 | unset DISPLAY |
| 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 |
461 | fi |
| 462 | fi |
462 | fi |
| 463 | |
463 | |
| 464 | # Restore ownership. Not sure why this is needed, but someone |
464 | # Restore ownership. Not sure why this is needed, but someone |
| 465 | # added it in the orig ECVS_RUNAS stuff. |
465 | # added it in the orig ECVS_RUNAS stuff. |