[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    [gentoo-dev] [PATCH 5/6] perl-functions.eclass: add perl_get_vendorlib
From:       kentnl () gentoo ! org
Date:       2017-01-24 15:22:00
Message-ID: 20170124152201.15415-6-kentnl () gentoo ! org
[Download RAW message or body]

From: Kent Fredric <kentnl@gentoo.org>

---
 eclass/perl-functions.eclass | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/eclass/perl-functions.eclass b/eclass/perl-functions.eclass
index 3f73ac87c7..1652ceaa10 100644
--- a/eclass/perl-functions.eclass
+++ b/eclass/perl-functions.eclass
@@ -448,4 +448,23 @@ perl_get_raw_vendorlib() {
 		-e'exists $Config{$ARGV[0]} || die qq{No such Config key "$ARGV[0]"};
 		   print $Config{$ARGV[0]};
 		   exit 0' -- "installvendorlib" || die "Can't extract installvendorlib from Perl \
Configuration" +}
+
+# @FUNCTION: perl_get_vendorlib
+# @USAGE: perl_get_vendorlib
+# @DESCRIPTION:
+#
+# Convenience helper for returning Perls' vendor install root
+# without EPREFIXing.
+perl_get_vendorlib() {
+	debug-print-function $FUNCNAME "$@"
+
+	[[ $# -lt 0 ]] || die "${FUNCNAME}: Too many parameters ($#)"
+
+	# Requires perl 5.14 for /r attribute of s///
+	# Just in case somebody out there is stuck in a time warp: upgrade perl first
+	perl -M5.014 -MConfig \
+		-e'exists $Config{$ARGV[0]} || die qq{No such Config key "$ARGV[0]"};
+		   print $Config{$ARGV[0]} =~ s{\A\Q$ARGV[1]\E}{}r;
+		   exit 0' -- "installvendorlib" "$EPREFIX" || die "Can't extract installvendorlib \
from Perl Configuration"  }
\ No newline at end of file
-- 
2.11.0


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic