diff options
author | Konrad Weihmann <kweihmann@outlook.com> | 2021-04-09 18:51:23 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-04-18 11:37:25 +0100 |
commit | ded1504299eddee67b722dbc566618bc6ed0ee33 (patch) | |
tree | 5113afd711c9c39ed3a8c21457eb8aa8e15f3bc7 | |
parent | da24dbf7b9d1a254141fb72d0ac72a48942bca43 (diff) | |
download | poky-ded1504299eddee67b722dbc566618bc6ed0ee33.tar.gz |
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.
(From OE-Core rev: 3df2cf383b58a3100bd78ebb0369047221121512)
Signed-off-by: Konrad Weihmann <kweihmann@outlook.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/cpan-base.bbclass | 9 |
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): | |||
16 | 16 | ||
17 | PERLLIBDIRS = "${libdir}/perl5" | 17 | PERLLIBDIRS = "${libdir}/perl5" |
18 | PERLLIBDIRS_class-native = "${libdir}/perl5" | 18 | PERLLIBDIRS_class-native = "${libdir}/perl5" |
19 | |||
20 | def cpan_upstream_check_pattern(d): | ||
21 | for x in (d.getVar('SRC_URI') or '').split(' '): | ||
22 | if x.startswith("https://cpan.metacpan.org"): | ||
23 | _pattern = x.split('/')[-1].replace(d.getVar('PV'), '(?P<pver>\d+.\d+)') | ||
24 | return _pattern | ||
25 | return '' | ||
26 | |||
27 | UPSTREAM_CHECK_REGEX ?= "${@cpan_upstream_check_pattern(d)}" | ||