Skip to content

Commit

Permalink
pkgupd: add URL as parameter for parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
hadfl committed Aug 22, 2024
1 parent 5bb9393 commit 06ef87e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/OOCEapps/Controller/PkgUpd.pm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ my $getPkgAvailVer = sub {

$pl->{$chunk->[$i]}->{availVer} = $self->config->{parser}
->{exists $self->config->{parser}->{$chunk->[$i]} ? $chunk->[$i] : 'DEFAULT'}
->getVersions($chunk->[$i], $tx[$i]->[0]->result);
->getVersions($chunk->[$i], $tx[$i]->[0]->result, $tx[$i]->[0]->req->url);
}
})->wait;

Expand Down
5 changes: 4 additions & 1 deletion lib/OOCEapps/PkgUpd/GitHub.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ sub getVersions {
my $self = shift;
my $name = shift;
my $res = shift;
my $url = shift;

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

Expand All @@ -49,9 +50,11 @@ sub getVersions {
s/(\d+)-/$1./g for @versions;
}

my $prog = $url->path->[1];

return [
grep { /^$ver/ }
map { m#/releases/tag/(?:v(?:er\.)?|rel(?:ease)?[-.]|stable-|R\.|$name-?\.?)?
map { m#/\Q$prog\E/releases/tag/(?:v(?:er\.)?|rel(?:ease)?[-.]|stable-|R\.|$name-?\.?)?
(\d{4}(?:-\d{2}){2}T(?:\d{2}-){2}\d{2}Z|[\d.]+(?:op)?\d+)
(?!-?(?:\.\d+|\.?(?:rc\d*|dev|a(?:lpha)?|b(?:eta)?|pre|test)))#ix
} @versions
Expand Down

0 comments on commit 06ef87e

Please sign in to comment.