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

Diff of /eclass/cvs.eclass

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

Revision 1.12 Revision 1.16
1# Copyright 1999-2000 Gentoo Technologies, Inc. 1# Copyright 1999-2000 Gentoo Technologies, Inc.
2# Distributed under the terms of the GNU General Public License, v2 or later 2# Distributed under the terms of the GNU General Public License, v2 or later
3# Author Dan Armak <danarmak@gentoo.org> 3# Author Dan Armak <danarmak@gentoo.org>
4# $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.12 2002/08/18 23:54:59 danarmak Exp $ 4# $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.16 2002/09/08 21:23:03 azarah Exp $
5# This eclass provides the generic cvs fetching functions. 5# This eclass provides the generic cvs fetching functions.
6 6
7ECLASS=cvs 7ECLASS=cvs
8INHERITED="$INHERITED $ECLASS" 8INHERITED="$INHERITED $ECLASS"
9 9
24 24
25# set this for the module/subdir to be fetched non-recursively 25# set this for the module/subdir to be fetched non-recursively
26#[ -n "$ECVS_LOCAL" ] && ECVS_CVS_OPTIONS="$ECVS_CVS_OPTIONS -l" 26#[ -n "$ECVS_LOCAL" ] && ECVS_CVS_OPTIONS="$ECVS_CVS_OPTIONS -l"
27 27
28# Where the cvs modules are stored/accessed 28# Where the cvs modules are stored/accessed
29[ -z "$ECVS_TOP_DIR" ] && ECVS_TOP_DIR="/usr/src" 29[ -z "$ECVS_TOP_DIR" ] && ECVS_TOP_DIR="${DISTDIR}/cvs-src"
30 30
31# Name of cvs server, set to "offline" to disable fetching 31# Name of cvs server, set to "offline" to disable fetching
32# (i.e. to assume module is checked out already and don't update it). 32# (i.e. to assume module is checked out already and don't update it).
33# Format is server:/dir e.g. "anoncvs.kde.org:/home/kde". remove the other 33# Format is server:/dir e.g. "anoncvs.kde.org:/home/kde". remove the other
34# parts of the full CVSROOT (which looks like 34# parts of the full CVSROOT (which looks like
43[ -z "$ECVS_PASS" ] && ECVS_PASS="" 43[ -z "$ECVS_PASS" ] && ECVS_PASS=""
44 44
45# Module to be fetched, must be set explicitly - 45# Module to be fetched, must be set explicitly -
46# I don't like the former ="$PN" default setting 46# I don't like the former ="$PN" default setting
47[ -z "$ECVS_MODULE" ] && debug-print "$ECLASS: error: ECVS_MODULE not set, cannot continue" 47[ -z "$ECVS_MODULE" ] && debug-print "$ECLASS: error: ECVS_MODULE not set, cannot continue"
48
49# Branch/tag to use, default is HEAD
50# uncomment the following line to enable the reset-branch-to-HEAD behaviour
51[ -z "$ECVS_BRANCH" ] && ECVS_BRANCH="HEAD"
48 52
49# Subdirectory in module to be fetched, default is not defined = whole module 53# Subdirectory in module to be fetched, default is not defined = whole module
50# DO NOT set default to "", if it's defined at all code will break! 54# DO NOT set default to "", if it's defined at all code will break!
51# don't uncomment following line! 55# don't uncomment following line!
52#[ -z "$ECVS_MODULE_SUBDIR" ] && ECVS_MODULE_SUBDIR="" 56#[ -z "$ECVS_MODULE_SUBDIR" ] && ECVS_MODULE_SUBDIR=""
71ECVS_PASS=$ECVS_PASS 75ECVS_PASS=$ECVS_PASS
72ECS_MODULE=$ECVS_MODULE 76ECS_MODULE=$ECVS_MODULE
73ECVS_MODULE_SUBDIR=$ECVS_SUBDIR 77ECVS_MODULE_SUBDIR=$ECVS_SUBDIR
74ECVS_LOCAL=$ECVS_LOCAL 78ECVS_LOCAL=$ECVS_LOCAL
75DIR=$DIR" 79DIR=$DIR"
80
81 # if ECVS_TOP_DIR is a symlink to a dir, get the real dir's path,
82 # otherwise addwrite() doesn't work
83 if [ -n "$ECVS_TOP_DIR" ]; then
84 # create $ECVS_TOP_DIR if missing
85 addwrite $ECVS_TOP_DIR
86 [ ! -d $ECVS_TOP_DIR -a ! -L $ECVS_TOP_DIR ] && mkdir -p $ECVS_TOP_DIR
87 cd -P $ECVS_TOP_DIR
88 ECVS_TOP_DIR="`pwd`"
89 cd $OLDPWD
90 fi
76 91
77 # a shorthand 92 # a shorthand
78 [ -n "$ECVS_SUBDIR" ] && DIR="${ECVS_TOP_DIR}/${ECVS_MODULE}/${ECVS_SUBDIR}" || \ 93 [ -n "$ECVS_SUBDIR" ] && DIR="${ECVS_TOP_DIR}/${ECVS_MODULE}/${ECVS_SUBDIR}" || \
79 DIR="${ECVS_TOP_DIR}/${ECVS_MODULE}" 94 DIR="${ECVS_TOP_DIR}/${ECVS_MODULE}"
80 95
93 return 1 108 return 1
94 fi 109 fi
95 fi 110 fi
96 111
97 # disable the sandbox for this dir 112 # disable the sandbox for this dir
98
99 # not just $DIR because we want to create moduletopdir/CVS too 113 # not just $DIR because we want to create moduletopdir/CVS too
100 addwrite $ECVS_TOP_DIR/$ECVS_MODULE 114 addwrite $ECVS_TOP_DIR/$ECVS_MODULE
101 115
102 if [ ! -d "$DIR" ]; then 116 if [ ! -d "$DIR" ]; then
103 debug-print "$FUNCNAME: creating cvs directory $DIR" 117 debug-print "$FUNCNAME: creating cvs directory $DIR"
115 129
116 # Note: cvs update and checkout commands are unified. 130 # Note: cvs update and checkout commands are unified.
117 # we make sure a CVS/ dir exists in our module subdir with the right 131 # we make sure a CVS/ dir exists in our module subdir with the right
118 # Root and Repository entries in it and cvs update. 132 # Root and Repository entries in it and cvs update.
119 133
120 newserver=":pserver:anonymous@${ECVS_SERVER}" 134 newserver=":pserver:${ECVS_USER}@${ECVS_SERVER}"
121 135
122 # CVS/Repository files can't (I think) contain two concatenated slashes 136 # CVS/Repository files can't (I think) contain two concatenated slashes
123 if [ -n "$ECVS_SUBDIR" ]; then 137 if [ -n "$ECVS_SUBDIR" ]; then
124 repository="${ECVS_MODULE}/${ECVS_SUBDIR}" 138 repository="${ECVS_MODULE}/${ECVS_SUBDIR}"
125 else 139 else
172 done 186 done
173 187
174 fi 188 fi
175 189
176 fi 190 fi
191
192 # cvs auto-switches branches, how nice
193 # warning: if we do it this way we get multiple -rX options - harmless i think
194 [ -n "$ECVS_BRANCH" ] && ECVS_CVS_OPTIONS="$ECVS_CVS_OPTIONS -r$ECVS_BRANCH"
177 195
178 # finally run the cvs update command 196 # finally run the cvs update command
179 debug-print "$FUNCNAME: running $ECVS_CVS_COMMAND update $ECVS_CVS_OPTIONS with $ECVS_SERVER for module $ECVS_MODULE subdir $ECVS_SUBDIR" 197 debug-print "$FUNCNAME: running $ECVS_CVS_COMMAND update $ECVS_CVS_OPTIONS with $ECVS_SERVER for module $ECVS_MODULE subdir $ECVS_SUBDIR"
180 einfo "Running $ECVS_CVS_COMMAND update $ECVS_CVS_OPTIONS with $ECVS_SERVER for $ECVS_MODULE/$ECVS_SUBDIR..." 198 einfo "Running $ECVS_CVS_COMMAND update $ECVS_CVS_OPTIONS with $ECVS_SERVER for $ECVS_MODULE/$ECVS_SUBDIR..."
181 $ECVS_CVS_COMMAND update $ECVS_CVS_OPTIONS || die "died running cvs update" 199 $ECVS_CVS_COMMAND update $ECVS_CVS_OPTIONS || die "died running cvs update"

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.20