Verified Commit 4ded7163 authored by Paul Wise's avatar Paul Wise

Add support for checking for simple versions in Python __version__ variables

parent 6772c774
......@@ -717,6 +717,10 @@ elsif( $upstream_param =~ m%^adacore/($project_char_re+)$% )
# https://tracker.debian.org/pkg/ktikz
# https://github.com/fhackenberger/ktikz/
# https://qa.debian.org/cgi-bin/fakeupstream.cgi?file=CMakeLists.txt;type=cmake;upstream=github_commits_package_json/fhackenberger/ktikz
# https://tracker.debian.org/pkg/librecaptcha
# https://github.com/nickolas360/librecaptcha/
# https://qa.debian.org/cgi-bin/fakeupstream.cgi?file=librecaptcha/librecaptcha.py;type=__version__;upstream=github_commits_package_json/nickolas360/librecaptcha
elsif( $upstream_param =~ m%^github_commits_package_json/($github_project_char_re+/$github_project_char_re+)$% )
{
$file_param = 'package.json' unless $file_param;
......@@ -743,6 +747,8 @@ elsif( $upstream_param =~ m%^github_commits_package_json/($github_project_char_r
if ($type_param eq 'package.json'){
my $package_json = JSON::decode_json( $response->decoded_content );
$version = %{$package_json}{version} if $package_json;
} elsif ($type_param eq '__version__'){
($version) = $response->decoded_content =~ m{^\s*__version__\s*=\s*['"]([^"']+)["']\s*$}i;
} elsif ($type_param eq 'cmake'){
($version) = $response->decoded_content =~ m{set\([a-z0-9]+_version +"([^"]+)"\)}i;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment