1 |
commit: da66246c68be060ea7484110fac298ac7fa4363d |
2 |
Author: Benda Xu <heroxbd <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 22 04:03:48 2016 +0000 |
4 |
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 22 04:03:48 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/android.git/commit/?id=da66246c |
7 |
|
8 |
prefix.eclass: add eprefixify_patch. |
9 |
|
10 |
eclass/prefix.eclass | 25 +++++++++++++++++++++++++ |
11 |
1 file changed, 25 insertions(+) |
12 |
|
13 |
diff --git a/eclass/prefix.eclass b/eclass/prefix.eclass |
14 |
index 1f3c4b0..101cce2 100644 |
15 |
--- a/eclass/prefix.eclass |
16 |
+++ b/eclass/prefix.eclass |
17 |
@@ -12,6 +12,8 @@ |
18 |
# located somewhere in the filesystem. Prefix ebuilds require |
19 |
# additional functions and variables which are defined by this eclass. |
20 |
|
21 |
+inherit eutils |
22 |
+ |
23 |
# @ECLASS-VARIABLE: EPREFIX |
24 |
# @DESCRIPTION: |
25 |
# The offset prefix of a Gentoo Prefix installation. When Gentoo Prefix |
26 |
@@ -48,5 +50,28 @@ eprefixify() { |
27 |
return 0 |
28 |
} |
29 |
|
30 |
+# @FUNCTION: eprefixify_patch |
31 |
+# @USAGE: <list of patch files to be eprefixified> |
32 |
+# @DESCRIPTION: |
33 |
+# copies the patch files to ${T} and eprefixify before applying. |
34 |
+# dies if no arguments are given, a file does not exist, or changing a |
35 |
+# file failed. |
36 |
+eprefixity_patch() { |
37 |
+ [[ $# -lt 1 ]] && die "at least one argument required" |
38 |
+ |
39 |
+ local x f |
40 |
+ for x in "$@" ; do |
41 |
+ if [[ -e ${x} ]] ; then |
42 |
+ f=${x##*/} |
43 |
+ cp "${x}" "${T}" || die "failed to copy patch" |
44 |
+ eprefixify "${T}"/${f} |
45 |
+ epatch "${T}"/${f} |
46 |
+ else |
47 |
+ die "${x} does not exist" |
48 |
+ fi |
49 |
+ done |
50 |
+ |
51 |
+ return 0 |
52 |
+} |
53 |
|
54 |
# vim: tw=72: |