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

Diff of /eclass/mercurial.eclass

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

Revision 1.6 Revision 1.8
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.6 2009/03/11 18:56:28 nelchael Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mercurial.eclass,v 1.8 2009/12/11 21:02:29 robbat2 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
33# 33#
34# This variable default to $PN, but can be changed to allow repository sharing 34# This variable default to $PN, but can be changed to allow repository sharing
35# between several ebuilds. 35# between several ebuilds.
36[[ -z "${EHG_PROJECT}" ]] && EHG_PROJECT="${PN}" 36[[ -z "${EHG_PROJECT}" ]] && EHG_PROJECT="${PN}"
37 37
38# @ECLASS-VARIABLE: EHG_QUIET
39# @DESCRIPTION:
40# Suppress some extra noise from mercurial, set it to 'OFF' to be louder.
41: ${EHG_QUIET:="ON"}
42[[ "${EHG_QUIET}" == "ON" ]] && EHG_QUIET_CMD_OPT="--quiet"
43
38# @ECLASS-VARIABLE: EHG_CLONE_CMD 44# @ECLASS-VARIABLE: EHG_CLONE_CMD
39# @DESCRIPTION: 45# @DESCRIPTION:
40# Command used to perform initial repository clone. 46# Command used to perform initial repository clone.
41[[ -z "${EHG_CLONE_CMD}" ]] && EHG_CLONE_CMD="hg clone --quiet --pull --noupdate" 47[[ -z "${EHG_CLONE_CMD}" ]] && EHG_CLONE_CMD="hg clone ${EHG_QUIET_CMD_OPT} --pull --noupdate"
42 48
43# @ECLASS-VARIABLE: EHG_PULL_CMD 49# @ECLASS-VARIABLE: EHG_PULL_CMD
44# @DESCRIPTION: 50# @DESCRIPTION:
45# Command used to update repository. 51# Command used to update repository.
46[[ -z "${EHG_PULL_CMD}" ]] && EHG_PULL_CMD="hg pull --quiet" 52[[ -z "${EHG_PULL_CMD}" ]] && EHG_PULL_CMD="hg pull ${EHG_QUIET_CMD_OPT}"
53
54# @ECLASS-VARIABLE: EHG_OFFLINE
55# @DESCRIPTION:
56# Set this variable to a non-empty value to disable the automatic updating of
57# a mercurial source tree. This is intended to be set outside the ebuild by
58# users.
59EHG_OFFLINE="${EHG_OFFLINE:-${ESCM_OFFLINE}}"
47 60
48# @FUNCTION: mercurial_fetch 61# @FUNCTION: mercurial_fetch
49# @USAGE: [repository_uri] [module] 62# @USAGE: [repository_uri] [module]
50# @DESCRIPTION: 63# @DESCRIPTION:
51# Clone or update repository. 64# Clone or update repository.
86 ${EHG_CLONE_CMD} "${EHG_REPO_URI}" "${module}" || { 99 ${EHG_CLONE_CMD} "${EHG_REPO_URI}" "${module}" || {
87 rm -rf "${module}" 100 rm -rf "${module}"
88 die "failed to clone ${EHG_REPO_URI}" 101 die "failed to clone ${EHG_REPO_URI}"
89 } 102 }
90 cd "${module}" 103 cd "${module}"
91 else 104 elif [[ -z "${EHG_OFFLINE}" ]]; then
92 einfo "Updating ${hg_src_dir}/${EHG_PROJECT}/${module} from ${EHG_REPO_URI}" 105 einfo "Updating ${hg_src_dir}/${EHG_PROJECT}/${module} from ${EHG_REPO_URI}"
93 cd "${module}" || die "failed to cd to ${module}" 106 cd "${module}" || die "failed to cd to ${module}"
94 ${EHG_PULL_CMD} || die "update failed" 107 ${EHG_PULL_CMD} || die "update failed"
95 fi 108 fi
96 109
97 # Checkout working copy: 110 # Checkout working copy:
98 einfo "Creating working directory in ${WORKDIR}/${module} (revision: ${EHG_REVISION})" 111 einfo "Creating working directory in ${WORKDIR}/${module} (revision: ${EHG_REVISION})"
99 hg clone \ 112 hg clone \
100 --quiet \ 113 ${EHG_QUIET_CMD_OPT} \
101 --rev="${EHG_REVISION}" \ 114 --rev="${EHG_REVISION}" \
102 "${hg_src_dir}/${EHG_PROJECT}/${module}" \ 115 "${hg_src_dir}/${EHG_PROJECT}/${module}" \
103 "${WORKDIR}/${module}" || die "hg clone failed" 116 "${WORKDIR}/${module}" || die "hg clone failed"
104} 117}
105 118

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

  ViewVC Help
Powered by ViewVC 1.1.20