Skip to content

Commit 2f58a22

Browse files
authored
Merge pull request #207 from hadfl/pkgupd
parser fixes
2 parents 9e9ecd7 + 00dd77c commit 2f58a22

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/OOCEapps/PkgUpd/NodeJS.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ sub getVersions {
2525
($name, $ver) = $self->extractNameMajVer($name);
2626

2727
return [
28-
map { m!/v($ver\.(?:\d+\.?)*)! } map { $_->{version} } $res->json
28+
map { m!v($ver\.(?:\d+\.?)*)! } map { $_->{version} } @{$res->json}
2929
];
3030
}
3131

@@ -35,7 +35,7 @@ __END__
3535
3636
=head1 COPYRIGHT
3737
38-
Copyright 2023 OmniOS Community Edition (OmniOSce) Association.
38+
Copyright 2024 OmniOS Community Edition (OmniOSce) Association.
3939
4040
=head1 LICENSE
4141

lib/OOCEapps/PkgUpd/Zig.pm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ sub canParse {
77
my $name = shift;
88
my $url = shift;
99

10-
return $name =~ m!developer/zig$!;
10+
return $name =~ m!developer/zig-!;
1111
}
1212

1313
sub getVersions {
1414
my $self = shift;
1515
my $name = shift;
1616
my $res = shift;
1717

18-
return [ grep { /^[\d.]+$/ } keys %{$res->json // {}} ];
18+
($name, my $ver) = $self->extractNameMajVer($name);
19+
20+
return [ grep { /^\Q$ver\E[\d.]+$/ } keys %{$res->json // {}} ];
1921
}
2022

2123
1;
@@ -24,7 +26,7 @@ __END__
2426
2527
=head1 COPYRIGHT
2628
27-
Copyright 2022 OmniOS Community Edition (OmniOSce) Association.
29+
Copyright 2024 OmniOS Community Edition (OmniOSce) Association.
2830
2931
=head1 LICENSE
3032

0 commit comments

Comments
 (0)