summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Weihmann <kweihmann@outlook.com>2021-04-09 18:51:23 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-04-16 18:15:13 +0100
commit49e459e815152a4e99188e36735cb08b8a8aebcc (patch)
tree121788b36220eaef166eddf4be5fe33a8cc42512
parent16e1e9de84f9b41b3b0d43361bc5c385df4c692e (diff)
downloadopenembedded-core-49e459e815152a4e99188e36735cb08b8a8aebcc.tar.gz
openembedded-core-49e459e815152a4e99188e36735cb08b8a8aebcc.tar.bz2
openembedded-core-49e459e815152a4e99188e36735cb08b8a8aebcc.zip
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 <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/cpan-base.bbclass9
1 files changed, 9 insertions, 0 deletions
diff --git a/meta/classes/cpan-base.bbclass b/meta/classes/cpan-base.bbclass
index 867edf8707..1fc3f0bcb0 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<pver>\d+.\d+)')
+ return _pattern
+ return ''
+
+UPSTREAM_CHECK_REGEX ?= "${@cpan_upstream_check_pattern(d)}"