Skip to content

Commit

Permalink
Merge pull request #207 from hadfl/pkgupd
Browse files Browse the repository at this point in the history
parser fixes
  • Loading branch information
oetiker authored Jan 13, 2024
2 parents 9e9ecd7 + 00dd77c commit 2f58a22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/OOCEapps/PkgUpd/NodeJS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ sub getVersions {
($name, $ver) = $self->extractNameMajVer($name);

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

Expand All @@ -35,7 +35,7 @@ __END__
=head1 COPYRIGHT
Copyright 2023 OmniOS Community Edition (OmniOSce) Association.
Copyright 2024 OmniOS Community Edition (OmniOSce) Association.
=head1 LICENSE
Expand Down
8 changes: 5 additions & 3 deletions lib/OOCEapps/PkgUpd/Zig.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ sub canParse {
my $name = shift;
my $url = shift;

return $name =~ m!developer/zig$!;
return $name =~ m!developer/zig-!;
}

sub getVersions {
my $self = shift;
my $name = shift;
my $res = shift;

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

return [ grep { /^\Q$ver\E[\d.]+$/ } keys %{$res->json // {}} ];
}

1;
Expand All @@ -24,7 +26,7 @@ __END__
=head1 COPYRIGHT
Copyright 2022 OmniOS Community Edition (OmniOSce) Association.
Copyright 2024 OmniOS Community Edition (OmniOSce) Association.
=head1 LICENSE
Expand Down

0 comments on commit 2f58a22

Please sign in to comment.