ottxor      14/07/25 23:18:34

  Modified:             ChangeLog mercurial.eclass
  Log:
  Added EHG_CHECKOUT_DIR to override checkout destination

Revision  Changes    Path
1.1325               eclass/ChangeLog

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1325&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1325&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1324&r2=1.1325

Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1324
retrieving revision 1.1325
diff -u -r1.1324 -r1.1325
--- ChangeLog   22 Jul 2014 06:38:56 -0000      1.1324
+++ ChangeLog   25 Jul 2014 23:18:34 -0000      1.1325
@@ -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 <[email protected]> mercurial.eclass:
+  Added EHG_CHECKOUT_DIR to override checkout destination
 
   22 Jul 2014; Michael Haubenwallner <[email protected]> java-vm-2.eclass:
   Respect EPREFIX in pkg_postinst, bug#517236.



1.24                 eclass/mercurial.eclass

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mercurial.eclass?rev=1.24&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mercurial.eclass?rev=1.24&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/mercurial.eclass?r1=1.23&r2=1.24

Index: mercurial.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/mercurial.eclass,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- mercurial.eclass    4 Nov 2013 22:05:31 -0000       1.23
+++ mercurial.eclass    25 Jul 2014 23:18:34 -0000      1.24
@@ -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 @@
 
 # @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 @@
 # 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 @@
 # 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 @@
        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 @@
        # 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 @@
        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}" \




Reply via email to