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

Diff of /eclass/cvs.eclass

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

Revision 1.20 Revision 1.22
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
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.20 2002/09/22 18:43:20 danarmak Exp $ 4# $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.22 2002/10/25 19:55:52 vapier 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
82 DIR="${ECVS_TOP_DIR}/${ECVS_MODULE}/${ECVS_SUBDIR}" 82 DIR="${ECVS_TOP_DIR}/${ECVS_MODULE}/${ECVS_SUBDIR}"
83 debug-print "$FUNCNAME: now DIR=$DIR" 83 debug-print "$FUNCNAME: now DIR=$DIR"
84 84
85 if [ "$ECVS_SERVER" == "offline" ]; then 85 if [ "$ECVS_SERVER" == "offline" ]; then
86 # we're not required to fetch anything, the module already exists and shouldn't be updated 86 # we're not required to fetch anything, the module already exists and shouldn't be updated
87 if [ -d "$DIR" ]; then 87 if [ -d "$DIR" ]; then
88 debug-print "$FUNCNAME: offline mode, exiting" 88 debug-print "$FUNCNAME: offline mode, exiting"
89 return 0 89 return 0
90 else 90 else
91 einfo "ERROR: Offline mode specified, but module/subdir not found. Aborting." 91 einfo "ERROR: Offline mode specified, but module/subdir not found. Aborting."
92 debug-print "$FUNCNAME: offline mode specified but module/subdir not found, exiting with error" 92 debug-print "$FUNCNAME: offline mode specified but module/subdir not found, exiting with error"
93 return 1 93 return 1
94 fi 94 fi
95 fi 95 fi
96 96
97 # create target directory as needed 97 # create target directory as needed
98 if [ ! -d "$DIR" ]; then 98 if [ ! -d "$DIR" ]; then
99 debug-print "$FUNCNAME: creating cvs directory $DIR" 99 debug-print "$FUNCNAME: creating cvs directory $DIR"
123 # prepare a cvspass file just for this session so that cvs thinks we're logged 123 # prepare a cvspass file just for this session so that cvs thinks we're logged
124 # in at the cvs server. we don't want to mess with ~/.cvspass. 124 # in at the cvs server. we don't want to mess with ~/.cvspass.
125 echo ":pserver:${ECVS_SERVER} A" > ${T}/cvspass 125 echo ":pserver:${ECVS_SERVER} A" > ${T}/cvspass
126 export CVS_PASSFILE="${T}/cvspass" 126 export CVS_PASSFILE="${T}/cvspass"
127 #export CVSROOT=:pserver:${ECVS_USER}@${ECVS_SERVER} 127 #export CVSROOT=:pserver:${ECVS_USER}@${ECVS_SERVER}
128 128
129 # Note: cvs update and checkout commands are unified. 129 # Note: cvs update and checkout commands are unified.
130 # we make sure a CVS/ dir exists in our module subdir with the right 130 # we make sure a CVS/ dir exists in our module subdir with the right
131 # Root and Repository entries in it and cvs update. 131 # Root and Repository entries in it and cvs update.
132 132
133 newserver=":pserver:${ECVS_USER}@${ECVS_SERVER}" 133 newserver=":pserver:${ECVS_USER}@${ECVS_SERVER}"
201 201
202} 202}
203 203
204cvs_src_unpack() { 204cvs_src_unpack() {
205 205
206 debug-print-function $FUNCNAME $* 206 debug-print-function $FUNCNAME $*
207 cvs_fetch || die "died running cvs_fetch" 207 cvs_fetch || die "died running cvs_fetch"
208 208
209 einfo "Copying $ECVS_MODULE/$ECVS_SUBDIR from $ECVS_TOP_DIR..." 209 einfo "Copying $ECVS_MODULE/$ECVS_SUBDIR from $ECVS_TOP_DIR..."
210 debug-print "Copying module $ECVS_MODULE subdir $ECVS_SUBDIR local_mode=$ECVS_LOCAL from $ECVS_TOP_DIR..." 210 debug-print "Copying module $ECVS_MODULE subdir $ECVS_SUBDIR local_mode=$ECVS_LOCAL from $ECVS_TOP_DIR..."
211 211
212 # probably redundant, but best to make sure 212 # probably redundant, but best to make sure
213 mkdir -p $WORKDIR/$ECVS_MODULE/$ECVS_SUBDIR 213 mkdir -p $WORKDIR/$ECVS_MODULE/$ECVS_SUBDIR
214 214
215 if [ -n "$ECVS_SUBDIR" ]; then 215 if [ -n "$ECVS_SUBDIR" ]; then
216 if [ -n "$ECVS_LOCAL" ]; then 216 if [ -n "$ECVS_LOCAL" ]; then
217 cp -f $ECVS_TOP_DIR/$ECVS_MODULE/$ECVS_SUBDIR/* $WORKDIR/$ECVS_MODULE/$ECVS_SUBDIR 217 cp -f $ECVS_TOP_DIR/$ECVS_MODULE/$ECVS_SUBDIR/* $WORKDIR/$ECVS_MODULE/$ECVS_SUBDIR
218 else 218 else
219 cp -Rf $ECVS_TOP_DIR/$ECVS_MODULE/$ECVS_SUBDIR $WORKDIR/$ECVS_MODULE/$ECVS_SUBDIR/.. 219 cp -Rf $ECVS_TOP_DIR/$ECVS_MODULE/$ECVS_SUBDIR $WORKDIR/$ECVS_MODULE/$ECVS_SUBDIR/..
220 fi 220 fi
221 else 221 else
222 if [ -n "$ECVS_LOCAL" ]; then 222 if [ -n "$ECVS_LOCAL" ]; then
223 cp -f $ECVS_TOP_DIR/$ECVS_MODULE/* $WORKDIR/$ECVS_MODULE 223 cp -f $ECVS_TOP_DIR/$ECVS_MODULE/* $WORKDIR/$ECVS_MODULE
224 else 224 else
225 cp -Rf $ECVS_TOP_DIR/$ECVS_MODULE $WORKDIR 225 cp -Rf $ECVS_TOP_DIR/$ECVS_MODULE $WORKDIR
226 fi 226 fi
227 fi 227 fi
228 228
229 # if the directory is empty, remove it; empty directories cannot exist in cvs. 229 # if the directory is empty, remove it; empty directories cannot exist in cvs.
230 # this happens when fex. kde-source requests module/doc/subdir which doesn't exist. 230 # this happens when fex. kde-source requests module/doc/subdir which doesn't exist.
231 # still create the empty directory in workdir though. 231 # still create the empty directory in workdir though.
232 if [ "`ls -A $DIR`" == "CVS" ]; then 232 if [ "`ls -A $DIR`" == "CVS" ]; then
233 debug-print "$FUNCNAME: removing cvs-empty directory $ECVS_MODULE/$ECVS_SUBDIR" 233 debug-print "$FUNCNAME: removing cvs-empty directory $ECVS_MODULE/$ECVS_SUBDIR"
234 rm -rf $DIR 234 rm -rf $DIR
235 fi 235 fi
236 236
237 # implement some of base_src_unpack's functionality; 237 # implement some of base_src_unpack's functionality;
238 # note however that base.eclass may not have been inherited! 238 # note however that base.eclass may not have been inherited!
239 if [ -n "$PATCHES" ]; then 239 if [ -n "$PATCHES" ]; then
240 debug-print "$FUNCNAME: PATCHES=$PATCHES, S=$S, autopatching" 240 debug-print "$FUNCNAME: PATCHES=$PATCHES, S=$S, autopatching"
241 cd $S 241 cd $S
242 for x in $PATCHES; do 242 for x in $PATCHES; do
243 debug-print "patching from $x" 243 debug-print "patching from $x"
244 patch -p0 < $x 244 patch -p0 < $x
245 done 245 done
246 # make sure we don't try to apply patches more than once, since 246 # make sure we don't try to apply patches more than once, since
247 # cvs_src_unpack is usually called several times from e.g. kde-source_src_unpack 247 # cvs_src_unpack is usually called several times from e.g. kde-source_src_unpack
248 export PATCHES="" 248 export PATCHES=""
249 fi 249 fi
250 250
251} 251}
252 252
253EXPORT_FUNCTIONS src_unpack 253EXPORT_FUNCTIONS src_unpack
254
255

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.20