[Libreoffice-commits] .: solenv/bin
Tim Retout
timretout at kemper.freedesktop.org
Mon Aug 13 14:39:25 PDT 2012
solenv/bin/modules/installer/download.pm | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
New commits:
commit 4b180f51c5cbaaabfcaba6899b5047c89d623cc2
Author: Tim Retout <tim at retout.co.uk>
Date: Mon Aug 13 22:18:17 2012 +0100
installer::download: Clean up get_versionstring and make private
Change-Id: I9499b7eb580b499ea63bbf8d6ba5bf45a1c460e1
diff --git a/solenv/bin/modules/installer/download.pm b/solenv/bin/modules/installer/download.pm
index 8174067..ac48fe5 100644
--- a/solenv/bin/modules/installer/download.pm
+++ b/solenv/bin/modules/installer/download.pm
@@ -542,18 +542,16 @@ sub get_downloadname_addon
# This has to be the only content of this file.
#########################################################
-sub get_versionstring
+sub _get_versionstring
{
my ( $versionfile ) = @_;
my $versionstring = "";
- for ( my $i = 0; $i <= $#{$versionfile}; $i++ )
+ for ( @{$versionfile} )
{
- my $oneline = ${$versionfile}[$i];
-
- if ( $oneline =~ /^\s*\#/ ) { next; } # comment line
- if ( $oneline =~ /^\s*\"\s*(.*?)\s*\"\s*$/ )
+ next if /^\s*\#/; # comment line
+ if ( /^\s*\"\s*(.*?)\s*\"\s*$/ )
{
$versionstring = $1;
last;
@@ -580,7 +578,7 @@ sub get_current_version
$infoline = "File $filename exists. Trying to find current version.\n";
push( @installer::globals::logfileinfo, $infoline);
my $versionfile = installer::files::read_file($filename);
- $versionstring = get_versionstring($versionfile);
+ $versionstring = _get_versionstring($versionfile);
$infoline = "Setting version string: $versionstring\n";
push( @installer::globals::logfileinfo, $infoline);
}
More information about the Libreoffice-commits
mailing list