summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorKent Fredric <kentnl@gentoo.org>2017-01-24 12:17:42 +1300
committerKent Fredric <kentnl@gentoo.org>2017-04-22 09:30:57 +1200
commit5663be66d3c1e1b1d86afa9905fcaba27da48a99 (patch)
treecc7a8660fc6054a50f231961c9fd219670d26c60 /eclass
parentperl-functions.eclass: add perl_get_module_version (diff)
downloadgentoo-5663be66d3c1e1b1d86afa9905fcaba27da48a99.tar.gz
gentoo-5663be66d3c1e1b1d86afa9905fcaba27da48a99.tar.bz2
gentoo-5663be66d3c1e1b1d86afa9905fcaba27da48a99.zip
perl-functions.eclass: add perl_get_raw_vendorlib
Diffstat (limited to 'eclass')
-rw-r--r--eclass/perl-functions.eclass18
1 files changed, 18 insertions, 0 deletions
diff --git a/eclass/perl-functions.eclass b/eclass/perl-functions.eclass
index be27d7e2509d..5073215e0e72 100644
--- a/eclass/perl-functions.eclass
+++ b/eclass/perl-functions.eclass
@@ -430,3 +430,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 1 ]] || 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