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

Diff of /eclass/cvs.eclass

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

Revision 1.68 Revision 1.69
1# Copyright 1999-2006 Gentoo Foundation 1# Copyright 1999-2008 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.68 2006/12/11 00:16:28 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.69 2008/03/06 00:54:07 zlin Exp $
4# 4
5# @ECLASS: cvs.eclass
6# @MAINTAINER:
5# Maintainer: vapier@gentoo.org (and anyone who wants to help) 7# vapier@gentoo.org (and anyone who wants to help)
8# @BLURB: This eclass provides generic cvs fetching functions
9# @DESCRIPTION:
10# This eclass provides the generic cvs fetching functions. To use this from an
11# ebuild, set the ECLASS VARIABLES as specified below in your ebuild before
12# inheriting. Then either leave the default src_unpack or extend over
13# cvs_src_unpack. If you find that you need to call the cvs_* functions
14# directly, I'd be interested to hear about it.
6 15
7inherit eutils 16inherit eutils
8
9# This eclass provides the generic cvs fetching functions. To use
10# this from an ebuild, set the `ebuild-configurable settings' as
11# specified below in your ebuild before inheriting. Then either leave
12# the default src_unpack or extend over cvs_src_unpack. If you find
13# that you need to call the cvs_* functions directly, I'd be
14# interested to hear about it.
15 17
16# TODO: 18# TODO:
17 19
18# Implement more auth types (gserver?, kserver?) 20# Implement more auth types (gserver?, kserver?)
19 21
20# Support additional remote shells with `ext' authentication (does 22# Support additional remote shells with `ext' authentication (does
21# anyone actually need to use it with anything other than SSH?) 23# anyone actually need to use it with anything other than SSH?)
22
23 24
24 25
25# Users shouldn't change these settings! The ebuild/eclass inheriting 26# Users shouldn't change these settings! The ebuild/eclass inheriting
26# this eclass will take care of that. If you want to set the global 27# this eclass will take care of that. If you want to set the global
27# KDE cvs ebuilds' settings, see the comments in kde-source.eclass. 28# KDE cvs ebuilds' settings, see the comments in kde-source.eclass.
28 29
29# --- begin ebuild-configurable settings 30# @ECLASS-VARIABLE: ECVS_CVS_COMMAND
30 31# @DESCRIPTION:
31# ECVS_CVS_COMMAND -- CVS command to run 32# CVS command to run
32# 33#
33# You can set, for example, "cvs -t" for extensive debug information 34# You can set, for example, "cvs -t" for extensive debug information
34# on the cvs connection. The default of "cvs -q -f -z4" means to be 35# on the cvs connection. The default of "cvs -q -f -z4" means to be
35# quiet, to disregard the ~/.cvsrc config file and to use maximum 36# quiet, to disregard the ~/.cvsrc config file and to use maximum
36# compression. 37# compression.
37 38
39# @ECLASS-VARIABLE: ECVS_CVS_COMPRESS
40# @DESCRIPTION:
41# Set the compression level.
38[[ -z ${ECVS_CVS_COMPRESS} ]] && ECVS_CVS_COMPRESS="-z1" 42[[ -z ${ECVS_CVS_COMPRESS} ]] && ECVS_CVS_COMPRESS="-z1"
43
44# @ECLASS-VARIABLE: ECVS_CVS_OPTIONS
45# @DESCRIPTION:
46# Additional options to the cvs commands.
39[[ -z ${ECVS_CVS_OPTIONS} ]] && ECVS_CVS_OPTIONS="-q -f" 47[[ -z ${ECVS_CVS_OPTIONS} ]] && ECVS_CVS_OPTIONS="-q -f"
48
49# @ECLASS-VARIABLE: ECVS_CVS_COMMAND
50# @DESCRIPTION:
51# The cvs command.
40[[ -z ${ECVS_CVS_COMMAND} ]] && ECVS_CVS_COMMAND="cvs ${ECVS_CVS_OPTIONS} ${ECVS_CVS_COMPRESS}" 52[[ -z ${ECVS_CVS_COMMAND} ]] && ECVS_CVS_COMMAND="cvs ${ECVS_CVS_OPTIONS} ${ECVS_CVS_COMPRESS}"
41 53
42 54# @ECLASS-VARIABLE: ECVS_UP_OPTS
43# ECVS_UP_OPTS, ECVS_CO_OPTS -- CVS options given after the cvs 55# @DESCRIPTION:
44# command (update or checkout). 56# CVS options given after the cvs update command. Don't remove "-dP" or things
45# 57# won't work.
46# Don't remove -dP from update or things won't work.
47
48[ -z "$ECVS_UP_OPTS" ] && ECVS_UP_OPTS="-dP" 58[ -z "$ECVS_UP_OPTS" ] && ECVS_UP_OPTS="-dP"
59
60# @ECLASS-VARIABLE: ECVS_CO_OPTS
61# @DESCRIPTION:
62# CVS options given after the cvs checkout command.
49[ -z "$ECVS_CO_OPTS" ] && ECVS_CO_OPTS="" 63[ -z "$ECVS_CO_OPTS" ] && ECVS_CO_OPTS=""
50 64
51 65
66# @ECLASS-VARIABLE: ECVS_LOCAL
67# @DESCRIPTION:
52# ECVS_LOCAL -- If this is set, the CVS module will be fetched 68# If this is set, the CVS module will be fetched non-recursively.
53# non-recursively. Refer to the information in the CVS man page 69# Refer to the information in the CVS man page regarding the -l
54# regarding the -l command option (not the -l global option). 70# command option (not the -l global option).
55 71
56 72# @ECLASS-VARIABLE: ECVS_LOCLANAME
73# @DESCRIPTION:
57# ECVS_LOCALNAME -- local name of checkout directory 74# Local name of checkout directory
58# 75#
59# This is useful if the module on the server is called something 76# This is useful if the module on the server is called something
60# common like 'driver' or is nested deep in a tree, and you don't like 77# common like 'driver' or is nested deep in a tree, and you don't like
61# useless empty directories. 78# useless empty directories.
62# 79#
63# WARNING: Set this only from within ebuilds! If set in your shell or 80# WARNING: Set this only from within ebuilds! If set in your shell or
64# some such, things will break because the ebuild won't expect it and 81# some such, things will break because the ebuild won't expect it and
65# have e.g. a wrong $S setting. 82# have e.g. a wrong $S setting.
66 83
67 84# @ECLASS-VARIABLE: ECVS_TOP_DIR
85# @DESCRIPTION:
68# ECVS_TOP_DIR -- The directory under which CVS modules are checked 86# The directory under which CVS modules are checked out.
69# out.
70
71[ -z "$ECVS_TOP_DIR" ] && ECVS_TOP_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/cvs-src" 87[ -z "$ECVS_TOP_DIR" ] && ECVS_TOP_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/cvs-src"
72 88
73# ECVS_SERVER -- CVS path 89# @ECLASS-VARIABLE: ECVS_SERVER
90# @DESCRIPTION:
91# CVS path
74# 92#
75# The format is "server:/dir", e.g. "anoncvs.kde.org:/home/kde". 93# The format is "server:/dir", e.g. "anoncvs.kde.org:/home/kde".
76# Remove the other parts of the full CVSROOT, which might look like 94# Remove the other parts of the full CVSROOT, which might look like
77# ":pserver:anonymous@anoncvs.kde.org:/home/kde"; this is generated 95# ":pserver:anonymous@anoncvs.kde.org:/home/kde"; this is generated
78# using other settings also. 96# using other settings also.
79# 97#
80# Set this to "offline" to disable fetching (i.e. to assume the module 98# Set this to "offline" to disable fetching (i.e. to assume the module
81# is already checked out in ECVS_TOP_DIR). 99# is already checked out in ECVS_TOP_DIR).
82
83[ -z "$ECVS_SERVER" ] && ECVS_SERVER="offline" 100[ -z "$ECVS_SERVER" ] && ECVS_SERVER="offline"
84 101
85 102# @ECLASS-VARIABLE: ECVS_MODULE
103# @DESCRIPTION:
86# ECVS_MODULE -- the name of the CVS module to be fetched 104# The name of the CVS module to be fetched
87# 105#
88# This must be set when cvs_src_unpack is called. This can include 106# This must be set when cvs_src_unpack is called. This can include
89# several directory levels, i.e. "foo/bar/baz" 107# several directory levels, i.e. "foo/bar/baz"
90 108
91#[ -z "$ECVS_MODULE" ] && die "$ECLASS: error: ECVS_MODULE not set, cannot continue" 109#[ -z "$ECVS_MODULE" ] && die "$ECLASS: error: ECVS_MODULE not set, cannot continue"
92 110
93 111# @ECLASS-VARIABLE: ECVS_BRANCH
112# @DESCRIPTION:
94# ECVS_BRANCH -- the name of the branch/tag to use 113# The name of the branch/tag to use
95 114#
96# The default is "HEAD". The following default _will_ reset your 115# The default is "HEAD". The following default _will_ reset your
97# branch checkout to head if used. 116# branch checkout to head if used.
98 117
99#[ -z "$ECVS_BRANCH" ] && ECVS_BRANCH="HEAD" 118#[ -z "$ECVS_BRANCH" ] && ECVS_BRANCH="HEAD"
100 119
101 120# @ECLASS-VARIABLE: ECVS_AUTH
121# @DESCRIPTION:
102# ECVS_AUTH -- authentication method to use 122# Authentication method to use
103# 123#
104# Possible values are "pserver" and "ext". If `ext' authentication is 124# Possible values are "pserver" and "ext". If `ext' authentication is
105# used, the remote shell to use can be specified in CVS_RSH (SSH is 125# used, the remote shell to use can be specified in CVS_RSH (SSH is
106# used by default). Currently, the only supported remote shell for 126# used by default). Currently, the only supported remote shell for
107# `ext' authentication is SSH. 127# `ext' authentication is SSH.
112# e.g. 132# e.g.
113# "cvs -danoncvs@savannah.gnu.org:/cvsroot/backbone co System" 133# "cvs -danoncvs@savannah.gnu.org:/cvsroot/backbone co System"
114# ( from gnustep-apps/textedit ) 134# ( from gnustep-apps/textedit )
115[ -z "$ECVS_AUTH" ] && ECVS_AUTH="pserver" 135[ -z "$ECVS_AUTH" ] && ECVS_AUTH="pserver"
116 136
137# @ECLASS-VARIABLE: ECVS_USER
138# @DESCRIPTION:
117# ECVS_USER -- Username to use for authentication on the remote server 139# Username to use for authentication on the remote server.
118[ -z "$ECVS_USER" ] && ECVS_USER="anonymous" 140[ -z "$ECVS_USER" ] && ECVS_USER="anonymous"
119 141
142# @ECLASS-VARIABLE: ECVS_PASS
143# @DESCRIPTION:
120# ECVS_PASS -- Password to use for authentication on the remote server 144# Password to use for authentication on the remote server
121[ -z "$ECVS_PASS" ] && ECVS_PASS="" 145[ -z "$ECVS_PASS" ] && ECVS_PASS=""
122 146
123 147# @ECLASS-VARIABLE: ECVS_SSH_HOST_KEY
124# ECVS_SSH_HOST_KEY 148# @DESCRIPTION:
125#
126# If SSH is used for `ext' authentication, use this variable to 149# If SSH is used for `ext' authentication, use this variable to
127# specify the host key of the remote server. The format of the value 150# specify the host key of the remote server. The format of the value
128# should be the same format that is used for the SSH known hosts file. 151# should be the same format that is used for the SSH known hosts file.
129# 152#
130# WARNING: If a SSH host key is not specified using this variable, the 153# WARNING: If a SSH host key is not specified using this variable, the
131# remote host key will not be verified. 154# remote host key will not be verified.
132 155
133 156# @ECLASS-VARIABLE: ECVS_CLEAN
157# @DESCRIPTION:
134# ECVS_CLEAN -- Set this to get a clean copy when updating (passes the 158# Set this to get a clean copy when updating (passes the
135# -C option to cvs update) 159# -C option to cvs update)
136 160
137 161# @ECLASS-VARIABLE: ECVS_RUNAS
138# ECVS_RUNAS 162# @DESCRIPTION:
139#
140# Specifies an alternate (non-root) user to use to run cvs. Currently 163# Specifies an alternate (non-root) user to use to run cvs. Currently
141# b0rked and wouldn't work with portage userpriv anyway without 164# b0rked and wouldn't work with portage userpriv anyway without
142# special magic. 165# special magic.
143 166
144# [ -z "$ECVS_RUNAS" ] && ECVS_RUNAS="`whoami`" 167# [ -z "$ECVS_RUNAS" ] && ECVS_RUNAS="`whoami`"
145 168
146
147# ECVS_SUBDIR -- deprecated, do not use 169# ECVS_SUBDIR -- deprecated, do not use
148[ -n "$ECVS_SUBDIR" ] && die "ERROR: deprecated ECVS_SUBDIR defined. Please fix this ebuild." 170[ -n "$ECVS_SUBDIR" ] && die "ERROR: deprecated ECVS_SUBDIR defined. Please fix this ebuild."
149
150
151# --- end ebuild-configurable settings ---
152 171
153# add cvs to deps 172# add cvs to deps
154# ssh is used for ext auth 173# ssh is used for ext auth
155# sudo is used to run as a specified user 174# sudo is used to run as a specified user
156DEPEND="dev-util/cvs" 175DEPEND="dev-util/cvs"
460 chown `whoami` "${T}/cvspass" 479 chown `whoami` "${T}/cvspass"
461 fi 480 fi
462 481
463} 482}
464 483
465 484# @FUNCTION: cvs_src_unpack
485# @DESCRIPTION:
486# The cvs src_unpack function, which will be exported
466cvs_src_unpack() { 487cvs_src_unpack() {
467 488
468 debug-print-function $FUNCNAME $* 489 debug-print-function $FUNCNAME $*
469 490
470 debug-print "$FUNCNAME: init: 491 debug-print "$FUNCNAME: init:

Legend:
Removed from v.1.68  
changed lines
  Added in v.1.69

  ViewVC Help
Powered by ViewVC 1.1.20