Magellan Linux

Annotation of /trunk/include/cvs.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6654 - (hide annotations) (download)
Tue Sep 14 16:46:32 2010 UTC (13 years, 8 months ago) by niro
Original Path: branches/magellan-next/include/cvs.sminc
File size: 1139 byte(s)
imported from trunk
1 niro 2 # $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     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