From: Konrad Weihmann Date: Fri, 9 Apr 2021 16:51:23 +0000 (+0200) Subject: cpan-base: set default UPSTREAM_CHECK_REGEX X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~8193 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3df2cf383b58a3100bd78ebb0369047221121512;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git cpan-base: set default UPSTREAM_CHECK_REGEX as cpan release versions are almost always follow an a.b version scheme, it's better to filter out beta releases such as a.b.c. Use the first resource fetched from https://cpan.metacpan.org as base for calculating the needed regex. In case nothing can be calculated fall back to nothing. Add this to cpan-base to enable it for new & old style cpan integration. Signed-off-by: Konrad Weihmann Signed-off-by: Richard Purdie --- diff --git a/meta/classes/cpan-base.bbclass b/meta/classes/cpan-base.bbclass index 867edf87073..1fc3f0bcb03 100644 --- a/meta/classes/cpan-base.bbclass +++ b/meta/classes/cpan-base.bbclass @@ -16,3 +16,12 @@ def is_target(d): PERLLIBDIRS = "${libdir}/perl5" PERLLIBDIRS_class-native = "${libdir}/perl5" + +def cpan_upstream_check_pattern(d): + for x in (d.getVar('SRC_URI') or '').split(' '): + if x.startswith("https://cpan.metacpan.org"): + _pattern = x.split('/')[-1].replace(d.getVar('PV'), '(?P\d+.\d+)') + return _pattern + return '' + +UPSTREAM_CHECK_REGEX ?= "${@cpan_upstream_check_pattern(d)}"