1 |
commit: dc858f6a75f94c0a1b3d6e5c6e83a874e8b57d8b |
2 |
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Dec 19 17:50:00 2015 +0000 |
4 |
Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Dec 19 17:50:00 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc858f6a |
7 |
|
8 |
perl-module.eclass and perl-functions.eclass: Add infrastructure to build .packlist files and keep/fix them in EAPI=6 |
9 |
|
10 |
eclass/perl-functions.eclass | 35 ++++++++++++++++++++++++++++++++--- |
11 |
eclass/perl-module.eclass | 9 +++++++-- |
12 |
2 files changed, 39 insertions(+), 5 deletions(-) |
13 |
|
14 |
diff --git a/eclass/perl-functions.eclass b/eclass/perl-functions.eclass |
15 |
index c38ed6c..7568473 100644 |
16 |
--- a/eclass/perl-functions.eclass |
17 |
+++ b/eclass/perl-functions.eclass |
18 |
@@ -106,17 +106,46 @@ perl_delete_packlist() { |
19 |
debug-print-function $FUNCNAME "$@" |
20 |
perl_set_version |
21 |
if [[ -d ${D}/${VENDOR_ARCH} ]] ; then |
22 |
- find "${D}/${VENDOR_ARCH}" -type f -a \( -name .packlist \ |
23 |
- -o \( -name '*.bs' -a -empty \) \) -delete |
24 |
+ find "${D}/${VENDOR_ARCH}" -type f -a -name .packlist -delete |
25 |
+ perl_delete_emptybsdir |
26 |
+ fi |
27 |
+} |
28 |
+ |
29 |
+# @FUNCTION: perl_delete_emptybsdir |
30 |
+# @USAGE: perl_delete_emptybsdir |
31 |
+# @DESCRIPTION: |
32 |
+# Look through ${D} for empty .bs files and empty directories, |
33 |
+# and get rid of items found. |
34 |
+perl_delete_emptybsdir() { |
35 |
+ debug-print-function $FUNCNAME "$@" |
36 |
+ perl_set_version |
37 |
+ if [[ -d ${D}/${VENDOR_ARCH} ]] ; then |
38 |
+ find "${D}/${VENDOR_ARCH}" -type f \ |
39 |
+ -a -name '*.bs' -a -empty -delete |
40 |
find "${D}" -depth -mindepth 1 -type d -empty -delete |
41 |
fi |
42 |
} |
43 |
|
44 |
+# @FUNCTION: perl_fix_packlist |
45 |
+# @USAGE: perl_fix_packlist |
46 |
+# @DESCRIPTION: |
47 |
+# Look through ${D} for .packlist text files containing the temporary installation |
48 |
+# folder (i.e. ${D}). If the pattern is found, silently replace it with `/'. |
49 |
+perl_fix_packlist() { |
50 |
+ debug-print-function $FUNCNAME "$@" |
51 |
+ |
52 |
+ find "${D}" -type f -name '.packlist' -print0 | while read -rd '' f ; do |
53 |
+ if file "${f}" | grep -q -i " text" ; then |
54 |
+ sed -i -e "s:${D}:/:g" "${f}" |
55 |
+ fi |
56 |
+ done |
57 |
+} |
58 |
+ |
59 |
# @FUNCTION: perl_remove_temppath |
60 |
# @USAGE: perl_remove_temppath |
61 |
# @DESCRIPTION: |
62 |
# Look through ${D} for text files containing the temporary installation |
63 |
-# folder (i.e. ${D}). If the pattern is found (i.e. " text"), replace it with `/'. |
64 |
+# folder (i.e. ${D}). If the pattern is found, replace it with `/' and warn. |
65 |
perl_remove_temppath() { |
66 |
debug-print-function $FUNCNAME "$@" |
67 |
|
68 |
|
69 |
diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass |
70 |
index 80a829d..8b2f3a4 100644 |
71 |
--- a/eclass/perl-module.eclass |
72 |
+++ b/eclass/perl-module.eclass |
73 |
@@ -244,7 +244,7 @@ perl-module_src_configure() { |
74 |
--installdirs=vendor \ |
75 |
--libdoc= \ |
76 |
--destdir="${D}" \ |
77 |
- --create_packlist=0 \ |
78 |
+ --create_packlist=1 \ |
79 |
"${myconf_local[@]}" |
80 |
einfo "perl Build.PL" "$@" |
81 |
perl Build.PL "$@" <<< "${pm_echovar}" \ |
82 |
@@ -407,7 +407,12 @@ perl-module_src_install() { |
83 |
|
84 |
perl_delete_module_manpages |
85 |
perl_delete_localpod |
86 |
- perl_delete_packlist |
87 |
+ if [[ ${EAPI:-0} == 5 ]] ; then |
88 |
+ perl_delete_packlist |
89 |
+ else |
90 |
+ perl_fix_packlist |
91 |
+ perl_delete_emptybsdir |
92 |
+ fi |
93 |
perl_remove_temppath |
94 |
|
95 |
for f in Change* CHANGES README* TODO FAQ ${mydoc}; do |