| 1 | # Copyright 1999-2006 Gentoo Foundation |
1 | # Copyright 1999-2006 Gentoo Foundation |
| 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/mercurial.eclass,v 1.8 2009/12/11 21:02:29 robbat2 Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/mercurial.eclass,v 1.11 2010/03/06 12:24:05 djc Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: mercurial.eclass |
5 | # @ECLASS: mercurial.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # nelchael@gentoo.org |
7 | # nelchael@gentoo.org |
| 8 | # @BLURB: This eclass provides generic mercurial fetching functions |
8 | # @BLURB: This eclass provides generic mercurial fetching functions |
| … | |
… | |
| 14 | |
14 | |
| 15 | inherit eutils |
15 | inherit eutils |
| 16 | |
16 | |
| 17 | EXPORT_FUNCTIONS src_unpack |
17 | EXPORT_FUNCTIONS src_unpack |
| 18 | |
18 | |
| 19 | DEPEND="dev-util/mercurial" |
19 | DEPEND="dev-vcs/mercurial" |
| 20 | |
20 | |
| 21 | # @ECLASS-VARIABLE: EHG_REPO_URI |
21 | # @ECLASS-VARIABLE: EHG_REPO_URI |
| 22 | # @DESCRIPTION: |
22 | # @DESCRIPTION: |
| 23 | # Mercurial repository URI. |
23 | # Mercurial repository URI. |
| 24 | |
24 | |
| 25 | # @ECLASS-VARIABLE: EHG_REVISION |
25 | # @ECLASS-VARIABLE: EHG_REVISION |
| 26 | # @DESCRIPTION: |
26 | # @DESCRIPTION: |
| 27 | # Create working directory for specified revision, defaults to tip. |
27 | # Create working directory for specified revision, defaults to tip. |
|
|
28 | # |
|
|
29 | # EHG_REVISION is passed as a value for --rev parameter, so it can be more than |
|
|
30 | # just a revision, please consult `hg help revisions' for more details. |
| 28 | [[ -z "${EHG_REVISION}" ]] && EHG_REVISION="tip" |
31 | [[ -z "${EHG_REVISION}" ]] && EHG_REVISION="tip" |
| 29 | |
32 | |
| 30 | # @ECLASS-VARIABLE: EHG_PROJECT |
33 | # @ECLASS-VARIABLE: EHG_PROJECT |
| 31 | # @DESCRIPTION: |
34 | # @DESCRIPTION: |
| 32 | # Project name. |
35 | # Project name. |
| … | |
… | |
| 87 | |
90 | |
| 88 | # Create project directory: |
91 | # Create project directory: |
| 89 | mkdir -p "${hg_src_dir}/${EHG_PROJECT}" || \ |
92 | mkdir -p "${hg_src_dir}/${EHG_PROJECT}" || \ |
| 90 | die "failed to create ${hg_src_dir}/${EHG_PROJECT}" |
93 | die "failed to create ${hg_src_dir}/${EHG_PROJECT}" |
| 91 | chmod -f g+rw "${hg_src_dir}/${EHG_PROJECT}" || \ |
94 | chmod -f g+rw "${hg_src_dir}/${EHG_PROJECT}" || \ |
| 92 | die "failed to chwon ${EHG_PROJECT}" |
95 | echo "Warning: failed to chmod g+rw ${EHG_PROJECT}" |
| 93 | cd "${hg_src_dir}/${EHG_PROJECT}" || \ |
96 | cd "${hg_src_dir}/${EHG_PROJECT}" || \ |
| 94 | die "failed to cd to ${hg_src_dir}/${EHG_PROJECT}" |
97 | die "failed to cd to ${hg_src_dir}/${EHG_PROJECT}" |
| 95 | |
98 | |
| 96 | # Clone/update repository: |
99 | # Clone/update repository: |
| 97 | if [[ ! -d "${module}" ]]; then |
100 | if [[ ! -d "${module}" ]]; then |