| 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.43 2003/06/30 18:17:11 danarmak Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.44 2003/07/04 13:21:02 danarmak 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 | # to use from an ebuild, set the 'ebuild-configurable settings' below in your ebuild before inheriting. |
8 | # to use from an ebuild, set the 'ebuild-configurable settings' below in your ebuild before inheriting. |
| … | |
… | |
| 33 | # local name of module. useful if the module on the server is called |
33 | # local name of module. useful if the module on the server is called |
| 34 | # something common like 'driver' or is nested deep in a tree, and you don't |
34 | # something common like 'driver' or is nested deep in a tree, and you don't |
| 35 | # like useless empty directories. |
35 | # like useless empty directories. |
| 36 | # WARNING: to be set only from within ebuilds! if set in your shell or some such, |
36 | # WARNING: to be set only from within ebuilds! if set in your shell or some such, |
| 37 | # things wil break because the ebuild won't expect it and have e.g. a wrong $S setting. |
37 | # things wil break because the ebuild won't expect it and have e.g. a wrong $S setting. |
| 38 | [ -z "$ECVS_LOCALNAME" ] && ECVS_LOCALNAME="$ECVS_MODULE" |
38 | # ECVS_LOCALNAME |
| 39 | |
39 | |
| 40 | # Where the cvs modules are stored/accessed |
40 | # Where the cvs modules are stored/accessed |
| 41 | [ -z "$ECVS_TOP_DIR" ] && ECVS_TOP_DIR="${DISTDIR}/cvs-src" |
41 | [ -z "$ECVS_TOP_DIR" ] && ECVS_TOP_DIR="${DISTDIR}/cvs-src" |
| 42 | |
42 | |
| 43 | # Name of cvs server, set to "offline" to disable fetching |
43 | # Name of cvs server, set to "offline" to disable fetching |
| … | |
… | |
| 238 | ECVS_CO_OPTS=$ECVS_CO_OPTS |
238 | ECVS_CO_OPTS=$ECVS_CO_OPTS |
| 239 | ECVS_TOP_DIR=$ECVS_TOP_DIR |
239 | ECVS_TOP_DIR=$ECVS_TOP_DIR |
| 240 | ECVS_SERVER=$ECVS_SERVER |
240 | ECVS_SERVER=$ECVS_SERVER |
| 241 | ECVS_USER=$ECVS_USER |
241 | ECVS_USER=$ECVS_USER |
| 242 | ECVS_PASS=$ECVS_PASS |
242 | ECVS_PASS=$ECVS_PASS |
| 243 | ECS_MODULE=$ECVS_MODULE |
243 | ECVS_MODULE=$ECVS_MODULE |
| 244 | ECVS_LOCAL=$ECVS_LOCAL |
244 | ECVS_LOCAL=$ECVS_LOCAL |
| 245 | ECVS_RUNAS=$ECVS_RUNAS |
245 | ECVS_RUNAS=$ECVS_RUNAS |
| 246 | ECVS_LOCALNAME=$ECVS_LOCALNAME" |
246 | ECVS_LOCALNAME=$ECVS_LOCALNAME" |
| 247 | |
247 | |
| 248 | [ -z "$ECVS_MODULE" ] && die "ERROR: CVS module not set, cannot continue." |
248 | [ -z "$ECVS_MODULE" ] && die "ERROR: CVS module not set, cannot continue." |
|
|
249 | |
|
|
250 | # merely setting this default value makes things fail when cvs_src_unpack is called |
|
|
251 | # more than once per ebuild (eg kdenonbeta submodules); so if we set a default value, |
|
|
252 | # we disable it again at the function's end. |
|
|
253 | # of course, we could instead always reference it with the bash syntax for 'take default |
|
|
254 | # value from this other variable if undefined', but i'm lazy. |
|
|
255 | if [ -z "$ECVS_LOCALNAME" ]; then |
|
|
256 | ECVS_LOCALNAME="$ECVS_MODULE" |
|
|
257 | ECVS_LOCALNAME_SETDEFAULT=true |
|
|
258 | fi |
|
|
259 | |
| 249 | |
260 | |
| 250 | if [ "$ECVS_SERVER" == "offline" ]; then |
261 | if [ "$ECVS_SERVER" == "offline" ]; then |
| 251 | # we're not required to fetch anything, the module already exists and shouldn't be updated |
262 | # we're not required to fetch anything, the module already exists and shouldn't be updated |
| 252 | if [ -d "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" ]; then |
263 | if [ -d "${ECVS_TOP_DIR}/${ECVS_LOCALNAME}" ]; then |
| 253 | debug-print "$FUNCNAME: offline mode" |
264 | debug-print "$FUNCNAME: offline mode" |
| … | |
… | |
| 293 | done |
304 | done |
| 294 | # make sure we don't try to apply patches more than once, since |
305 | # make sure we don't try to apply patches more than once, since |
| 295 | # cvs_src_unpack is usually called several times from e.g. kde-source_src_unpack |
306 | # cvs_src_unpack is usually called several times from e.g. kde-source_src_unpack |
| 296 | export PATCHES="" |
307 | export PATCHES="" |
| 297 | fi |
308 | fi |
|
|
309 | |
|
|
310 | if [ -n "$ECVS_LOCALNAME_SETDEFAULT" ]; then |
|
|
311 | unset ECVS_LOCALNAME |
|
|
312 | unset ECVS_LOCALNAME_SETDEFAULT |
|
|
313 | fi |
| 298 | |
314 | |
| 299 | } |
315 | } |
| 300 | |
316 | |
| 301 | EXPORT_FUNCTIONS src_unpack |
317 | EXPORT_FUNCTIONS src_unpack |