1 |
nelchael 10/04/02 18:29:39 |
2 |
|
3 |
Modified: mercurial.eclass |
4 |
Log: |
5 |
Allow changing store directory, update maintainers. |
6 |
|
7 |
Revision Changes Path |
8 |
1.12 eclass/mercurial.eclass |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/mercurial.eclass?rev=1.12&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/mercurial.eclass?rev=1.12&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/mercurial.eclass?r1=1.11&r2=1.12 |
13 |
|
14 |
Index: mercurial.eclass |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-x86/eclass/mercurial.eclass,v |
17 |
retrieving revision 1.11 |
18 |
retrieving revision 1.12 |
19 |
diff -u -r1.11 -r1.12 |
20 |
--- mercurial.eclass 6 Mar 2010 12:24:05 -0000 1.11 |
21 |
+++ mercurial.eclass 2 Apr 2010 18:29:39 -0000 1.12 |
22 |
@@ -1,10 +1,11 @@ |
23 |
# Copyright 1999-2006 Gentoo Foundation |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/mercurial.eclass,v 1.11 2010/03/06 12:24:05 djc Exp $ |
26 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/mercurial.eclass,v 1.12 2010/04/02 18:29:39 nelchael Exp $ |
27 |
|
28 |
# @ECLASS: mercurial.eclass |
29 |
# @MAINTAINER: |
30 |
-# nelchael@g.o |
31 |
+# Krzysztof Pawlik <nelchael@g.o> |
32 |
+# Dirkjan Ochtman <djc@g.o> |
33 |
# @BLURB: This eclass provides generic mercurial fetching functions |
34 |
# @DESCRIPTION: |
35 |
# This eclass provides generic mercurial fetching functions. To fetch sources |
36 |
@@ -30,6 +31,11 @@ |
37 |
# just a revision, please consult `hg help revisions' for more details. |
38 |
[[ -z "${EHG_REVISION}" ]] && EHG_REVISION="tip" |
39 |
|
40 |
+# @ECLASS-VARIABLE: EHG_STORE_DIR |
41 |
+# @DESCRIPTION: |
42 |
+# Mercurial sources store directory. Users may override this in /etc/make.conf |
43 |
+[[ -z "${EHG_STORE_DIR}" ]] && EHG_STORE_DIR="${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}/hg-src" |
44 |
+ |
45 |
# @ECLASS-VARIABLE: EHG_PROJECT |
46 |
# @DESCRIPTION: |
47 |
# Project name. |
48 |
@@ -74,38 +80,37 @@ |
49 |
EHG_REPO_URI=${1-${EHG_REPO_URI}} |
50 |
[[ -z "${EHG_REPO_URI}" ]] && die "EHG_REPO_URI is empty" |
51 |
|
52 |
- local hg_src_dir="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/hg-src" |
53 |
local module="${2-$(basename "${EHG_REPO_URI}")}" |
54 |
|
55 |
# Should be set but blank to prevent using $HOME/.hgrc |
56 |
export HGRCPATH= |
57 |
|
58 |
- # Check ${hg_src_dir} directory: |
59 |
- addwrite "$(dirname "${hg_src_dir}")" || die "addwrite failed" |
60 |
- if [[ ! -d "${hg_src_dir}" ]]; then |
61 |
- mkdir -p "${hg_src_dir}" || die "failed to create ${hg_src_dir}" |
62 |
- chmod -f g+rw "${hg_src_dir}" || \ |
63 |
- die "failed to chown ${hg_src_dir}" |
64 |
+ # Check ${EHG_STORE_DIR} directory: |
65 |
+ addwrite "$(dirname "${EHG_STORE_DIR}")" || die "addwrite failed" |
66 |
+ if [[ ! -d "${EHG_STORE_DIR}" ]]; then |
67 |
+ mkdir -p "${EHG_STORE_DIR}" || die "failed to create ${EHG_STORE_DIR}" |
68 |
+ chmod -f g+rw "${EHG_STORE_DIR}" || \ |
69 |
+ die "failed to chown ${EHG_STORE_DIR}" |
70 |
fi |
71 |
|
72 |
# Create project directory: |
73 |
- mkdir -p "${hg_src_dir}/${EHG_PROJECT}" || \ |
74 |
- die "failed to create ${hg_src_dir}/${EHG_PROJECT}" |
75 |
- chmod -f g+rw "${hg_src_dir}/${EHG_PROJECT}" || \ |
76 |
+ mkdir -p "${EHG_STORE_DIR}/${EHG_PROJECT}" || \ |
77 |
+ die "failed to create ${EHG_STORE_DIR}/${EHG_PROJECT}" |
78 |
+ chmod -f g+rw "${EHG_STORE_DIR}/${EHG_PROJECT}" || \ |
79 |
echo "Warning: failed to chmod g+rw ${EHG_PROJECT}" |
80 |
- cd "${hg_src_dir}/${EHG_PROJECT}" || \ |
81 |
- die "failed to cd to ${hg_src_dir}/${EHG_PROJECT}" |
82 |
+ cd "${EHG_STORE_DIR}/${EHG_PROJECT}" || \ |
83 |
+ die "failed to cd to ${EHG_STORE_DIR}/${EHG_PROJECT}" |
84 |
|
85 |
# Clone/update repository: |
86 |
if [[ ! -d "${module}" ]]; then |
87 |
- einfo "Cloning ${EHG_REPO_URI} to ${hg_src_dir}/${EHG_PROJECT}/${module}" |
88 |
+ einfo "Cloning ${EHG_REPO_URI} to ${EHG_STORE_DIR}/${EHG_PROJECT}/${module}" |
89 |
${EHG_CLONE_CMD} "${EHG_REPO_URI}" "${module}" || { |
90 |
rm -rf "${module}" |
91 |
die "failed to clone ${EHG_REPO_URI}" |
92 |
} |
93 |
cd "${module}" |
94 |
elif [[ -z "${EHG_OFFLINE}" ]]; then |
95 |
- einfo "Updating ${hg_src_dir}/${EHG_PROJECT}/${module} from ${EHG_REPO_URI}" |
96 |
+ einfo "Updating ${EHG_STORE_DIR}/${EHG_PROJECT}/${module} from ${EHG_REPO_URI}" |
97 |
cd "${module}" || die "failed to cd to ${module}" |
98 |
${EHG_PULL_CMD} || die "update failed" |
99 |
fi |
100 |
@@ -115,7 +120,7 @@ |
101 |
hg clone \ |
102 |
${EHG_QUIET_CMD_OPT} \ |
103 |
--rev="${EHG_REVISION}" \ |
104 |
- "${hg_src_dir}/${EHG_PROJECT}/${module}" \ |
105 |
+ "${EHG_STORE_DIR}/${EHG_PROJECT}/${module}" \ |
106 |
"${WORKDIR}/${module}" || die "hg clone failed" |
107 |
} |