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

Diff of /eclass/darcs.eclass

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

Revision 1.5 Revision 1.9
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.5 2007/06/17 21:33:57 kolmodin Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/darcs.eclass,v 1.9 2010/07/19 02:52:14 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
41[ -z "$EDARCS_TOP_DIR" ] && EDARCS_TOP_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/darcs-src" 43[ -z "$EDARCS_TOP_DIR" ] && EDARCS_TOP_DIR="${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}/darcs-src"
42 44
43# The URI to the repository. 45# The URI to the repository.
44[ -z "$EDARCS_REPOSITORY" ] && EDARCS_REPOSITORY="" 46[ -z "$EDARCS_REPOSITORY" ] && EDARCS_REPOSITORY=""
45 47
46# The local directory to store the repository (useful to ensure a
47# unique local name); relative to EDARCS_TOP_DIR
48[ -z "$EDARCS_LOCALREPO" ] && [ -n "$EDARCS_REPOSITORY" ] \
49 && EDARCS_LOCALREPO=${EDARCS_REPOSITORY%/} \
50 && EDARCS_LOCALREPO=${EDARCS_LOCALREPO##*/}
51 48
52# EDARCS_CLEAN: set this to something to get a clean copy when updating 49# EDARCS_CLEAN: set this to something to get a clean copy when updating
53# (removes the working directory, then uses $EDARCS_GET_CMD to 50# (removes the working directory, then uses $EDARCS_GET_CMD to
54# re-download it.) 51# re-download it.)
55 52
56# --- end ebuild-configurable settings --- 53# --- end ebuild-configurable settings ---
57 54
58# add darcs to deps 55# add darcs to deps
59DEPEND="dev-util/darcs" 56DEPEND="dev-vcs/darcs"
60 57
61# is called from darcs_src_unpack 58# is called from darcs_src_unpack
62darcs_fetch() { 59darcs_fetch() {
60
61 # The local directory to store the repository (useful to ensure a
62 # unique local name); relative to EDARCS_TOP_DIR
63 [ -z "$EDARCS_LOCALREPO" ] && [ -n "$EDARCS_REPOSITORY" ] \
64 && EDARCS_LOCALREPO=${EDARCS_REPOSITORY%/} \
65 && EDARCS_LOCALREPO=${EDARCS_LOCALREPO##*/}
63 66
64 debug-print-function $FUNCNAME $* 67 debug-print-function $FUNCNAME $*
65 68
66 if [ -n "$EDARCS_CLEAN" ]; then 69 if [ -n "$EDARCS_CLEAN" ]; then
67 rm -rf $EDARCS_TOP_DIR/$EDARCS_LOCALREPO 70 rm -rf $EDARCS_TOP_DIR/$EDARCS_LOCALREPO
114 popd 117 popd
115} 118}
116 119
117 120
118darcs_src_unpack() { 121darcs_src_unpack() {
119 local EDARCS_SHOPT 122 # The local directory to store the repository (useful to ensure a
123 # unique local name); relative to EDARCS_TOP_DIR
124 [ -z "$EDARCS_LOCALREPO" ] && [ -n "$EDARCS_REPOSITORY" ] \
125 && EDARCS_LOCALREPO=${EDARCS_REPOSITORY%/} \
126 && EDARCS_LOCALREPO=${EDARCS_LOCALREPO##*/}
120 127
121 debug-print-function $FUNCNAME $* 128 debug-print-function $FUNCNAME $*
122 129
123 debug-print "$FUNCNAME: init: 130 debug-print "$FUNCNAME: init:
124 EDARCS_DARCS_CMD=$EDARCS_DARCS_CMD 131 EDARCS_DARCS_CMD=$EDARCS_DARCS_CMD
138 145
139 # probably redundant, but best to make sure 146 # probably redundant, but best to make sure
140 # Use ${WORKDIR}/${P} rather than ${S} so user can point ${S} to something inside. 147 # Use ${WORKDIR}/${P} rather than ${S} so user can point ${S} to something inside.
141 mkdir -p "${WORKDIR}/${P}" 148 mkdir -p "${WORKDIR}/${P}"
142 149
143 EDARCS_SHOPT=$(shopt -p dotglob)
144 shopt -s dotglob # get any dotfiles too. 150 eshopts_push -s dotglob # get any dotfiles too.
145 cp -Rf "$EDARCS_TOP_DIR/$EDARCS_LOCALREPO"/* "${WORKDIR}/${P}" 151 rsync -rlpgo --exclude="_darcs/" "$EDARCS_TOP_DIR/$EDARCS_LOCALREPO"/* "${WORKDIR}/${P}"
146 eval ${EDARCS_SHOPT} # reset shopt 152 eshopts_pop
147 153
148 einfo "Darcs repository contents are now in ${WORKDIR}/${P}" 154 einfo "Darcs repository contents are now in ${WORKDIR}/${P}"
149 155
150} 156}
151 157

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.20