Skip to content

Commit a3af56b

Browse files
authored
Merge pull request #223 from hadfl/pymod
package version parser fixes
2 parents 291b264 + 719825b commit a3af56b

File tree

5 files changed

+10
-80
lines changed

5 files changed

+10
-80
lines changed

.github/workflows/unit-tests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
# - windows-latest
2222

2323
perl:
24-
- '5.34'
2524
- '5.36'
2625
- '5.38'
26+
- '5.40'
2727
# exclude:
2828
#- os: ubuntu-16.04
2929
# perl: '5.26'

lib/OOCEapps/PkgUpd/GitLab.pm

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ sub getVersions {
1717

1818
$name = $self->extractName($name);
1919

20-
return [ map { $_->{name} =~ /^v?([\d.]+)$/ } @{$res->json // []} ];
20+
my $attr = $name eq 'libxslt' ? 'tag_name' : 'name';
21+
22+
return [ map { $_->{$attr} =~ /^v?([\d.]+)$/ } @{$res->json // []} ];
2123
}
2224

2325
1;
@@ -26,7 +28,7 @@ __END__
2628
2729
=head1 COPYRIGHT
2830
29-
Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
31+
Copyright 2025 OmniOS Community Edition (OmniOSce) Association.
3032
3133
=head1 LICENSE
3234

lib/OOCEapps/PkgUpd/OpenSSL.pm

-60
This file was deleted.

lib/OOCEapps/PkgUpd/PyMod.pm

+3-15
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,23 @@
11
package OOCEapps::PkgUpd::PyMod;
22
use Mojo::Base 'OOCEapps::PkgUpd::base';
3-
use Mojo::Util 'trim';
43

54
# public methods
65
sub canParse {
76
my $self = shift;
87
my $name = shift;
98
my $url = shift;
109

11-
return $url =~ m|^https://pypi\.org/project/|;
10+
return $url =~ m|^https://pypi\.org/rss/project/|;
1211
}
1312

1413
sub getVersions {
1514
my $self = shift;
1615
my $name = shift;
1716
my $res = shift;
1817

19-
# remove version suffix
20-
$name =~ s/-\d{2}$//;
21-
22-
$name = $self->extractName($name);
23-
24-
# Version 0.7 is mistakenly shown as 7 on the prettytable project page
25-
# we expect at least a version of the pattern x.y
26-
my $FILTER = $name eq 'prettytable' ? qr/\d+\./ : qr/./;
27-
2818
return [
29-
grep { /^$FILTER/ }
3019
grep { !/(?:rc|a(?:lpha)?|b(?:eta)?)\d+$/ }
31-
map { $_->text ? trim($_->text) : () }
32-
$res->dom->find('p.release__version')->each
20+
$res->dom->find('rss > channel > item > title')->map('text')->each
3321
];
3422
}
3523

@@ -39,7 +27,7 @@ __END__
3927
4028
=head1 COPYRIGHT
4129
42-
Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
30+
Copyright 2025 OmniOS Community Edition (OmniOSce) Association.
4331
4432
=head1 LICENSE
4533

lib/OOCEapps/Utils.pm

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use Mojo::Base -base;
44
use Mojo::JSON qw(encode_json decode_json);
55
use Mojo::Util qw(b64_encode b64_decode);
66
use Crypt::Ed25519;
7-
use File::Spec qw(catdir splitpath);
7+
use File::Spec;
88
use Email::MIME;
99
use Email::Sender::Simple;
1010
use File::Temp;
@@ -269,7 +269,7 @@ __END__
269269
270270
=head1 COPYRIGHT
271271
272-
Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
272+
Copyright 2025 OmniOS Community Edition (OmniOSce) Association.
273273
274274
=head1 LICENSE
275275

0 commit comments

Comments
 (0)