Annotation of /trunk/include/svn.sminc
Parent Directory | Revision Log
Revision 9880 -
(hide annotations)
(download)
Sat Jan 14 01:48:34 2012 UTC (12 years, 10 months ago) by niro
File size: 1002 byte(s)
Sat Jan 14 01:48:34 2012 UTC (12 years, 10 months ago) by niro
File size: 1002 byte(s)
-imported from magellan-next
1 | niro | 1337 | # $Id$ |
2 | # svn checkout functions | ||
3 | |||
4 | niro | 4094 | # at least only SVNROOT must be exported |
5 | niro | 1337 | |
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 | niro | 7093 | if [ ! -d ${SRCDIR}/.svn ] |
22 | niro | 1337 | then |
23 | niro | 7093 | svn checkout ${MY_SVN_OPTS} ${SVNROOT}/${MY_SVN_MODULE} ${SRCDIR} || die |
24 | niro | 1337 | else |
25 | niro | 7093 | svn update ${MY_SVN_OPTS} ${SVNROOT}/${MY_SVN_MODULE} ${SRCDIR} || die |
26 | niro | 1337 | 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 | cd ${SRCDIR} | ||
40 | |||
41 | # clean up backup files (foo~) | ||
42 | find ${SRCDIR} -name *~ -exec rm '{}' ';' || die | ||
43 | } | ||
44 | |||
45 | niro | 4094 | svn_src_prepare() |
46 | niro | 1337 | { |
47 | svn_fetch_source || die | ||
48 | } | ||
49 | |||
50 | export_inherits svn src_prepare |