Gentoo Archives: gentoo-dev

From: kentnl@g.o
To: gentoo-dev@l.g.o
Cc: perl@g.o, Kent Fredric <kentnl@g.o>
Subject: [gentoo-dev] [PATCH 5/6] perl-functions.eclass: add perl_get_vendorlib
Date: Tue, 24 Jan 2017 15:25:12
Message-Id: 20170124152201.15415-6-kentnl@gentoo.org
In Reply to: [gentoo-dev] [PATCH 0/6] perl-functions.eclass: new utility functions by kentnl@gentoo.org
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