diff options
author | Christoph Junghans <ottxor@gentoo.org> | 2014-07-25 23:18:34 +0000 |
---|---|---|
committer | Christoph Junghans <ottxor@gentoo.org> | 2014-07-25 23:18:34 +0000 |
commit | 5cf35af944aba4867e97bb3c07c21ea124eac22c (patch) | |
tree | 1905581a9c2d074ad80e9d50fc7417efec2af740 /eclass | |
parent | masked dev-lang/libcilkrts (bug #514644) (diff) | |
download | historical-5cf35af944aba4867e97bb3c07c21ea124eac22c.tar.gz historical-5cf35af944aba4867e97bb3c07c21ea124eac22c.tar.bz2 historical-5cf35af944aba4867e97bb3c07c21ea124eac22c.zip |
Added EHG_CHECKOUT_DIR to override checkout destination
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 5 | ||||
-rw-r--r-- | eclass/mercurial.eclass | 27 |
2 files changed, 20 insertions, 12 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index 765e3f45debb..764fc0d94bf9 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for eclass directory # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1324 2014/07/22 06:38:56 haubi Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1325 2014/07/25 23:18:34 ottxor Exp $ + + 25 Jul 2014; Christoph Junghans <ottxor@gentoo.org> mercurial.eclass: + Added EHG_CHECKOUT_DIR to override checkout destination 22 Jul 2014; Michael Haubenwallner <haubi@gentoo.org> java-vm-2.eclass: Respect EPREFIX in pkg_postinst, bug#517236. diff --git a/eclass/mercurial.eclass b/eclass/mercurial.eclass index 51446d2c4405..eeb554e220ff 100644 --- a/eclass/mercurial.eclass +++ b/eclass/mercurial.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2013 Gentoo Foundation +# Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/mercurial.eclass,v 1.23 2013/11/04 22:05:31 floppym Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/mercurial.eclass,v 1.24 2014/07/25 23:18:34 ottxor Exp $ # @ECLASS: mercurial.eclass # @MAINTAINER: @@ -28,7 +28,7 @@ DEPEND="dev-vcs/mercurial" # @ECLASS-VARIABLE: EHG_REVISION # @DESCRIPTION: -# Create working directory for specified revision, defaults to tip. +# Create working directory for specified revision, defaults to default. # # EHG_REVISION is passed as a value for --updaterev parameter, so it can be more # than just a revision, please consult `hg help revisions' for more details. @@ -47,6 +47,12 @@ DEPEND="dev-vcs/mercurial" # between several ebuilds. [[ -z "${EHG_PROJECT}" ]] && EHG_PROJECT="${PN}" +# @ECLASS-VARIABLE: EGIT_CHECKOUT_DIR +# @DESCRIPTION: +# The directory to check the hg sources out to. +# +# EHG_CHECKOUT_DIR=${S} + # @ECLASS-VARIABLE: EHG_QUIET # @DESCRIPTION: # Suppress some extra noise from mercurial, set it to 'ON' to be quiet. @@ -76,7 +82,9 @@ EHG_OFFLINE="${EHG_OFFLINE:-${EVCS_OFFLINE}}" # Clone or update repository. # # If repository URI is not passed it defaults to EHG_REPO_URI, if module is -# empty it defaults to basename of EHG_REPO_URI, sourcedir defaults to S. +# empty it defaults to basename of EHG_REPO_URI, sourcedir defaults to +# EHG_CHECKOUT_DIR, which defaults to S. + mercurial_fetch() { debug-print-function ${FUNCNAME} "${@}" @@ -85,12 +93,8 @@ mercurial_fetch() { EHG_REPO_URI=${1-${EHG_REPO_URI}} [[ -z "${EHG_REPO_URI}" ]] && die "EHG_REPO_URI is empty" - local cert_opt=() - [[ -f ${EPREFIX}/etc/ssl/certs/ca-certificates.crt ]] && \ - cert_opt=( --config "web.cacerts=${EPREFIX}/etc/ssl/certs/ca-certificates.crt" ) - local module="${2-$(basename "${EHG_REPO_URI}")}" - local sourcedir="${3-${S}}" + local sourcedir="${3:-${EHG_CHECKOUT_DIR:-${S}}}" # Should be set but blank to prevent using $HOME/.hgrc export HGRCPATH= @@ -114,7 +118,7 @@ mercurial_fetch() { # Clone/update repository: if [[ ! -d "${module}" ]]; then einfo "Cloning ${EHG_REPO_URI} to ${EHG_STORE_DIR}/${EHG_PROJECT}/${module}" - ${EHG_CLONE_CMD} "${cert_opt[@]}" "${EHG_REPO_URI}" "${module}" || { + ${EHG_CLONE_CMD} "${EHG_REPO_URI}" "${module}" || { rm -rf "${module}" die "failed to clone ${EHG_REPO_URI}" } @@ -122,11 +126,12 @@ mercurial_fetch() { elif [[ -z "${EHG_OFFLINE}" ]]; then einfo "Updating ${EHG_STORE_DIR}/${EHG_PROJECT}/${module} from ${EHG_REPO_URI}" cd "${module}" || die "failed to cd to ${module}" - ${EHG_PULL_CMD} "${cert_opt[@]}" "${EHG_REPO_URI}" || die "update failed" + ${EHG_PULL_CMD} "${EHG_REPO_URI}" || die "update failed" fi # Checkout working copy: einfo "Creating working directory in ${sourcedir} (target revision: ${EHG_REVISION})" + mkdir -p "${sourcedir}" || die "failed to create ${sourcedir}" hg clone \ ${EHG_QUIET_CMD_OPT} \ --updaterev="${EHG_REVISION}" \ |