/[gentoo-x86]/eclass/subversion.eclass
Gentoo

Diff of /eclass/subversion.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 Revision 1.6
1# Copyright 1999-2004 Gentoo Technologies, Inc. 1# Copyright 1999-2004 Gentoo Technologies, Inc.
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/subversion.eclass,v 1.1 2004/01/25 12:27:18 hattya Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/subversion.eclass,v 1.6 2004/03/01 16:34:42 hattya Exp $
4 4
5## --------------------------------------------------------------------------- # 5## --------------------------------------------------------------------------- #
6# Author: Akinori Hattori <hattya@gentoo.org> 6# Author: Akinori Hattori <hattya@gentoo.org>
7# 7#
8# The subversion eclass is written to fetch the software sources from 8# The subversion eclass is written to fetch the software sources from
20INHERITED="${INHERITED} ${ECLASS}" 20INHERITED="${INHERITED} ${ECLASS}"
21 21
22EXPORT_FUNCTIONS src_unpack 22EXPORT_FUNCTIONS src_unpack
23 23
24HOMEPAGE="http://subversion.tigris.org/" 24HOMEPAGE="http://subversion.tigris.org/"
25DESCRIPTION="Based on the ${ECLASS} eclass"
25 26
26 27
27## -- add subversion in DEPEND 28## -- add subversion in DEPEND
28# 29#
29newdepend "dev-util/subversion" 30newdepend "dev-util/subversion"
48 49
49 50
50## -- ESVN_REPO_URI: repository uri 51## -- ESVN_REPO_URI: repository uri
51# 52#
52# e.g. http://foo/trunk, svn://bar/trunk 53# e.g. http://foo/trunk, svn://bar/trunk
53# but currentry support http only. 54# but currentry support http and https only.
54# 55#
55[ -z "${ESVN_REPO_URI}" ] && ESVN_REPO_URI="" 56[ -z "${ESVN_REPO_URI}" ] && ESVN_REPO_URI=""
56 57
57 58
58## -- ESVN_PROJECT: project name of your ebuild 59## -- ESVN_PROJECT: project name of your ebuild
81 82
82## -- subversion_svn_fetch() ------------------------------------------------- # 83## -- subversion_svn_fetch() ------------------------------------------------- #
83 84
84subversion_svn_fetch() { 85subversion_svn_fetch() {
85 86
86 # http only... 87 # ESVN_REPO_URI is empty.
87 if [ "${ESVN_REPO_URI%%:*}" != "http" ]; then 88 [ -z "${ESVN_REPO_URI}" ] && die "subversion.eclass: ESVN_REPO_URI is empty."
88 if [ -z "${ESVN_REPO_URI}" ]; then
89 die "subversion.eclass: ESVN_REPO_URI is not empty."
90 89
91 elif [ "${ESVN_REPO_URI}" = "none" ]; then 90 # http and https only...
92 die "subversion.eclass: ESVN_REPO_URI is not define." 91 case ${ESVN_REPO_URI%%:*} in
92 http) ;;
93 https) ;;
94 *)
95 die "subversion.eclass: fetch from "${ESVN_REPO_URI%:*}" is not yet implemented."
96 ;;
97 esac
93 98
94 else 99 # every time
95 die "subversion.eclass: fetch from "${ESVN_REPO_URI%:*}" is not yet implemented." 100 addwrite "${ESVN_STORE_DIR}"
101 addwrite "/etc/subversion"
96 102
97 fi 103 # -userpriv
98 fi 104 addwrite "/root/.subversion"
99 105
100 if [ ! -d "${ESVN_STORE_DIR}" ]; then 106 if [ ! -d "${ESVN_STORE_DIR}" ]; then
101 mkdir -p "${ESVN_STORE_DIR}" 107 mkdir -p "${ESVN_STORE_DIR}" || die "subversion.eclass: can't mkdir ${ESVN_STORE_DIR}."
108 chmod -f o+rw "${ESVN_STORE_DIR}" || die "subversion.eclass: can't chmod ${ESVN_STORE_DIR}."
102 einfo "created store directory: ${ESVN_STORE_DIR}" 109 einfo "created store directory: ${ESVN_STORE_DIR}"
103 einfo 110 einfo
104 fi 111 fi
105 112
106 cd "${ESVN_STORE_DIR}" 113 cd "${ESVN_STORE_DIR}"
107 addwrite "/etc/subversion"
108 einfo
109 114
110 if [ -z ${ESVN_REPO_URI##*/} ]; then 115 if [ -z ${ESVN_REPO_URI##*/} ]; then
111 ESVN_REPO_FIX="${ESVN_REPO_FIX%/}" 116 ESVN_REPO_FIX="${ESVN_REPO_URI%/}"
117 else
118 ESVN_REPO_FIX="${ESVN_REPO_URI}"
112 fi 119 fi
113 120
114 ESVN_CO_DIR="${ESVN_PROJECT}/${ESVN_REPO_URI##*/}" 121 ESVN_CO_DIR="${ESVN_PROJECT}/${ESVN_REPO_FIX##*/}"
115 122
116 if [ ! -d "${ESVN_CO_DIR}/.svn" ]; then 123 if [ ! -d "${ESVN_CO_DIR}/.svn" ]; then
117 # first check out 124 # first check out
118 einfo "subversion check out start -->" 125 einfo "subversion check out start -->"
119 einfo 126 einfo
120 einfo "check out from: ${ESVN_REPO_URI}" 127 einfo "check out from: ${ESVN_REPO_URI}"
121 128
122 mkdir -p "${ESVN_PROJECT}" 129 mkdir -p "${ESVN_PROJECT}" || die "subversion.eclass: can't mkdir ${ESVN_PROJECT}."
130 chmod -f o+rw "${ESVN_PROJECT}" || die "subversion.eclass: can't chmod ${ESVN_PROJECT}."
123 cd "${ESVN_PROJECT}" 131 cd "${ESVN_PROJECT}"
124 132 ${ESVN_FETCH_CMD} "${ESVN_REPO_URI}" || die "subversion.eclass: can't fetch from ${ESVN_REPO_URI}."
125 #${ESVN_FETCH_CMD} "${ESVN_REPO_URI}"
126 einfo " stored in: ${ESVN_STORE_DIR}/${ESVN_CO_DIR}" 133 einfo " stored in: ${ESVN_STORE_DIR}/${ESVN_CO_DIR}"
127 134
128 else 135 else
129 # update working copy 136 # update working copy
130 einfo "subversion update start -->" 137 einfo "subversion update start -->"
131 einfo 138 einfo
132 einfo " update from: ${ESVN_REPO_URI}" 139 einfo " update from: ${ESVN_REPO_URI}"
133 140
134 cd "${ESVN_CO_DIR}" 141 cd "${ESVN_CO_DIR}"
135 #${ESVN_UPDATE_CMD} 142 ${ESVN_UPDATE_CMD} || die "subversion.eclass: can't update from ${ESVN_REPO_URI}."
136 einfo " updated in: ${ESVN_STORE_DIR}/${ESVN_CO_DIR}" 143 einfo " updated in: ${ESVN_STORE_DIR}/${ESVN_CO_DIR}"
137 fi 144 fi
138 145
146 # permission fix
147 chmod -Rf o+rw .
148
139 # copy to the ${WORKDIR} 149 # copy to the ${WORKDIR}
140 cp -Rf "${ESVN_STORE_DIR}/${ESVN_CO_DIR}" "${WORKDIR}/${P}" 150 cp -Rf "${ESVN_STORE_DIR}/${ESVN_CO_DIR}" "${WORKDIR}/${P}" || die "subversion.eclass: can't copy to ${WORKDIR}/${P}."
141 einfo 151 einfo
142 152
143} 153}
144 154
145 155
149 159
150 if [ -n "${ESVN_BOOTSTRAP}" ]; then 160 if [ -n "${ESVN_BOOTSTRAP}" ]; then
151 cd "${WORKDIR}/${P}" 161 cd "${WORKDIR}/${P}"
152 162
153 if [ -x "${ESVN_BOOTSTRAP}" ]; then 163 if [ -x "${ESVN_BOOTSTRAP}" ]; then
154 ./${ESVN_BOOTSTRAP} 164 einfo "begin bootstrap -->"
165 ./${ESVN_BOOTSTRAP} || die "subversion.eclass: can't bootstrap with ${ESVN_BOOTSTRAP}."
155 fi 166 fi
156 167
157 fi 168 fi
158 169
159} 170}
161 172
162## -- subversion_src_unpack() ------------------------------------------------ # 173## -- subversion_src_unpack() ------------------------------------------------ #
163 174
164subversion_src_unpack() { 175subversion_src_unpack() {
165 176
166 subversion_svn_fetch 177 subversion_svn_fetch || die "subversion.eclass: unknown problem in subversion_svn_fetch()."
167 subversion_bootstrap 178 subversion_bootstrap || die "subversion.eclass: unknown problem in subversion_bootstrap()."
168 179
169} 180}

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.20