Gentoo Archives: gentoo-commits

From: Benda XU <heroxbd@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/android:master commit in: eclass/
Date: Thu, 26 May 2016 04:05:08
Message-Id: 1463889781.eae808b55c1155d75825122ed5d875f7bf277c86.heroxbd@gentoo
1 commit: eae808b55c1155d75825122ed5d875f7bf277c86
2 Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 22 04:03:01 2016 +0000
4 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
5 CommitDate: Sun May 22 04:03:01 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/android.git/commit/?id=eae808b5
7
8 Revert "prefix.eclass: merged"
9
10 This reverts commit abe0e1cb5fc08292397e3c38895185ec9481c9dc.
11
12 eclass/prefix.eclass | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
13 1 file changed, 52 insertions(+)
14
15 diff --git a/eclass/prefix.eclass b/eclass/prefix.eclass
16 new file mode 100644
17 index 0000000..1f3c4b0
18 --- /dev/null
19 +++ b/eclass/prefix.eclass
20 @@ -0,0 +1,52 @@
21 +# Copyright 1999-2009 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +# $Id$
24 +
25 +# @ECLASS: prefix.eclass
26 +# @MAINTAINER:
27 +# Feel free to contact the Prefix team through <prefix@g.o> if
28 +# you have problems, suggestions or questions.
29 +# @BLURB: Eclass to provide Prefix functionality
30 +# @DESCRIPTION:
31 +# Gentoo Prefix allows users to install into a self defined offset
32 +# located somewhere in the filesystem. Prefix ebuilds require
33 +# additional functions and variables which are defined by this eclass.
34 +
35 +# @ECLASS-VARIABLE: EPREFIX
36 +# @DESCRIPTION:
37 +# The offset prefix of a Gentoo Prefix installation. When Gentoo Prefix
38 +# is not used, ${EPREFIX} should be "". Prefix Portage sets EPREFIX,
39 +# hence this eclass has nothing to do here in that case.
40 +# Note that setting EPREFIX in the environment with Prefix Portage sets
41 +# Portage into cross-prefix mode.
42 +if [[ ! ${EPREFIX+set} ]]; then
43 + export EPREFIX=''
44 +fi
45 +
46 +
47 +# @FUNCTION: eprefixify
48 +# @USAGE: <list of to be eprefixified files>
49 +# @DESCRIPTION:
50 +# replaces @GENTOO_PORTAGE_EPREFIX@ with ${EPREFIX} for the given files,
51 +# dies if no arguments are given, a file does not exist, or changing a
52 +# file failed.
53 +eprefixify() {
54 + [[ $# -lt 1 ]] && die "at least one argument required"
55 +
56 + einfo "Adjusting to prefix ${EPREFIX:-/}"
57 + local x
58 + for x in "$@" ; do
59 + if [[ -e ${x} ]] ; then
60 + ebegin " ${x##*/}"
61 + sed -i -e "s|@GENTOO_PORTAGE_EPREFIX@|${EPREFIX}|g" "${x}"
62 + eend $? || die "failed to eprefixify ${x}"
63 + else
64 + die "${x} does not exist"
65 + fi
66 + done
67 +
68 + return 0
69 +}
70 +
71 +
72 +# vim: tw=72: