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

Diff of /eclass/darcs.eclass

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

Revision 1.8 Revision 1.10
1# Copyright 2004 Gentoo Technologies, Inc. 1# Copyright 2004 Gentoo Technologies, Inc.
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.8 2010/03/14 12:31:41 kolmodin Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/darcs.eclass,v 1.10 2010/11/01 20:54:46 slyfox Exp $
4# 4#
5# darcs eclass author: Andres Loeh <kosmikus@gentoo.org> 5# darcs eclass author: Andres Loeh <kosmikus@gentoo.org>
6# tla eclass author: <rphillips@gentoo.org> 6# tla eclass author: <rphillips@gentoo.org>
7# Original Author: Jeffrey Yasskin <jyasskin@mail.utexas.edu> 7# Original Author: Jeffrey Yasskin <jyasskin@mail.utexas.edu>
8# 8#
16 16
17# Most of the time, you will define only $EDARCS_REPOSITORY in your 17# Most of the time, you will define only $EDARCS_REPOSITORY in your
18# ebuild. 18# ebuild.
19 19
20# TODO: support for tags, ... 20# TODO: support for tags, ...
21
22inherit eutils # eshopts_{push,pop}
21 23
22# Don't download anything other than the darcs repository 24# Don't download anything other than the darcs repository
23SRC_URI="" 25SRC_URI=""
24 26
25# You shouldn't change these settings yourself! The ebuild/eclass inheriting 27# You shouldn't change these settings yourself! The ebuild/eclass inheriting
50 52
51# --- end ebuild-configurable settings --- 53# --- end ebuild-configurable settings ---
52 54
53# add darcs to deps 55# add darcs to deps
54DEPEND="dev-vcs/darcs" 56DEPEND="dev-vcs/darcs"
57
58darcs_patchcount() {
59 set -- $(${EDARCS_DARCS_CMD} show repo | grep "Num Patches")
60 # handle string like: " Num Patches: 3860"
61 echo ${3}
62}
55 63
56# is called from darcs_src_unpack 64# is called from darcs_src_unpack
57darcs_fetch() { 65darcs_fetch() {
58 66
59 # The local directory to store the repository (useful to ensure a 67 # The local directory to store the repository (useful to ensure a
110 elif [ "${mode}" == "update" ]; then 118 elif [ "${mode}" == "update" ]; then
111 einfo "Running $cmdupdate" 119 einfo "Running $cmdupdate"
112 eval $cmdupdate || die "darcs update command failed" 120 eval $cmdupdate || die "darcs update command failed"
113 fi 121 fi
114 122
123 export EDARCS_PATCHCOUNT=$(darcs_patchcount)
124 einfo " patches in repo: ${EDARCS_PATCHCOUNT}"
125
115 popd 126 popd
116} 127}
117 128
118 129
119darcs_src_unpack() { 130darcs_src_unpack() {
120 # The local directory to store the repository (useful to ensure a 131 # The local directory to store the repository (useful to ensure a
121 # unique local name); relative to EDARCS_TOP_DIR 132 # unique local name); relative to EDARCS_TOP_DIR
122 [ -z "$EDARCS_LOCALREPO" ] && [ -n "$EDARCS_REPOSITORY" ] \ 133 [ -z "$EDARCS_LOCALREPO" ] && [ -n "$EDARCS_REPOSITORY" ] \
123 && EDARCS_LOCALREPO=${EDARCS_REPOSITORY%/} \ 134 && EDARCS_LOCALREPO=${EDARCS_REPOSITORY%/} \
124 && EDARCS_LOCALREPO=${EDARCS_LOCALREPO##*/} 135 && EDARCS_LOCALREPO=${EDARCS_LOCALREPO##*/}
125 local EDARCS_SHOPT
126 136
127 debug-print-function $FUNCNAME $* 137 debug-print-function $FUNCNAME $*
128 138
129 debug-print "$FUNCNAME: init: 139 debug-print "$FUNCNAME: init:
130 EDARCS_DARCS_CMD=$EDARCS_DARCS_CMD 140 EDARCS_DARCS_CMD=$EDARCS_DARCS_CMD
144 154
145 # probably redundant, but best to make sure 155 # probably redundant, but best to make sure
146 # Use ${WORKDIR}/${P} rather than ${S} so user can point ${S} to something inside. 156 # Use ${WORKDIR}/${P} rather than ${S} so user can point ${S} to something inside.
147 mkdir -p "${WORKDIR}/${P}" 157 mkdir -p "${WORKDIR}/${P}"
148 158
149 EDARCS_SHOPT=$(shopt -p dotglob)
150 shopt -s dotglob # get any dotfiles too. 159 eshopts_push -s dotglob # get any dotfiles too.
151 rsync -rlpgo --exclude="_darcs/" "$EDARCS_TOP_DIR/$EDARCS_LOCALREPO"/* "${WORKDIR}/${P}" 160 rsync -rlpgo --exclude="_darcs/" "$EDARCS_TOP_DIR/$EDARCS_LOCALREPO"/* "${WORKDIR}/${P}"
152 eval ${EDARCS_SHOPT} # reset shopt 161 eshopts_pop
153 162
154 einfo "Darcs repository contents are now in ${WORKDIR}/${P}" 163 einfo "Darcs repository contents are now in ${WORKDIR}/${P}"
155 164
156} 165}
157 166

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.20