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

Contents of /eclass/prefix.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Thu Apr 2 17:36:53 2009 UTC (5 years, 8 months ago) by grobian
Branch: MAIN
Add prefix.eclass, after discussion on -dev, this a copy of r40431 from the prefix overlay

1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id: prefix.eclass 40431 2009-03-27 16:06:09Z grobian $
4
5 # @ECLASS: prefix.eclass
6 # @MAINTAINER:
7 # Feel free to contact the Prefix team through <prefix@gentoo.org> if
8 # you have problems, suggestions or questions.
9 # @BLURB: Eclass to provide Prefix functionality
10 # @DESCRIPTION:
11 # Gentoo Prefix allows users to install into a self defined offset
12 # located somewhere in the filesystem. Prefix ebuilds require
13 # additional functions and variables which are defined by this eclass.
14
15 # @ECLASS-VARIABLE: EPREFIX
16 # @DESCRIPTION:
17 # The offset prefix of a Gentoo Prefix installation. When Gentoo Prefix
18 # is not used, ${EPREFIX} should be "". Prefix Portage sets EPREFIX,
19 # hence this eclass has nothing to do here in that case.
20 # Note that setting EPREFIX in the environment with Prefix Portage sets
21 # Portage into cross-prefix mode.
22 if [[ ! ${EPREFIX+set} ]]; then
23 export EPREFIX=''
24 fi
25
26
27 # @FUNCTION: eprefixify
28 # @USAGE: <list of to be eprefixified files>
29 # @DESCRIPTION:
30 # replaces @GENTOO_PORTAGE_EPREFIX@ with ${EPREFIX} for the given files,
31 # dies if no arguments are given, a file does not exist, or changing a
32 # file failed.
33 eprefixify() {
34 [[ $# -lt 1 ]] && die "at least one argument needed"
35
36 einfo "Adjusting to prefix"
37 local x
38 for x in "$@" ; do
39 if [[ -e ${x} ]] ; then
40 ebegin " ${x##*/}"
41 sed -i -e "s|@GENTOO_PORTAGE_EPREFIX@|${EPREFIX}|g" "${x}"
42 eend $? || die "failed to eprefixify ${x}"
43 else
44 die "${x} does not exist"
45 fi
46 done
47
48 return 0
49 }
50
51
52 # vim: tw=72:

  ViewVC Help
Powered by ViewVC 1.1.20