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

Diff of /eclass/darcs.eclass

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

Revision 1.16 Revision 1.17
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2014 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/darcs.eclass,v 1.16 2012/06/08 03:39:50 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/darcs.eclass,v 1.17 2014/05/22 16:30:59 slyfox Exp $
4 4
5# @ECLASS: darcs.eclass 5# @ECLASS: darcs.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# "Gentoo's Haskell Language team" <haskell@gentoo.org> 7# "Gentoo's Haskell Language team" <haskell@gentoo.org>
8# Sergei Trofimovich <slyfox@gentoo.org> 8# Sergei Trofimovich <slyfox@gentoo.org>
86 86
87# @FUNCTION: darcs_patchcount 87# @FUNCTION: darcs_patchcount
88# @DESCRIPTION: 88# @DESCRIPTION:
89# Internal function to determine amount of patches in repository. 89# Internal function to determine amount of patches in repository.
90darcs_patchcount() { 90darcs_patchcount() {
91 set -- $(${EDARCS_DARCS_CMD} show repo | grep "Num Patches") 91 set -- $(HOME="${EDARCS_TOP_DIR}" ${EDARCS_DARCS_CMD} show repo | grep "Num Patches")
92 # handle string like: " Num Patches: 3860" 92 # handle string like: " Num Patches: 3860"
93 echo ${3} 93 echo ${3}
94} 94}
95 95
96# @FUNCTION: darcs_fetch 96# @FUNCTION: darcs_fetch
146 local cmdget="${EDARCS_DARCS_CMD} ${EDARCS_GET_CMD} ${EDARCS_OPTIONS} --repo-name=${EDARCS_LOCALREPO} ${EDARCS_REPOSITORY}" 146 local cmdget="${EDARCS_DARCS_CMD} ${EDARCS_GET_CMD} ${EDARCS_OPTIONS} --repo-name=${EDARCS_LOCALREPO} ${EDARCS_REPOSITORY}"
147 local cmdupdate="${EDARCS_DARCS_CMD} ${EDARCS_UPDATE_CMD} --all ${EDARCS_OPTIONS} ${EDARCS_REPOSITORY}" 147 local cmdupdate="${EDARCS_DARCS_CMD} ${EDARCS_UPDATE_CMD} --all ${EDARCS_OPTIONS} ${EDARCS_REPOSITORY}"
148 148
149 if [[ ${mode} == "get" ]]; then 149 if [[ ${mode} == "get" ]]; then
150 einfo "Running ${cmdget}" 150 einfo "Running ${cmdget}"
151 eval ${cmdget} || die "darcs get command failed" 151 HOME="${EDARCS_TOP_DIR}" ${cmdget} || die "darcs get command failed"
152 elif [[ -n ${EDARCS_OFFLINE} ]] ; then 152 elif [[ -n ${EDARCS_OFFLINE} ]] ; then
153 einfo "Offline update" 153 einfo "Offline update"
154 elif [[ ${mode} == "update" ]]; then 154 elif [[ ${mode} == "update" ]]; then
155 einfo "Running ${cmdupdate}" 155 einfo "Running ${cmdupdate}"
156 eval ${cmdupdate} || die "darcs update command failed" 156 HOME="${EDARCS_TOP_DIR}" ${cmdupdate} || die "darcs update command failed"
157 fi 157 fi
158 158
159 export EDARCS_PATCHCOUNT=$(darcs_patchcount) 159 export EDARCS_PATCHCOUNT=$(darcs_patchcount)
160 einfo " patches in repo: ${EDARCS_PATCHCOUNT}" 160 einfo " patches in repo: ${EDARCS_PATCHCOUNT}"
161 161

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.20