From 52a764c8df5a11015591d0ccf380197a094a925d Mon Sep 17 00:00:00 2001 From: Tracey Clark Date: Fri, 15 Mar 2019 16:40:57 -0500 Subject: [PATCH] Update regex 'update-gitea.pl' Corrected regex to properly get version number. Removed commented out code that wont be used. --- update-gitea.pl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/update-gitea.pl b/update-gitea.pl index 873641d..247beaa 100644 --- a/update-gitea.pl +++ b/update-gitea.pl @@ -42,7 +42,7 @@ $VAR1 = { my $gitea_bin = '/home/gitea/bin/gitea'; my $gitea_current_version_string = `$gitea_bin --version`; my $gitea_current_version; -if ( $gitea_current_version_string =~ m/ion\ (\w+)\ b/ ) { +if ( $gitea_current_version_string =~ m/ion\ (\d+\.\d+\.\d*)\s+b/ ) { $gitea_current_version = $1; } printf("The version of gitea that is running is \"$gitea_current_version\"\n"); @@ -68,8 +68,8 @@ my $bz = new IO::Compress::Bzip2 $temp_out # need to do in OO way # https://metacpan.org/pod/IO::Compress::Bzip2 -print $bz $gitea_bin; # This writes the filename as string to the bz -$bz->close(); +#print $bz $gitea_bin; # This writes the filename as string to the bz +#$bz->close(); my $baseURL = q{https://github.com/go-gitea/gitea/}; my $latestURL = q{https://api.github.com/repos/go-gitea/gitea/releases/latest}; @@ -77,7 +77,6 @@ my $latestURL = q{https://api.github.com/repos/go-gitea/gitea/releases/latest}; # https://hubpages.com/technology/Use-Perl-to-access-REST-API # Spin up the browser object (via LWP::UserAgent) my $ua = LWP::UserAgent->new( - #ssl_opts => { verify_hostname => 0 }, # not worried about SSL certs cookie_jar => {}, # keep cookies in RAM but not persistent between sessions );