diff options
author | Tim Retout <tim@retout.co.uk> | 2012-08-13 22:18:17 +0100 |
---|---|---|
committer | Tim Retout <tim@retout.co.uk> | 2012-08-13 22:32:36 +0100 |
commit | 4b180f51c5cbaaabfcaba6899b5047c89d623cc2 (patch) | |
tree | 08db2e2cc6013933c85ee00a96d5e2090cc097c3 /solenv | |
parent | ae296a60781a2b5d5b7523cbda3444e3dd21506f (diff) |
installer::download: Clean up get_versionstring and make private
Change-Id: I9499b7eb580b499ea63bbf8d6ba5bf45a1c460e1
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/bin/modules/installer/download.pm | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/solenv/bin/modules/installer/download.pm b/solenv/bin/modules/installer/download.pm index 81740674b6e9..ac48fe59dd68 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); } |