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

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

From: Kent Fredric <kentnl@gentoo.org>

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

diff --git a/eclass/perl-functions.eclass b/eclass/perl-functions.eclass
index 027cb0cf7e..3f73ac87c7 100644
--- a/eclass/perl-functions.eclass
+++ b/eclass/perl-functions.eclass
@@ -431,3 +431,21 @@ perl_get_module_version() {
 		print ${$stash->{VERSION}};
 		exit 0; ' "$@"
 }
+
+# @FUNCTION: perl_get_raw_vendorlib
+# @USAGE: perl_get_raw_vendorlib
+# @DESCRIPTION:
+# Convenience function to optimise for a common case without double-handling
+# variables everywhere.
+#
+# Note: Will include EPREFIX where relevant
+perl_get_raw_vendorlib() {
+	debug-print-function $FUNCNAME "$@"
+
+	[[ $# -lt 0 ]] || die "${FUNCNAME}: Too many parameters ($#)"
+
+	perl -MConfig \
+		-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"
+}
\ 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