Magellan Linux

Contents of /smage/trunk/include/cvs.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (show annotations) (download)
Sat Jan 2 16:59:51 2010 UTC (14 years, 3 months ago) by niro
File size: 1145 byte(s)
-initial smage includes
1 # $Header: /alx-cvs/smage-eglibc/include/cvs.sminc,v 1.1.1.1 2008/02/27 09:26:22 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 cvs_fetch_source()
12 {
13 [[ -z ${CVSROOT} ]] && die "no CVSROOT given, cannot run a checkout."
14
15 # cvs login
16 export CVSROOT="${CVSROOT}"
17 cvs login
18
19 [ ! -d "${SRCDIR}" ] && { install -d ${SRCDIR} || die; }
20
21 # get all our modules or update them
22 if [ ! -d ${SRCDIR}/${MY_CVS_MODULE}/CVS ]
23 then
24 (cd ${SRCDIR}; cvs -z3 checkout -P ${MY_CVS_OPTS} ${MY_CVS_MODULE})
25 else
26 (cd ${SRCDIR}; cvs -z3 update -d -P ${MY_CVS_OPTS} ${MY_CVS_MODULE})
27 fi
28
29 # correct permissions
30 find ${SRCDIR} -type f -exec chmod 0644 '{}' ';'
31 find ${SRCDIR} -type d -exec chmod 0755 '{}' ';'
32
33 # delete CVS directories
34 for file in $(find ${SRCDIR} -type d -name CVS)
35 do
36 rm -rf ${file}
37 done
38
39 # set correct SRCDIR
40 export SRCDIR="${SRCDIR}/${MY_CVS_MODULE}"
41 cd ${SRCDIR}
42
43 # clean up backup files (foo~)
44 find ${SRCDIR} -name *~ -exec rm '{}' ';' || die
45 }
46
47 cvs_src_prepare()
48 {
49 cvs_fetch_source || die
50 }
51
52 export_inherits cvs src_prepare