Skip to content

Commit

Permalink
Merge pull request #219 from hadfl/pkgupd
Browse files Browse the repository at this point in the history
pkgupd: add URL as parameter for parsers
  • Loading branch information
oetiker authored Aug 26, 2024
2 parents 5bb9393 + 06ef87e commit 3a94a59
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 3a94a59

Please sign in to comment.