| author | Tim Retout <tim@retout.co.uk> | 2012-08-13 21:18:17 (GMT) |
|---|---|---|
| committer | Tim Retout <tim@retout.co.uk> | 2012-08-13 21:32:36 (GMT) |
| commit | 4b180f51c5cbaaabfcaba6899b5047c89d623cc2 (patch) (side-by-side diff) | |
| tree | 08db2e2cc6013933c85ee00a96d5e2090cc097c3 | |
| parent | ae296a60781a2b5d5b7523cbda3444e3dd21506f (diff) | |
| download | core-4b180f51c5cbaaabfcaba6899b5047c89d623cc2.zip core-4b180f51c5cbaaabfcaba6899b5047c89d623cc2.tar.gz | |
installer::download: Clean up get_versionstring and make private
Change-Id: I9499b7eb580b499ea63bbf8d6ba5bf45a1c460e1
| -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 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); } |
