Magellan Linux

Annotation of /branches/R11-unstable/include/svn.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1337 - (hide annotations) (download)
Sat May 2 14:58:26 2009 UTC (15 years ago) by niro
Original Path: trunk/core/include/svn.sminc
File size: 1065 byte(s)
-added svn functions
1 niro 1337 # $Id$
2     # svn checkout functions
3    
4     # at least only CVSROOT must be exported
5    
6     # needed vars
7     MY_SVN_MODULE="${PNAME}"
8     MY_SVN_OPTS=""
9     SVNROOT=""
10    
11     SDEPEND="${SDEPEND}
12     >= dev-util/subversion-1"
13    
14     svn_fetch_source()
15     {
16     [[ -z ${SVNROOT} ]] && die "no SVNROOT given, cannot run a checkout."
17    
18     [ ! -d "${SRCDIR}" ] && { install -d ${SRCDIR} || die; }
19    
20     # get all our modules or update them
21     if [ ! -d ${SRCDIR}/${MY_SVN_MODULE}/.svn ]
22     then
23     ( cd ${SRCDIR}; svn checkout ${MY_SVN_OPTS} ${SVNROOT}/${MY_SVN_MODULE} )
24     else
25     ( cd ${SRCDIR}; svn update ${MY_SVN_OPTS} ${SVNROOT}/${MY_SVN_MODULE} )
26     fi
27    
28     # correct permissions
29     find ${SRCDIR} -type f -exec chmod 0644 '{}' ';'
30     find ${SRCDIR} -type d -exec chmod 0755 '{}' ';'
31    
32     # delete svn directories
33     for file in $(find ${SRCDIR} -type d -name .svn)
34     do
35     rm -rf ${file}
36     done
37    
38     # set correct SRCDIR
39     export SRCDIR="${SRCDIR}/${MY_SVN_MODULE}"
40     cd ${SRCDIR}
41    
42     # clean up backup files (foo~)
43     find ${SRCDIR} -name *~ -exec rm '{}' ';' || die
44     }
45    
46     cvs_src_prepare()
47     {
48     svn_fetch_source || die
49     }
50    
51     export_inherits svn src_prepare