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

Diff of /eclass/mercurial.eclass

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

Revision 1.7 Revision 1.11
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.7 2009/09/29 21:51:33 nelchael 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
15inherit eutils 15inherit eutils
16 16
17EXPORT_FUNCTIONS src_unpack 17EXPORT_FUNCTIONS src_unpack
18 18
19DEPEND="dev-util/mercurial" 19DEPEND="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.
33# 36#
34# This variable default to $PN, but can be changed to allow repository sharing 37# This variable default to $PN, but can be changed to allow repository sharing
35# between several ebuilds. 38# between several ebuilds.
36[[ -z "${EHG_PROJECT}" ]] && EHG_PROJECT="${PN}" 39[[ -z "${EHG_PROJECT}" ]] && EHG_PROJECT="${PN}"
37 40
41# @ECLASS-VARIABLE: EHG_QUIET
42# @DESCRIPTION:
43# Suppress some extra noise from mercurial, set it to 'OFF' to be louder.
44: ${EHG_QUIET:="ON"}
45[[ "${EHG_QUIET}" == "ON" ]] && EHG_QUIET_CMD_OPT="--quiet"
46
38# @ECLASS-VARIABLE: EHG_CLONE_CMD 47# @ECLASS-VARIABLE: EHG_CLONE_CMD
39# @DESCRIPTION: 48# @DESCRIPTION:
40# Command used to perform initial repository clone. 49# Command used to perform initial repository clone.
41[[ -z "${EHG_CLONE_CMD}" ]] && EHG_CLONE_CMD="hg clone --quiet --pull --noupdate" 50[[ -z "${EHG_CLONE_CMD}" ]] && EHG_CLONE_CMD="hg clone ${EHG_QUIET_CMD_OPT} --pull --noupdate"
42 51
43# @ECLASS-VARIABLE: EHG_PULL_CMD 52# @ECLASS-VARIABLE: EHG_PULL_CMD
44# @DESCRIPTION: 53# @DESCRIPTION:
45# Command used to update repository. 54# Command used to update repository.
46[[ -z "${EHG_PULL_CMD}" ]] && EHG_PULL_CMD="hg pull --quiet" 55[[ -z "${EHG_PULL_CMD}" ]] && EHG_PULL_CMD="hg pull ${EHG_QUIET_CMD_OPT}"
47 56
48# @ECLASS-VARIABLE: EHG_OFFLINE 57# @ECLASS-VARIABLE: EHG_OFFLINE
49# @DESCRIPTION: 58# @DESCRIPTION:
50# Set this variable to a non-empty value to disable the automatic updating of 59# Set this variable to a non-empty value to disable the automatic updating of
51# a mercurial source tree. This is intended to be set outside the ebuild by 60# a mercurial source tree. This is intended to be set outside the ebuild by
81 90
82 # Create project directory: 91 # Create project directory:
83 mkdir -p "${hg_src_dir}/${EHG_PROJECT}" || \ 92 mkdir -p "${hg_src_dir}/${EHG_PROJECT}" || \
84 die "failed to create ${hg_src_dir}/${EHG_PROJECT}" 93 die "failed to create ${hg_src_dir}/${EHG_PROJECT}"
85 chmod -f g+rw "${hg_src_dir}/${EHG_PROJECT}" || \ 94 chmod -f g+rw "${hg_src_dir}/${EHG_PROJECT}" || \
86 die "failed to chwon ${EHG_PROJECT}" 95 echo "Warning: failed to chmod g+rw ${EHG_PROJECT}"
87 cd "${hg_src_dir}/${EHG_PROJECT}" || \ 96 cd "${hg_src_dir}/${EHG_PROJECT}" || \
88 die "failed to cd to ${hg_src_dir}/${EHG_PROJECT}" 97 die "failed to cd to ${hg_src_dir}/${EHG_PROJECT}"
89 98
90 # Clone/update repository: 99 # Clone/update repository:
91 if [[ ! -d "${module}" ]]; then 100 if [[ ! -d "${module}" ]]; then
102 fi 111 fi
103 112
104 # Checkout working copy: 113 # Checkout working copy:
105 einfo "Creating working directory in ${WORKDIR}/${module} (revision: ${EHG_REVISION})" 114 einfo "Creating working directory in ${WORKDIR}/${module} (revision: ${EHG_REVISION})"
106 hg clone \ 115 hg clone \
107 --quiet \ 116 ${EHG_QUIET_CMD_OPT} \
108 --rev="${EHG_REVISION}" \ 117 --rev="${EHG_REVISION}" \
109 "${hg_src_dir}/${EHG_PROJECT}/${module}" \ 118 "${hg_src_dir}/${EHG_PROJECT}/${module}" \
110 "${WORKDIR}/${module}" || die "hg clone failed" 119 "${WORKDIR}/${module}" || die "hg clone failed"
111} 120}
112 121

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.20