Hello,

I'm sending this patch for discussion, what it changes? The change is to where
the final clone of repository will be placed, it used to be ${WORKDIR}/${module}
(where module usually is the last component of source URI) to ${WORKDIR}/${P}
(essentially ${S}). This has few effects:
 - ebuilds using mercurial.eclass don't need to set S any longer
 - mercurial.eclass behaves more like git.eclass
 - it breaks all existing ebuilds using this eclass

The last effect is really, really nasty :( At the same time I think it's worth
fixing this now, not when we have even more ebuilds using mercurial.eclass.
Thankfully the fix to this is trivial: just remove the line where S is being set
(or adjust it to match as is in case of one ebuild in the tree).

Following ebuilds in tree use mercurial.eclass:

dev-python/django-piston/django-piston-9999.ebuild
dev-vcs/mercurial/mercurial-9999.ebuild
media-radio/radiotray/radiotray-9999.ebuild
media-tv/v4l-dvb-hg/v4l-dvb-hg-0.1-r3.ebuild
media-tv/v4l-dvb-hg/v4l-dvb-hg-0.1-r2.ebuild
www-client/dillo/dillo-9999.ebuild
x11-misc/sselp/sselp-9999.ebuild
x11-wm/parti/parti-9999.ebuild

If there are no objections my plan is as follows:
 - in a week commit the change to eclass
 - fix all above ebuilds
 - send a small announcement to gentoo-dev-announcement

Bug: https://bugs.gentoo.org/343993

-- 
Krzysztof Pawlik  <nelchael at gentoo.org>  key id: 0xF6A80E46
desktop-misc, java, vim, kernel, python, apache...
Index: mercurial.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/mercurial.eclass,v
retrieving revision 1.14
diff -u -r1.14 mercurial.eclass
--- mercurial.eclass    26 Oct 2010 19:04:44 -0000      1.14
+++ mercurial.eclass    6 Nov 2010 09:05:37 -0000
@@ -68,12 +68,14 @@
 EHG_OFFLINE="${EHG_OFFLINE:-${ESCM_OFFLINE}}"
 
 # @FUNCTION: mercurial_fetch
-# @USAGE: [repository_uri] [module]
+# @USAGE: [repository_uri] [module] [workdir]
 # @DESCRIPTION:
 # Clone or update repository.
 #
-# If not repository URI is passed it defaults to EHG_REPO_URI, if module is
-# empty it defaults to basename of EHG_REPO_URI.
+# If repository URI is not passed it defaults to EHG_REPO_URI, if module is
+# empty it defaults to basename of EHG_REPO_URI, workdir defaults to P. workdir
+# argument is a directory name under WORKDIR where sources will be available. 
If
+# you change workdir note that you will need to adjust S to match.
 function mercurial_fetch {
        debug-print-function ${FUNCNAME} ${*}
 
@@ -81,6 +83,7 @@
        [[ -z "${EHG_REPO_URI}" ]] && die "EHG_REPO_URI is empty"
 
        local module="${2-$(basename "${EHG_REPO_URI}")}"
+       local workdir="${3-${P}}"
 
        # Should be set but blank to prevent using $HOME/.hgrc
        export HGRCPATH=
@@ -116,19 +119,19 @@
        fi
 
        # Checkout working copy:
-       einfo "Creating working directory in ${WORKDIR}/${module} (target 
revision: ${EHG_REVISION})"
+       einfo "Creating working directory in ${WORKDIR}/${workdir} (target 
revision: ${EHG_REVISION})"
        hg clone \
                ${EHG_QUIET_CMD_OPT} \
                --rev="${EHG_REVISION}" \
                "${EHG_STORE_DIR}/${EHG_PROJECT}/${module}" \
-               "${WORKDIR}/${module}" || die "hg clone failed"
+               "${WORKDIR}/${workdir}" || die "hg clone failed"
        # An exact revision helps a lot for testing purposes, so have some 
output...
        # id           num  branch
        # fd6e32d61721 6276 default
-       local HG_REVDATA=($(hg identify -b -i "${WORKDIR}/${module}"))
+       local HG_REVDATA=($(hg identify -b -i "${WORKDIR}/${workdir}"))
        export HG_REV_ID=${HG_REVDATA[0]}
        local HG_REV_BRANCH=${HG_REVDATA[1]}
-       einfo "Work directory: ${WORKDIR}/${module} global id: ${HG_REV_ID} 
branch: ${HG_REV_BRANCH}"
+       einfo "Work directory: ${WORKDIR}/${workdir} global id: ${HG_REV_ID} 
branch: ${HG_REV_BRANCH}"
 }
 
 # @FUNCTION: mercurial_src_unpack

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to