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

Diff of /eclass/mercurial.eclass

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

Revision 1.2 Revision 1.3
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.2 2006/06/08 15:47:17 agriffis Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/mercurial.eclass,v 1.3 2006/10/13 23:45:03 agriffis Exp $
4 4
5# mercurial: Fetch sources from mercurial repositories, similar to cvs.eclass. 5# mercurial: Fetch sources from mercurial repositories, similar to cvs.eclass.
6# To use this from an ebuild, set EHG_REPO_URI in your ebuild. Then either 6# To use this from an ebuild, set EHG_REPO_URI in your ebuild. Then either
7# leave the default src_unpack or call mercurial_src_unpack. 7# leave the default src_unpack or call mercurial_src_unpack.
8 8
32 32
33 if [[ ! -d ${EHG_STORE_DIR} ]]; then 33 if [[ ! -d ${EHG_STORE_DIR} ]]; then
34 ebegin "create ${EHG_STORE_DIR}" 34 ebegin "create ${EHG_STORE_DIR}"
35 addwrite / && 35 addwrite / &&
36 mkdir -p "${EHG_STORE_DIR}" && 36 mkdir -p "${EHG_STORE_DIR}" &&
37 chmod -f o+rw "${EHG_STORE_DIR}" && 37 chmod -f g+rw "${EHG_STORE_DIR}" &&
38 export SANDBOX_WRITE="${SANDBOX_WRITE%:/}" 38 export SANDBOX_WRITE="${SANDBOX_WRITE%:/}"
39 eend $? || die 39 eend $? || die
40 fi 40 fi
41 41
42 pushd "${EHG_STORE_DIR}" >/dev/null \ 42 pushd "${EHG_STORE_DIR}" >/dev/null \
45 45
46 if [[ ! -d ${EHG_PROJECT}/${module} ]]; then 46 if [[ ! -d ${EHG_PROJECT}/${module} ]]; then
47 # first check out 47 # first check out
48 ebegin "${EHG_CLONE_CMD} ${repo}" 48 ebegin "${EHG_CLONE_CMD} ${repo}"
49 mkdir -p "${EHG_PROJECT}" && 49 mkdir -p "${EHG_PROJECT}" &&
50 chmod -f o+rw "${EHG_PROJECT}" && 50 chmod -f g+rw "${EHG_PROJECT}" &&
51 cd "${EHG_PROJECT}" && 51 cd "${EHG_PROJECT}" &&
52 ${EHG_CLONE_CMD} "${repo}" "${module}" && 52 ${EHG_CLONE_CMD} "${repo}" "${module}" &&
53 cd "${module}" 53 cd "${module}"
54 eend $? || die 54 eend $? || die
55 else 55 else
56 # update working copy 56 # update working copy
57 ebegin "${EHG_PULL_CMD} ${repo}" 57 ebegin "${EHG_PULL_CMD} ${repo}"
58 cd "${EHG_PROJECT}/${module}" && 58 cd "${EHG_PROJECT}/${module}" &&
59 ${EHG_PULL_CMD} 59 ${EHG_PULL_CMD}
60 case $? in
61 # hg pull returns status 1 when there were no changes to pull
62 1) eend 0 ;;
60 eend $? || die 63 *) eend $? || die ;;
64 esac
61 fi 65 fi
62 66
63 # use rsync instead of cp for --exclude 67 # use rsync instead of cp for --exclude
64 ebegin "rsync to ${WORKDIR}/${module}" 68 ebegin "rsync to ${WORKDIR}/${module}"
65 mkdir -p "${WORKDIR}/${module}" && 69 mkdir -p "${WORKDIR}/${module}" &&

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.20