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

Diff of /eclass/cvs.eclass

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

Revision 1.9 Revision 1.12
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.9 2002/08/03 10:46:01 danarmak Exp $ 4# $Header: /var/cvsroot/gentoo-x86/eclass/cvs.eclass,v 1.12 2002/08/18 23:54:59 danarmak 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
41 41
42# Password to use (NOT (YET) SUPPORTED, because cvs doesn't store passwords in plaintext in .cvspass) 42# Password to use (NOT (YET) SUPPORTED, because cvs doesn't store passwords in plaintext in .cvspass)
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 ="$NP" default setting 46# I don't like the former ="$PN" default setting
47[ -z "$ECVS_MODULE" ] && die "$ECLASS: error: ECVS_MODULE not set, cannot continue" 47[ -z "$ECVS_MODULE" ] && debug-print "$ECLASS: error: ECVS_MODULE not set, cannot continue"
48 48
49# Subdirectory in module to be fetched, default is not defined = whole module 49# 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! 50# DO NOT set default to "", if it's defined at all code will break!
51# don't uncomment following line! 51# don't uncomment following line!
52#[ -z "$ECVS_MODULE_SUBDIR" ] && ECVS_MODULE_SUBDIR="" 52#[ -z "$ECVS_MODULE_SUBDIR" ] && ECVS_MODULE_SUBDIR=""
189 189
190 einfo "Copying module $ECVS_MODULE from $ECVS_TOP_DIR..." 190 einfo "Copying module $ECVS_MODULE from $ECVS_TOP_DIR..."
191 debug-print "Copying module $ECVS_MODULE from $ECVS_TOP_DIR..." 191 debug-print "Copying module $ECVS_MODULE from $ECVS_TOP_DIR..."
192 192
193 if [ -n "$ECVS_SUBDIR" ]; then 193 if [ -n "$ECVS_SUBDIR" ]; then
194 mkdir $WORKDIR/$ECVS_MODULE 194 mkdir -p $WORKDIR/$ECVS_MODULE/$ECVS_SUBDIR
195 cp -Rf $ECVS_TOP_DIR/$ECVS_MODULE/$ECVS_SUBDIR $WORKDIR/$ECVS_MODULE 195 cp -Rf $ECVS_TOP_DIR/$ECVS_MODULE/$ECVS_SUBDIR/* $WORKDIR/$ECVS_MODULE/$ECVS_SUBDIR/
196 else 196 else
197 if [ -n "$ECVS_LOCAL" ]; then 197 if [ -n "$ECVS_LOCAL" ]; then
198 cp -f $ECVS_TOP_DIR/$ECVS_MODULE/* $WORKDIR/$ECVS_MODULE 198 cp -f $ECVS_TOP_DIR/$ECVS_MODULE/* $WORKDIR/$ECVS_MODULE
199 else 199 else
200 cp -Rf $ECVS_TOP_DIR/$ECVS_MODULE $WORKDIR 200 cp -Rf $ECVS_TOP_DIR/$ECVS_MODULE $WORKDIR
201 fi 201 fi
202 fi 202 fi
203 203
204 # if the directory is empty, remove it; empty directories cannot exist in cvs.
205 # this happens when fex. kde-source requests module/doc/subdir which doesn't exist.
206 # still create the empty directory in workdir though.
207 if [ "`ls -A $DIR`" == "CVS" ]; then
208 debug-print "$FUNCNAME: removing cvs-empty directory $ECVS_MODULE/$ECVS_SUBDIR"
209 rm -rf $DIR
210 fi
211
204 # implement some of base_src_unpack's functionality; 212 # implement some of base_src_unpack's functionality;
205 # note however that base.eclass may not have been inherited! 213 # note however that base.eclass may not have been inherited!
206 if [ -n "$PATCHES" ]; then 214 if [ -n "$PATCHES" ]; then
207 debug-print "$FUNCNAME: PATCHES=$PATCHES, S=$S, autopatching" 215 debug-print "$FUNCNAME: PATCHES=$PATCHES, S=$S, autopatching"
208 cd $S 216 cd $S
209 for x in $PATCHES; do 217 for x in $PATCHES; do
210 debug-print "patching from $x" 218 debug-print "patching from $x"
211 patch -p0 < $x 219 patch -p0 < $x
212 done 220 done
221 # make sure we don't try to apply patches more than once, since
222 # cvs_src_unpack is usually called several times from e.g. kde-source_src_unpack
223 export PATCHES=""
213 fi 224 fi
214 225
215} 226}
216 227
217EXPORT_FUNCTIONS src_unpack 228EXPORT_FUNCTIONS src_unpack

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

  ViewVC Help
Powered by ViewVC 1.1.20