| 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.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 | |
|
|
22 | inherit 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 |
| 23 | SRC_URI="" |
25 | SRC_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 |
| … | |
… | |
| 120 | # The local directory to store the repository (useful to ensure a |
122 | # The local directory to store the repository (useful to ensure a |
| 121 | # unique local name); relative to EDARCS_TOP_DIR |
123 | # unique local name); relative to EDARCS_TOP_DIR |
| 122 | [ -z "$EDARCS_LOCALREPO" ] && [ -n "$EDARCS_REPOSITORY" ] \ |
124 | [ -z "$EDARCS_LOCALREPO" ] && [ -n "$EDARCS_REPOSITORY" ] \ |
| 123 | && EDARCS_LOCALREPO=${EDARCS_REPOSITORY%/} \ |
125 | && EDARCS_LOCALREPO=${EDARCS_REPOSITORY%/} \ |
| 124 | && EDARCS_LOCALREPO=${EDARCS_LOCALREPO##*/} |
126 | && EDARCS_LOCALREPO=${EDARCS_LOCALREPO##*/} |
| 125 | local EDARCS_SHOPT |
|
|
| 126 | |
127 | |
| 127 | debug-print-function $FUNCNAME $* |
128 | debug-print-function $FUNCNAME $* |
| 128 | |
129 | |
| 129 | debug-print "$FUNCNAME: init: |
130 | debug-print "$FUNCNAME: init: |
| 130 | EDARCS_DARCS_CMD=$EDARCS_DARCS_CMD |
131 | EDARCS_DARCS_CMD=$EDARCS_DARCS_CMD |
| … | |
… | |
| 144 | |
145 | |
| 145 | # probably redundant, but best to make sure |
146 | # probably redundant, but best to make sure |
| 146 | # 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. |
| 147 | mkdir -p "${WORKDIR}/${P}" |
148 | mkdir -p "${WORKDIR}/${P}" |
| 148 | |
149 | |
| 149 | EDARCS_SHOPT=$(shopt -p dotglob) |
|
|
| 150 | shopt -s dotglob # get any dotfiles too. |
150 | eshopts_push -s dotglob # get any dotfiles too. |
| 151 | rsync -rlpgo --exclude="_darcs/" "$EDARCS_TOP_DIR/$EDARCS_LOCALREPO"/* "${WORKDIR}/${P}" |
151 | rsync -rlpgo --exclude="_darcs/" "$EDARCS_TOP_DIR/$EDARCS_LOCALREPO"/* "${WORKDIR}/${P}" |
| 152 | eval ${EDARCS_SHOPT} # reset shopt |
152 | eshopts_pop |
| 153 | |
153 | |
| 154 | einfo "Darcs repository contents are now in ${WORKDIR}/${P}" |
154 | einfo "Darcs repository contents are now in ${WORKDIR}/${P}" |
| 155 | |
155 | |
| 156 | } |
156 | } |
| 157 | |
157 | |