1 |
From: Kent Fredric <kentnl@g.o> |
2 |
|
3 |
--- |
4 |
eclass/perl-functions.eclass | 19 +++++++++++++++++++ |
5 |
1 file changed, 19 insertions(+) |
6 |
|
7 |
diff --git a/eclass/perl-functions.eclass b/eclass/perl-functions.eclass |
8 |
index 3f73ac87c7..1652ceaa10 100644 |
9 |
--- a/eclass/perl-functions.eclass |
10 |
+++ b/eclass/perl-functions.eclass |
11 |
@@ -448,4 +448,23 @@ perl_get_raw_vendorlib() { |
12 |
-e'exists $Config{$ARGV[0]} || die qq{No such Config key "$ARGV[0]"}; |
13 |
print $Config{$ARGV[0]}; |
14 |
exit 0' -- "installvendorlib" || die "Can't extract installvendorlib from Perl Configuration" |
15 |
+} |
16 |
+ |
17 |
+# @FUNCTION: perl_get_vendorlib |
18 |
+# @USAGE: perl_get_vendorlib |
19 |
+# @DESCRIPTION: |
20 |
+# |
21 |
+# Convenience helper for returning Perls' vendor install root |
22 |
+# without EPREFIXing. |
23 |
+perl_get_vendorlib() { |
24 |
+ debug-print-function $FUNCNAME "$@" |
25 |
+ |
26 |
+ [[ $# -lt 0 ]] || die "${FUNCNAME}: Too many parameters ($#)" |
27 |
+ |
28 |
+ # Requires perl 5.14 for /r attribute of s/// |
29 |
+ # Just in case somebody out there is stuck in a time warp: upgrade perl first |
30 |
+ perl -M5.014 -MConfig \ |
31 |
+ -e'exists $Config{$ARGV[0]} || die qq{No such Config key "$ARGV[0]"}; |
32 |
+ print $Config{$ARGV[0]} =~ s{\A\Q$ARGV[1]\E}{}r; |
33 |
+ exit 0' -- "installvendorlib" "$EPREFIX" || die "Can't extract installvendorlib from Perl Configuration" |
34 |
} |
35 |
\ No newline at end of file |
36 |
-- |
37 |
2.11.0 |