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

Diff of /eclass/darcs.eclass

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

Revision 1.3 Revision 1.5
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.3 2006/12/18 11:51:06 kosmikus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/darcs.eclass,v 1.5 2007/06/17 21:33:57 kolmodin 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#
81 export SANDBOX_WRITE="${SANDBOX_WRITE//:\/foobar:\/}" 81 export SANDBOX_WRITE="${SANDBOX_WRITE//:\/foobar:\/}"
82 fi 82 fi
83 83
84 # in case EDARCS_DARCS_DIR is a symlink to a dir, get the real 84 # in case EDARCS_DARCS_DIR is a symlink to a dir, get the real
85 # dir's path, otherwise addwrite() doesn't work. 85 # dir's path, otherwise addwrite() doesn't work.
86 pushd .
86 cd -P "$EDARCS_TOP_DIR" > /dev/null 87 cd -P "$EDARCS_TOP_DIR" > /dev/null
87 EDARCS_TOP_DIR="`/bin/pwd`" 88 EDARCS_TOP_DIR="`/bin/pwd`"
88 89
89 # disable the sandbox for this dir 90 # disable the sandbox for this dir
90 addwrite "$EDARCS_TOP_DIR" 91 addwrite "$EDARCS_TOP_DIR"
108 elif [ "${mode}" == "update" ]; then 109 elif [ "${mode}" == "update" ]; then
109 einfo "Running $cmdupdate" 110 einfo "Running $cmdupdate"
110 eval $cmdupdate || die "darcs update command failed" 111 eval $cmdupdate || die "darcs update command failed"
111 fi 112 fi
112 113
114 popd
113} 115}
114 116
115 117
116darcs_src_unpack() { 118darcs_src_unpack() {
119 local EDARCS_SHOPT
117 120
118 debug-print-function $FUNCNAME $* 121 debug-print-function $FUNCNAME $*
119 122
120 debug-print "$FUNCNAME: init: 123 debug-print "$FUNCNAME: init:
121 EDARCS_DARCS_CMD=$EDARCS_DARCS_CMD 124 EDARCS_DARCS_CMD=$EDARCS_DARCS_CMD
135 138
136 # probably redundant, but best to make sure 139 # probably redundant, but best to make sure
137 # Use ${WORKDIR}/${P} rather than ${S} so user can point ${S} to something inside. 140 # Use ${WORKDIR}/${P} rather than ${S} so user can point ${S} to something inside.
138 mkdir -p "${WORKDIR}/${P}" 141 mkdir -p "${WORKDIR}/${P}"
139 142
143 EDARCS_SHOPT=$(shopt -p dotglob)
140 shopt -s dotglob # get any dotfiles too. 144 shopt -s dotglob # get any dotfiles too.
141 cp -Rf "$EDARCS_TOP_DIR/$EDARCS_LOCALREPO"/* "${WORKDIR}/${P}" 145 cp -Rf "$EDARCS_TOP_DIR/$EDARCS_LOCALREPO"/* "${WORKDIR}/${P}"
146 eval ${EDARCS_SHOPT} # reset shopt
142 147
143 einfo "Darcs repository contents are now in ${WORKDIR}/${P}" 148 einfo "Darcs repository contents are now in ${WORKDIR}/${P}"
144 149
145} 150}
146 151

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

  ViewVC Help
Powered by ViewVC 1.1.20