Annotation of /branches/R11-stable/include/cvs.sminc
Parent Directory | Revision Log
Revision 7237 -
(hide annotations)
(download)
Mon Oct 11 21:38:28 2010 UTC (14 years ago) by niro
Original Path: branches/magellan-next/include/cvs.sminc
File size: 1385 byte(s)
Mon Oct 11 21:38:28 2010 UTC (14 years ago) by niro
Original Path: branches/magellan-next/include/cvs.sminc
File size: 1385 byte(s)
-fixed a typo
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 | niro | 7094 | SDEPEND="${SDEPEND} |
12 | >= dev-util/subversion-1 | ||
13 | >= sys-apps/util-linux-2" # needed for mcookie | ||
14 | |||
15 | niro | 2 | cvs_fetch_source() |
16 | { | ||
17 | [[ -z ${CVSROOT} ]] && die "no CVSROOT given, cannot run a checkout." | ||
18 | |||
19 | niro | 7094 | local temp=${BUILDDIR}/temp-$(mcookie) |
20 | |||
21 | niro | 2 | # cvs login |
22 | export CVSROOT="${CVSROOT}" | ||
23 | cvs login | ||
24 | |||
25 | niro | 7094 | [ ! -d "${temp}" ] && { install -d ${temp} || die; } |
26 | niro | 2 | |
27 | # get all our modules or update them | ||
28 | niro | 7094 | if [ ! -d ${temp}/${MY_CVS_MODULE}/CVS ] |
29 | niro | 2 | then |
30 | niro | 7094 | (cd ${temp}; cvs -z3 checkout -P ${MY_CVS_OPTS} ${MY_CVS_MODULE}) |
31 | niro | 2 | else |
32 | niro | 7094 | (cd ${temp}; cvs -z3 update -d -P ${MY_CVS_OPTS} ${MY_CVS_MODULE}) |
33 | niro | 2 | fi |
34 | |||
35 | niro | 7094 | # set correct SRCDIR |
36 | [ -d "${SRCDIR}" ] && { rm -r ${SRCDIR} || die; } | ||
37 | mv ${temp}/${MY_CVS_MODULE} ${SRCDIR} || die | ||
38 | cd ${SRCDIR} | ||
39 | |||
40 | niro | 7095 | # prune old cruft |
41 | niro | 7237 | [ -d "${temp}" ] && { rm -r ${temp} || die; } |
42 | niro | 7095 | |
43 | niro | 2 | # correct permissions |
44 | find ${SRCDIR} -type f -exec chmod 0644 '{}' ';' | ||
45 | find ${SRCDIR} -type d -exec chmod 0755 '{}' ';' | ||
46 | |||
47 | # delete CVS directories | ||
48 | for file in $(find ${SRCDIR} -type d -name CVS) | ||
49 | do | ||
50 | rm -rf ${file} | ||
51 | done | ||
52 | |||
53 | # clean up backup files (foo~) | ||
54 | find ${SRCDIR} -name *~ -exec rm '{}' ';' || die | ||
55 | } | ||
56 | |||
57 | cvs_src_prepare() | ||
58 | { | ||
59 | cvs_fetch_source || die | ||
60 | } | ||
61 | |||
62 | export_inherits cvs src_prepare |