Fixed regex for getting current version

This commit is contained in:
Tracey Clark 2019-03-15 14:47:07 -05:00
commit a7de1d6a5c

View file

@ -42,7 +42,7 @@ $VAR1 = {
my $gitea_bin = '/home/gitea/bin/gitea'; my $gitea_bin = '/home/gitea/bin/gitea';
my $gitea_current_version_string = `$gitea_bin --version`; my $gitea_current_version_string = `$gitea_bin --version`;
my $gitea_current_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; $gitea_current_version = $1;
} }
printf("The version of gitea that is running is \"$gitea_current_version\"\n"); printf("The version of gitea that is running is \"$gitea_current_version\"\n");
@ -63,6 +63,10 @@ my $input = $gitea_bin;
my $temp_out = '/home/gitea/tempout.bz'; my $temp_out = '/home/gitea/tempout.bz';
my $bz = new IO::Compress::Bzip2 $temp_out my $bz = new IO::Compress::Bzip2 $temp_out
or die "bzip2 failed: $Bzip2Error\n"; or die "bzip2 failed: $Bzip2Error\n";
# bzip2 $input => "$temp_out"
# or die "bzip2 failed: $Bzip2Error\n"; # This only writes the filepath to the output
# bzip2 $input => "$gitea_bin_backup" # bzip2 $input => "$gitea_bin_backup"
# or die "bzip2 failed: $Bzip2Error\n"; # This works, but writes garbage to end of filename # or die "bzip2 failed: $Bzip2Error\n"; # This works, but writes garbage to end of filename
# need to do in OO way # need to do in OO way