Magellan Linux

Contents of /trunk/include/cvs.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 7094 - (show annotations) (download)
Tue Sep 28 19:50:42 2010 UTC (13 years, 7 months ago) by niro
Original Path: branches/magellan-next/include/cvs.sminc
File size: 1318 byte(s)
-updated to work with newer bash versions, export in functions doesn't overwrite global defined variables
1 # $Header: /magellan-cvs/smage/include/cvs.sminc,v 1.1 2005/12/04 12:26:50 niro Exp $
2 # cvs checkout functions
3
4 # at least only CVSROOT must be exported
5
6 # needed vars
7 MY_CVS_MODULE="${PNAME}"
8 MY_CVS_OPTS=""
9 CVSROOT=""
10
11 SDEPEND="${SDEPEND}
12 >= dev-util/subversion-1
13 >= sys-apps/util-linux-2" # needed for mcookie
14
15 cvs_fetch_source()
16 {
17 [[ -z ${CVSROOT} ]] && die "no CVSROOT given, cannot run a checkout."
18
19 local temp=${BUILDDIR}/temp-$(mcookie)
20
21 # cvs login
22 export CVSROOT="${CVSROOT}"
23 cvs login
24
25 [ ! -d "${temp}" ] && { install -d ${temp} || die; }
26
27 # get all our modules or update them
28 if [ ! -d ${temp}/${MY_CVS_MODULE}/CVS ]
29 then
30 (cd ${temp}; cvs -z3 checkout -P ${MY_CVS_OPTS} ${MY_CVS_MODULE})
31 else
32 (cd ${temp}; cvs -z3 update -d -P ${MY_CVS_OPTS} ${MY_CVS_MODULE})
33 fi
34
35 # set correct SRCDIR
36 [ -d "${SRCDIR}" ] && { rm -r ${SRCDIR} || die; }
37 mv ${temp}/${MY_CVS_MODULE} ${SRCDIR} || die
38 cd ${SRCDIR}
39
40 # correct permissions
41 find ${SRCDIR} -type f -exec chmod 0644 '{}' ';'
42 find ${SRCDIR} -type d -exec chmod 0755 '{}' ';'
43
44 # delete CVS directories
45 for file in $(find ${SRCDIR} -type d -name CVS)
46 do
47 rm -rf ${file}
48 done
49
50 # clean up backup files (foo~)
51 find ${SRCDIR} -name *~ -exec rm '{}' ';' || die
52 }
53
54 cvs_src_prepare()
55 {
56 cvs_fetch_source || die
57 }
58
59 export_inherits cvs src_prepare