solenv/bin/modules/installer.pm | 11 solenv/bin/modules/installer/control.pm | 12 solenv/bin/modules/installer/environment.pm | 3 solenv/bin/modules/installer/epmfile.pm | 33 solenv/bin/modules/installer/filelists.pm | 3 solenv/bin/modules/installer/globals.pm | 473 ++++++------ solenv/bin/modules/installer/languagepack.pm | 5 solenv/bin/modules/installer/languages.pm | 3 solenv/bin/modules/installer/packagelist.pm | 7 solenv/bin/modules/installer/parameter.pm | 3 solenv/bin/modules/installer/pathanalyzer.pm | 3 solenv/bin/modules/installer/profiles.pm | 5 solenv/bin/modules/installer/remover.pm | 3 solenv/bin/modules/installer/scpzipfiles.pm | 3 solenv/bin/modules/installer/scriptitems.pm | 4 solenv/bin/modules/installer/setupscript.pm | 5 solenv/bin/modules/installer/simplepackage.pm | 11 solenv/bin/modules/installer/systemactions.pm | 15 solenv/bin/modules/installer/windows/admin.pm | 3 solenv/bin/modules/installer/windows/assembly.pm | 3 solenv/bin/modules/installer/windows/binary.pm | 3 solenv/bin/modules/installer/windows/component.pm | 3 solenv/bin/modules/installer/windows/createfolder.pm | 3 solenv/bin/modules/installer/windows/directory.pm | 5 solenv/bin/modules/installer/windows/feature.pm | 3 solenv/bin/modules/installer/windows/featurecomponent.pm | 7 solenv/bin/modules/installer/windows/file.pm | 10 solenv/bin/modules/installer/windows/font.pm | 3 solenv/bin/modules/installer/windows/icon.pm | 3 solenv/bin/modules/installer/windows/idtglobal.pm | 17 solenv/bin/modules/installer/windows/inifile.pm | 5 solenv/bin/modules/installer/windows/language.pm | 3 solenv/bin/modules/installer/windows/media.pm | 3 solenv/bin/modules/installer/windows/mergemodule.pm | 14 solenv/bin/modules/installer/windows/msiglobal.pm | 17 solenv/bin/modules/installer/windows/msishortcutproperty.pm | 3 solenv/bin/modules/installer/windows/property.pm | 3 solenv/bin/modules/installer/windows/registry.pm | 3 solenv/bin/modules/installer/windows/removefile.pm | 3 solenv/bin/modules/installer/windows/shortcut.pm | 14 solenv/bin/modules/installer/windows/strip.pm | 5 solenv/bin/modules/installer/windows/update.pm | 7 solenv/bin/modules/installer/windows/upgrade.pm | 3 solenv/bin/modules/installer/worker.pm | 9 solenv/bin/modules/installer/ziplist.pm | 7 45 files changed, 452 insertions(+), 312 deletions(-)
New commits: commit 824b70fc473f96fca480f3d0d64f63234666db2b Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Sun Oct 30 18:03:43 2022 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sun Oct 30 21:17:56 2022 +0100 'use strict' and 'use warnings' in all installer Perl Change-Id: I6068b795a7dfac24651c8e4a100f78dbee11f98b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142044 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/solenv/bin/modules/installer.pm b/solenv/bin/modules/installer.pm index 071d31b13b14..a22385924b92 100644 --- a/solenv/bin/modules/installer.pm +++ b/solenv/bin/modules/installer.pm @@ -18,6 +18,9 @@ package installer; +use strict; +use warnings; + use base 'Exporter'; use Cwd; @@ -536,7 +539,7 @@ sub run { # Resolving include paths (language dependent) ################################################ - $includepatharrayref_lang = installer::ziplist::replace_languages_in_paths($includepatharrayref, \@setuplanguagesarray); + my $includepatharrayref_lang = installer::ziplist::replace_languages_in_paths($includepatharrayref, \@setuplanguagesarray); if ( $installer::globals::refresh_includepaths ) { installer::worker::collect_all_files_from_includepaths($includepatharrayref_lang); } @@ -1023,7 +1026,7 @@ sub run { if ( ! ( $#{$filesinpackage} > -1 )) { - $infoline = "\n\nNo file in package: $packagename \-\> Skipping\n\n"; + my $infoline = "\n\nNo file in package: $packagename \-\> Skipping\n\n"; push(@installer::globals::logfileinfo, $infoline); next; # next package, end of loop ! } @@ -1379,7 +1382,7 @@ sub run { installer::windows::assembly::add_assembly_condition_into_component_table($filesinproductlanguageresolvedarrayref, $newidtdir); } - $infoline = "\n"; + my $infoline = "\n"; push(@installer::globals::logfileinfo, $infoline); # Localizing the language dependent idt files @@ -1535,7 +1538,7 @@ sub run { # validating the database # ToDo - installer::windows::msiglobal::write_summary_into_msi_database($msifilename, $onelanguage, $languagefile, $allvariableshashref); + installer::windows::msiglobal::write_summary_into_msi_database($msifilename, $onelanguage, $allvariableshashref); # copy msi database into installation directory diff --git a/solenv/bin/modules/installer/control.pm b/solenv/bin/modules/installer/control.pm index 196a13546ee0..d126e917b57f 100644 --- a/solenv/bin/modules/installer/control.pm +++ b/solenv/bin/modules/installer/control.pm @@ -18,6 +18,9 @@ package installer::control; +use strict; +use warnings; + use Cwd; use installer::converter; use installer::exiter; @@ -35,8 +38,9 @@ use installer::systemactions; sub check_needed_files_in_path { my ( $filesref ) = @_; + my $error = 0; - foreach $onefile ( @{$filesref} ) + foreach my $onefile ( @{$filesref} ) { installer::logger::print_message( "... searching $onefile ..." ); @@ -80,7 +84,7 @@ sub check_system_path # When using cygwin's perl the PATH variable is POSIX style and # has to be converted to DOS style for further use. $pathvariable = join ';', - map { $dir = qx{cygpath -m "$_"}; chomp($dir); $dir } + map { my $dir = qx{cygpath -m "$_"}; chomp($dir); $dir } split /\Q$local_pathseparator\E\s*/, $pathvariable; $local_pathseparator = ';'; } @@ -167,12 +171,12 @@ sub get_makecab_version if ($returnvalue) { - $infoline = "ERROR: Could not execute \"$systemcall\"!\n"; + my $infoline = "ERROR: Could not execute \"$systemcall\"!\n"; push( @installer::globals::globallogfileinfo, $infoline); } else { - $infoline = "Success: Executed \"$systemcall\" successfully!\n"; + my $infoline = "Success: Executed \"$systemcall\" successfully!\n"; push( @installer::globals::globallogfileinfo, $infoline); my $versionline = ""; diff --git a/solenv/bin/modules/installer/environment.pm b/solenv/bin/modules/installer/environment.pm index b45227f8a1a4..c04971431f40 100644 --- a/solenv/bin/modules/installer/environment.pm +++ b/solenv/bin/modules/installer/environment.pm @@ -18,6 +18,9 @@ package installer::environment; +use strict; +use warnings; + use installer::globals; ###################################################### diff --git a/solenv/bin/modules/installer/epmfile.pm b/solenv/bin/modules/installer/epmfile.pm index 495366823604..51d596dcb519 100644 --- a/solenv/bin/modules/installer/epmfile.pm +++ b/solenv/bin/modules/installer/epmfile.pm @@ -18,6 +18,9 @@ package installer::epmfile; +use strict; +use warnings; + use Cwd qw(); use installer::converter; use installer::exiter; @@ -418,7 +421,7 @@ sub create_epm_header if (( $installer::globals::issolarispkgbuild ) && ( ! $variableshashref->{'NO_LICENSE_INTO_COPYRIGHT'} )) { - if ( ! $installer::globals::englishlicenseset ) { _set_english_license() } + if ( ! $installer::globals::englishlicenseset ) { _set_english_license($variableshashref) } # The location for the new file my $languagestring = ""; @@ -921,7 +924,7 @@ sub set_revision_in_pkginfo if ( $mday < 10 ) { $mday = "0" . $mday; } if ( $mon < 10 ) { $mon = "0" . $mon; } - $datestring = $year . "." . $mon . "." . $mday; + my $datestring = $year . "." . $mon . "." . $mday; $revisionstring = $revisionstring . "." . $datestring; for ( my $i = 0; $i <= $#{$file}; $i++ ) @@ -1202,7 +1205,7 @@ sub set_autoprovreq_in_specfile { splice(@{$changefile},$i+1,0,$autoreqprovline); $autoreqprovline =~ s/\s*$//; - $infoline = "Success: Added line $autoreqprovline into spec file!\n"; + my $infoline = "Success: Added line $autoreqprovline into spec file!\n"; push( @installer::globals::logfileinfo, $infoline); last; @@ -1907,7 +1910,7 @@ sub create_packages_without_epm installer::systemactions::make_systemcall($systemcall); $faspac = $$compressorref; - $infoline = "Found compressor: $faspac\n"; + my $infoline = "Found compressor: $faspac\n"; push( @installer::globals::logfileinfo, $infoline); installer::logger::print_message( "... $faspac ...\n" ); @@ -1927,7 +1930,7 @@ sub create_packages_without_epm } else { - $infoline = "Not found: $faspac\n"; + my $infoline = "Not found: $faspac\n"; push( @installer::globals::logfileinfo, $infoline); } } @@ -1937,9 +1940,9 @@ sub create_packages_without_epm $systemcall = "cd $destinationdir; find $packagename -type d | xargs -i chmod 775 \{\} \;"; installer::logger::print_message( "... $systemcall ...\n" ); - $returnvalue = system($systemcall); + my $returnvalue = system($systemcall); - $infoline = "Systemcall: $systemcall\n"; + my $infoline = "Systemcall: $systemcall\n"; push( @installer::globals::logfileinfo, $infoline); if ($returnvalue) @@ -2109,7 +2112,7 @@ sub create_packages_without_epm my $helperreturnvalue = $?; # $? contains the return value of the systemcall - $infoline = "\nLast try: Using $rpmprog directly (problem with LD_LIBRARY_PATH)\n"; + my $infoline = "\nLast try: Using $rpmprog directly (problem with LD_LIBRARY_PATH)\n"; push( @installer::globals::logfileinfo, $infoline); $infoline = "\nSystemcall: $helpersystemcall\n"; @@ -2167,7 +2170,7 @@ sub remove_temporary_epm_files my $systemcall = "mv -f $removefile $destfile"; system($systemcall); # ignoring the return value - $infoline = "Systemcall: $systemcall\n"; + my $infoline = "Systemcall: $systemcall\n"; push( @installer::globals::logfileinfo, $infoline); } } @@ -2179,7 +2182,7 @@ sub remove_temporary_epm_files my $systemcall = "mv -f $removefile $destfile"; system($systemcall); # ignoring the return value - $infoline = "Systemcall: $systemcall\n"; + my $infoline = "Systemcall: $systemcall\n"; push( @installer::globals::logfileinfo, $infoline); # removing the directory "buildroot" @@ -2201,7 +2204,7 @@ sub remove_temporary_epm_files $returnvalue = system($systemcall); - my $infoline = "Systemcall: $systemcall\n"; + $infoline = "Systemcall: $systemcall\n"; push( @installer::globals::logfileinfo, $infoline); if ($returnvalue) @@ -2431,7 +2434,7 @@ sub put_systemintegration_into_installset if ( ! $installer::globals::issolarispkgbuild ) { ($newcontent, $subdir) = control_subdirectories($newcontent); } # Adding license content into Solaris packages - if (( $installer::globals::issolarispkgbuild ) && ( $installer::globals::englishlicenseset ) && ( ! $variableshashref->{'NO_LICENSE_INTO_COPYRIGHT'} )) { _add_license_into_systemintegrationpackages($destdir, $newcontent); } + if (( $installer::globals::issolarispkgbuild ) && ( $installer::globals::englishlicenseset ) && ( ! $allvariables->{'NO_LICENSE_INTO_COPYRIGHT'} )) { _add_license_into_systemintegrationpackages($destdir, $newcontent); } } } @@ -2479,6 +2482,8 @@ sub analyze_rootpath sub _set_english_license { + my ($variableshashref) = @_; + my $additional_license_name = $installer::globals::englishsolarislicensename; # always the English file my $licensefileref = installer::scriptitems::get_sourcepath_from_filename_and_includepath(\$additional_license_name, "" , 0); if ( $$licensefileref eq "" ) { installer::exiter::exit_program("ERROR: Could not find license file $additional_license_name!", "set_english_license"); } @@ -2595,7 +2600,7 @@ sub _call_sum { my ($filename) = @_; - $sumfile = "/usr/bin/sum"; + my $sumfile = "/usr/bin/sum"; if ( ! -f $sumfile ) { installer::exiter::exit_program("ERROR: No file /usr/bin/sum", "call_sum"); } @@ -2635,7 +2640,7 @@ sub _call_wc { my ($filename) = @_; - $wcfile = "/usr/bin/wc"; + my $wcfile = "/usr/bin/wc"; if ( ! -f $wcfile ) { installer::exiter::exit_program("ERROR: No file /usr/bin/wc", "call_wc"); } diff --git a/solenv/bin/modules/installer/filelists.pm b/solenv/bin/modules/installer/filelists.pm index 1320a89e6ee2..b623478a30b8 100644 --- a/solenv/bin/modules/installer/filelists.pm +++ b/solenv/bin/modules/installer/filelists.pm @@ -8,6 +8,9 @@ package installer::filelists; +use strict; +use warnings; + use File::stat; use installer::files; diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm index 5bbaef309145..045d9d6afde9 100644 --- a/solenv/bin/modules/installer/globals.pm +++ b/solenv/bin/modules/installer/globals.pm @@ -18,271 +18,274 @@ package installer::globals; +use strict; +use warnings; + ############################################ # Global settings ############################################ BEGIN { - $ziplistname = ""; - $pathfilename = ""; - $setupscriptname = ""; - $product = ""; - $languagelist = ""; - $added_english = 0; - $set_office_start_language = 0; + $installer::globals::ziplistname = ""; + $installer::globals::pathfilename = ""; + $installer::globals::setupscriptname = ""; + $installer::globals::product = ""; + $installer::globals::languagelist = ""; + $installer::globals::added_english = 0; + $installer::globals::set_office_start_language = 0; - $destdir = ""; - $rootpath = ""; + $installer::globals::destdir = ""; + $installer::globals::rootpath = ""; - @languageproducts = (); - $build = ""; - $os = ""; - $cpuname = ""; - $com = ""; - $platformid = ""; - $pro = 0; - $dounzip = 1; - $languages_defined_in_productlist = 0; - $setupscript_defined_in_productlist = 0; - $iswindowsbuild = 0; - $islinuxbuild = 0; - $isrpmbuild = 0; - $isdebbuild = 0; - $issolarisbuild = 0; - $issolarispkgbuild = 0; - $issolarissparcbuild = 0; - $issolarisx86build = 0; - $isfreebsdbuild = 0; - $isfreebsdpkgbuild = 0; - $ismacbuild = 0; - $ismacdmgbuild = 0; - $unpackpath = ""; - $workpath = ""; # installation working dir; some helper scripts are + @installer::globals::languageproducts = (); + $installer::globals::build = ""; + $installer::globals::os = ""; + $installer::globals::cpuname = ""; + $installer::globals::com = ""; + $installer::globals::platformid = ""; + $installer::globals::pro = 0; + $installer::globals::dounzip = 1; + $installer::globals::languages_defined_in_productlist = 0; + $installer::globals::setupscript_defined_in_productlist = 0; + $installer::globals::iswindowsbuild = 0; + $installer::globals::islinuxbuild = 0; + $installer::globals::isrpmbuild = 0; + $installer::globals::isdebbuild = 0; + $installer::globals::issolarisbuild = 0; + $installer::globals::issolarispkgbuild = 0; + $installer::globals::issolarissparcbuild = 0; + $installer::globals::issolarisx86build = 0; + $installer::globals::isfreebsdbuild = 0; + $installer::globals::isfreebsdpkgbuild = 0; + $installer::globals::ismacbuild = 0; + $installer::globals::ismacdmgbuild = 0; + $installer::globals::unpackpath = ""; + $installer::globals::workpath = ""; # installation working dir; some helper scripts are # placed here by gbuild - $idttemplatepath = ""; - $idtlanguagepath = ""; - $buildid = "Not set"; - $fontsfolder = "FontsFolder"; - $fontsfoldername = "Fonts"; - $fontsdirparent = ""; - $fontsdirname = ""; - $fontsdirhostname = "truetype"; - $officemenufolder = "OfficeMenuFolder"; - $startupfolder = "StartupFolder"; - $startmenufolder = "StartMenuFolder"; - $desktopfolder = "DesktopFolder"; - $programfilesfolder = "ProgramFilesFolder"; - $commonfilesfolder = "CommonFilesFolder"; - $commonappdatafolder = "CommonAppDataFolder"; - $localappdatafolder = "LocalAppDataFolder"; - $templatefolder = "TemplateFolder"; - $templatefoldername = "Templates"; - $programmenufolder = "ProgramMenuFolder"; - $lcidlistname = $ENV{'SRCDIR'} . "/l10ntools/source/ulfconv/msi-encodinglist.txt"; - $msilanguage = ""; # hash reference for msi languages LCID - $sofficeiconadded = 0; - $temppath = ""; - $cyg_temppath = ""; - $temppathdefined = 0; - $packageversion = 1; - $packagerevision = 1; - $rpm = ""; - $rpminfologged = 0; - $debian = ""; - $installertypedir = ""; - $controlledmakecabversion = "5"; - $max_lang_length = 50; - $globalblock = "Globals"; - $rootmodulegid = ""; - %alllangmodules = (); - $englishlicenseset = 0; - $englishlicense = ""; - $englishsolarislicensename = "LICENSE"; # _en-US"; - $solarisdontcompress = 0; - $patharray = ""; + $installer::globals::idttemplatepath = ""; + $installer::globals::idtlanguagepath = ""; + $installer::globals::buildid = "Not set"; + $installer::globals::fontsfolder = "FontsFolder"; + $installer::globals::fontsfoldername = "Fonts"; + $installer::globals::fontsdirparent = ""; + $installer::globals::fontsdirname = ""; + $installer::globals::fontsdirhostname = "truetype"; + $installer::globals::officemenufolder = "OfficeMenuFolder"; + $installer::globals::startupfolder = "StartupFolder"; + $installer::globals::startmenufolder = "StartMenuFolder"; + $installer::globals::desktopfolder = "DesktopFolder"; + $installer::globals::programfilesfolder = "ProgramFilesFolder"; + $installer::globals::commonfilesfolder = "CommonFilesFolder"; + $installer::globals::commonappdatafolder = "CommonAppDataFolder"; + $installer::globals::localappdatafolder = "LocalAppDataFolder"; + $installer::globals::templatefolder = "TemplateFolder"; + $installer::globals::templatefoldername = "Templates"; + $installer::globals::programmenufolder = "ProgramMenuFolder"; + $installer::globals::lcidlistname = $ENV{'SRCDIR'} . "/l10ntools/source/ulfconv/msi-encodinglist.txt"; + $installer::globals::msilanguage = ""; # hash reference for msi languages LCID + $installer::globals::sofficeiconadded = 0; + $installer::globals::temppath = ""; + $installer::globals::cyg_temppath = ""; + $installer::globals::temppathdefined = 0; + $installer::globals::packageversion = 1; + $installer::globals::packagerevision = 1; + $installer::globals::rpm = ""; + $installer::globals::rpminfologged = 0; + $installer::globals::debian = ""; + $installer::globals::installertypedir = ""; + $installer::globals::controlledmakecabversion = "5"; + $installer::globals::max_lang_length = 50; + $installer::globals::globalblock = "Globals"; + $installer::globals::rootmodulegid = ""; + %installer::globals::alllangmodules = (); + $installer::globals::englishlicenseset = 0; + $installer::globals::englishlicense = ""; + $installer::globals::englishsolarislicensename = "LICENSE"; # _en-US"; + $installer::globals::solarisdontcompress = 0; + $installer::globals::patharray = ""; - $is_special_epm = 0; - $epm_in_path = 0; - $epm_path = ""; - $epmoutpath = ""; - $simple = 0; - $simpledefaultuserdir = "\$ORIGIN/.."; - $call_epm = 1; - $packageformat = ""; - $packagename = ""; - $packagelist = ""; - $shiptestdirectory = ""; - $archiveformat = ""; - $updatelastsequence = 0; - $updatesequencecounter = 0; - $updatedatabase = 0; - $updatedatabasepath = ""; - $pffcabfilename = "ooobasis3.0_pff.cab"; - %allmergemodulefilesequences = (); - %newupdatefiles = (); - %allusedupdatesequences = (); - %mergemodulefiles = (); - $mergefiles_added_into_collector = 0; - $creating_windows_installer_patch = 0; + $installer::globals::is_special_epm = 0; + $installer::globals::epm_in_path = 0; + $installer::globals::epm_path = ""; + $installer::globals::epmoutpath = ""; + $installer::globals::simple = 0; + $installer::globals::simpledefaultuserdir = "\$ORIGIN/.."; + $installer::globals::call_epm = 1; + $installer::globals::packageformat = ""; + $installer::globals::packagename = ""; + $installer::globals::packagelist = ""; + $installer::globals::shiptestdirectory = ""; + $installer::globals::archiveformat = ""; + $installer::globals::updatelastsequence = 0; + $installer::globals::updatesequencecounter = 0; + $installer::globals::updatedatabase = 0; + $installer::globals::updatedatabasepath = ""; + $installer::globals::pffcabfilename = "ooobasis3.0_pff.cab"; + %installer::globals::allmergemodulefilesequences = (); + %installer::globals::newupdatefiles = (); + %installer::globals::allusedupdatesequences = (); + %installer::globals::mergemodulefiles = (); + $installer::globals::mergefiles_added_into_collector = 0; + $installer::globals::creating_windows_installer_patch = 0; - $strip = 0; + $installer::globals::strip = 0; - $packertool = "gzip"; # the default package compression tool for *NIX + $installer::globals::packertool = "gzip"; # the default package compression tool for *NIX - $logfilename = "logfile.log"; # the default logfile name for global errors - @logfileinfo = (); - @errorlogfileinfo = (); - @globallogfileinfo = (); - $ignore_error_in_logfile = 0; - $exitlog = ""; - $quiet = 0; + $installer::globals::logfilename = "logfile.log"; # the default logfile name for global errors + @installer::globals::logfileinfo = (); + @installer::globals::errorlogfileinfo = (); + @installer::globals::globallogfileinfo = (); + $installer::globals::ignore_error_in_logfile = 0; + $installer::globals::exitlog = ""; + $installer::globals::quiet = 0; - $ismultilingual = 0; - %alluniquefilenames = (); - %alllcuniquefilenames = (); - %uniquefilenamesequence = (); - %dependfilenames = (); - $manufacturer = ""; - $longmanufacturer = ""; - $codefilename = "codes.txt"; - $componentfilename = "components.txt"; - $productcode = ""; - $upgradecode = ""; - $msiproductversion = ""; - $msimajorproductversion = ""; - @allddffiles = (); - $infodirectory = ""; + $installer::globals::ismultilingual = 0; + %installer::globals::alluniquefilenames = (); + %installer::globals::alllcuniquefilenames = (); + %installer::globals::uniquefilenamesequence = (); + %installer::globals::dependfilenames = (); + $installer::globals::manufacturer = ""; + $installer::globals::longmanufacturer = ""; + $installer::globals::codefilename = "codes.txt"; + $installer::globals::componentfilename = "components.txt"; + $installer::globals::productcode = ""; + $installer::globals::upgradecode = ""; + $installer::globals::msiproductversion = ""; + $installer::globals::msimajorproductversion = ""; + @installer::globals::allddffiles = (); + $installer::globals::infodirectory = ""; - %mergemodules = (); - %merge_media_line = (); - %merge_allfeature_hash = (); - %merge_alldirectory_hash = (); - %merge_directory_hash = (); - %copy_msm_files = (); - $mergefeaturecollected = 0; - $mergedirectoriescollected = 0; - $lastsequence_before_merge = 0; - $lastcabfilename = ""; + %installer::globals::mergemodules = (); + %installer::globals::merge_media_line = (); + %installer::globals::merge_allfeature_hash = (); + %installer::globals::merge_alldirectory_hash = (); + %installer::globals::merge_directory_hash = (); + %installer::globals::copy_msm_files = (); + $installer::globals::mergefeaturecollected = 0; + $installer::globals::mergedirectoriescollected = 0; + $installer::globals::lastsequence_before_merge = 0; + $installer::globals::lastcabfilename = ""; - $defaultlanguage = ""; - $addlicensefile = 1; - $addsystemintegration = 0; - $makedownload = 1; - @binarytableonlyfiles = (); - @allscpactions = (); - $languagepackaddon = "LanguagePack"; - $helppackaddon = "HelpPack"; - $ooodownloadfilename = ""; - $downloadfilename = ""; - $downloadfileextension = ""; - %multilingual_only_modules = (); - %application_modules = (); + $installer::globals::defaultlanguage = ""; + $installer::globals::addlicensefile = 1; + $installer::globals::addsystemintegration = 0; + $installer::globals::makedownload = 1; + @installer::globals::binarytableonlyfiles = (); + @installer::globals::allscpactions = (); + $installer::globals::languagepackaddon = "LanguagePack"; + $installer::globals::helppackaddon = "HelpPack"; + $installer::globals::ooodownloadfilename = ""; + $installer::globals::downloadfilename = ""; + $installer::globals::downloadfileextension = ""; + %installer::globals::multilingual_only_modules = (); + %installer::globals::application_modules = (); - $is_copy_only_project = 0; - $is_simple_packager_project = 0; - $patch_user_dir = 0; - $languagepack = 0; - $helppack = 0; - $refresh_includepaths = 0; - $include_paths_read = 0; - @patchfilecollector = (); - @userregistrycollector = (); - $addeduserregitrykeys = 0; - $desktoplinkexists = 0; - $analyze_spellcheckerlanguage = 0; - %spellcheckerlanguagehash = (); - %spellcheckerfilehash = (); - $registryrootcomponent = ""; - %allcomponents = (); - %allcomponents_in_this_database = (); - %allshortcomponents = (); - %allregistrycomponents_ = (); - %allregistrycomponents_in_this_database_ = (); - %allshortregistrycomponents = (); + $installer::globals::is_copy_only_project = 0; + $installer::globals::is_simple_packager_project = 0; + $installer::globals::patch_user_dir = 0; + $installer::globals::languagepack = 0; + $installer::globals::helppack = 0; + $installer::globals::refresh_includepaths = 0; + $installer::globals::include_paths_read = 0; + @installer::globals::patchfilecollector = (); + @installer::globals::userregistrycollector = (); + $installer::globals::addeduserregitrykeys = 0; + $installer::globals::desktoplinkexists = 0; + $installer::globals::analyze_spellcheckerlanguage = 0; + %installer::globals::spellcheckerlanguagehash = (); + %installer::globals::spellcheckerfilehash = (); + $installer::globals::registryrootcomponent = ""; + %installer::globals::allcomponents = (); + %installer::globals::allcomponents_in_this_database = (); + %installer::globals::allshortcomponents = (); + %installer::globals::allregistrycomponents_ = (); + %installer::globals::allregistrycomponents_in_this_database_ = (); + %installer::globals::allshortregistrycomponents = (); - $installlocationdirectory = ""; - $installlocationdirectoryset = 0; - $vendordirectory = ""; - $officeinstalldirectory = ""; - $rootbrandpackage = ""; - $rootbrandpackageset = 0; - $officedirhostname = ""; - $officedirgid = ""; + $installer::globals::installlocationdirectory = ""; + $installer::globals::installlocationdirectoryset = 0; + $installer::globals::vendordirectory = ""; + $installer::globals::officeinstalldirectory = ""; + $installer::globals::rootbrandpackage = ""; + $installer::globals::rootbrandpackageset = 0; + $installer::globals::officedirhostname = ""; + $installer::globals::officedirgid = ""; - %treestyles = (); - %treelayername = (); - %hostnametreestyles = (); - %treeconditions = (); - %usedtreeconditions = (); - %moduledestination = (); + %installer::globals::treestyles = (); + %installer::globals::treelayername = (); + %installer::globals::hostnametreestyles = (); + %installer::globals::treeconditions = (); + %installer::globals::usedtreeconditions = (); + %installer::globals::moduledestination = (); - $fix_number_of_cab_files = 1; - $cabfilecompressionlevel = 21; # Using LZX compression, possible values are: 15 | 16 | ... | 21 (best compression) - $number_of_cabfiles = 1; # only for $fix_number_of_cab_files = 1 - $include_cab_in_msi = 1; - $msidatabasename = ""; - $prepare_winpatch = 0; - $previous_idt_dir = ""; - $msitranpath = ""; - $insert_file_at_end = 0; - $newfilesexist = 0; - $usesharepointpath = 0; - %newfilescollector = (); + $installer::globals::fix_number_of_cab_files = 1; + $installer::globals::cabfilecompressionlevel = 21; # Using LZX compression, possible values are: 15 | 16 | ... | 21 (best compression) + $installer::globals::number_of_cabfiles = 1; # only for $fix_number_of_cab_files = 1 + $installer::globals::include_cab_in_msi = 1; + $installer::globals::msidatabasename = ""; + $installer::globals::prepare_winpatch = 0; + $installer::globals::previous_idt_dir = ""; + $installer::globals::msitranpath = ""; + $installer::globals::insert_file_at_end = 0; + $installer::globals::newfilesexist = 0; + $installer::globals::usesharepointpath = 0; + %installer::globals::newfilescollector = (); - $saveinstalldir = ""; - $csp_installdir = ""; # global installdir of createsimplepackage() in simplepackage.pm - $csp_installlogdir = ""; # global installlogdir of createsimplepackage() in simplepackage.pm - $csp_languagestring = ""; # global languagestring of createsimplepackage() in simplepackage.pm - $localunpackdir = ""; - $localinstalldirset = 0; - $localinstalldir = ""; + $installer::globals::saveinstalldir = ""; + $installer::globals::csp_installdir = ""; # global installdir of createsimplepackage() in simplepackage.pm + $installer::globals::csp_installlogdir = ""; # global installlogdir of createsimplepackage() in simplepackage.pm + $installer::globals::csp_languagestring = ""; # global languagestring of createsimplepackage() in simplepackage.pm + $installer::globals::localunpackdir = ""; + $installer::globals::localinstalldirset = 0; + $installer::globals::localinstalldir = ""; - $postprocess_specialepm = 0; - $postprocess_standardepm = 0; - $mergemodules_analyzed = 0; + $installer::globals::postprocess_specialepm = 0; + $installer::globals::postprocess_standardepm = 0; + $installer::globals::mergemodules_analyzed = 0; - @packagelistitems = ("module", "solarispackagename", "packagename", "copyright", "vendor", "description" ); - @featurecollector =(); - $msiassemblyfiles = ""; - $macinstallfilename = $ENV{'WORKDIR'} . "/CustomTarget/setup_native/mac/macinstall.ulf"; - $extensioninstalldir = "gid_Dir_Share_Extension_Install"; - @languagenames = (); - %componentcondition = (); - %componentid = (); - %allcabinets = (); - %allcabinetassigns = (); - %cabfilecounter = (); - %lastsequence = (); - %allcalculated_guids = (); - %calculated_component_guids = (); - %all_english_languagestrings = (); - %all_required_english_languagestrings = (); + @installer::globals::packagelistitems = ("module", "solarispackagename", "packagename", "copyright", "vendor", "description" ); + @installer::globals::featurecollector =(); + $installer::globals::msiassemblyfiles = ""; + $installer::globals::macinstallfilename = $ENV{'WORKDIR'} . "/CustomTarget/setup_native/mac/macinstall.ulf"; + $installer::globals::extensioninstalldir = "gid_Dir_Share_Extension_Install"; + @installer::globals::languagenames = (); + %installer::globals::componentcondition = (); + %installer::globals::componentid = (); + %installer::globals::allcabinets = (); + %installer::globals::allcabinetassigns = (); + %installer::globals::cabfilecounter = (); + %installer::globals::lastsequence = (); + %installer::globals::allcalculated_guids = (); + %installer::globals::calculated_component_guids = (); + %installer::globals::all_english_languagestrings = (); + %installer::globals::all_required_english_languagestrings = (); - @removedirs = (); - @removefiletable = (); + @installer::globals::removedirs = (); + @installer::globals::removefiletable = (); if ( $^O =~ /cygwin/i ) { - $zippath = "zip"; # Has to be in the path: /usr/bin/zip - $separator = "/"; - $pathseparator = "\:"; - $isunix = 0; - $iswin = 1; - $archiveformat = ".zip"; - %savedmapping = (); - %savedrevmapping = (); - %savedrev83mapping = (); - %saved83dirmapping = (); + $installer::globals::zippath = "zip"; # Has to be in the path: /usr/bin/zip + $installer::globals::separator = "/"; + $installer::globals::pathseparator = "\:"; + $installer::globals::isunix = 0; + $installer::globals::iswin = 1; + $installer::globals::archiveformat = ".zip"; + %installer::globals::savedmapping = (); + %installer::globals::savedrevmapping = (); + %installer::globals::savedrev83mapping = (); + %installer::globals::saved83dirmapping = (); } else { - $zippath = "zip"; # Has to be in the path: /usr/bin/zip - $separator = "/"; - $pathseparator = "\:"; - $archiveformat = ".tar.gz"; - $isunix = 1; - $iswin = 0; + $installer::globals::zippath = "zip"; # Has to be in the path: /usr/bin/zip + $installer::globals::separator = "/"; + $installer::globals::pathseparator = "\:"; + $installer::globals::archiveformat = ".tar.gz"; + $installer::globals::isunix = 1; + $installer::globals::iswin = 0; } } diff --git a/solenv/bin/modules/installer/languagepack.pm b/solenv/bin/modules/installer/languagepack.pm index 14a870866128..134e0e6c2b98 100644 --- a/solenv/bin/modules/installer/languagepack.pm +++ b/solenv/bin/modules/installer/languagepack.pm @@ -18,6 +18,9 @@ package installer::languagepack; +use strict; +use warnings; + use installer::converter; use installer::files; use installer::globals; @@ -128,7 +131,7 @@ sub create_tar_gz_file $packagename =~ s/\.rpm\s*$//; my $targzname = $packagename . ".tar.gz"; - $systemcall = "cd $installdir; tar -cf - $packagestring | $installer::globals::packertool > $targzname"; + my $systemcall = "cd $installdir; tar -cf - $packagestring | $installer::globals::packertool > $targzname"; installer::logger::print_message( "... $systemcall ...\n" ); my $returnvalue = system($systemcall); diff --git a/solenv/bin/modules/installer/languages.pm b/solenv/bin/modules/installer/languages.pm index e2590538353e..a03aafb00c53 100644 --- a/solenv/bin/modules/installer/languages.pm +++ b/solenv/bin/modules/installer/languages.pm @@ -18,6 +18,9 @@ package installer::languages; +use strict; +use warnings; + use installer::converter; use installer::exiter; use installer::globals; diff --git a/solenv/bin/modules/installer/packagelist.pm b/solenv/bin/modules/installer/packagelist.pm index a0e1da760b44..aef4f94015b4 100644 --- a/solenv/bin/modules/installer/packagelist.pm +++ b/solenv/bin/modules/installer/packagelist.pm @@ -18,6 +18,9 @@ package installer::packagelist; +use strict; +use warnings; + use installer::converter; use installer::exiter; use installer::globals; @@ -56,7 +59,7 @@ sub analyze_list { my ($packagelist, $moduleslist) = @_; - @allpackages = (); + my @allpackages = (); my $moduleshash = get_module_hash($moduleslist); @@ -554,7 +557,7 @@ sub get_packinfo $onepackage{'islanguagemodule'} = $islanguagemodule; if ( $islanguagemodule ) { - $saveonelanguage = $onelanguage; + my $saveonelanguage = $onelanguage; $saveonelanguage =~ s/_/-/g; $onepackage{'language'} = $saveonelanguage; } diff --git a/solenv/bin/modules/installer/parameter.pm b/solenv/bin/modules/installer/parameter.pm index befed72024a0..2841ebe036ea 100644 --- a/solenv/bin/modules/installer/parameter.pm +++ b/solenv/bin/modules/installer/parameter.pm @@ -18,6 +18,9 @@ package installer::parameter; +use strict; +use warnings; + use Cwd; use installer::exiter; use installer::files; diff --git a/solenv/bin/modules/installer/pathanalyzer.pm b/solenv/bin/modules/installer/pathanalyzer.pm index 312042acb1a0..de2ac21262ae 100644 --- a/solenv/bin/modules/installer/pathanalyzer.pm +++ b/solenv/bin/modules/installer/pathanalyzer.pm @@ -18,6 +18,9 @@ package installer::pathanalyzer; +use strict; +use warnings; + use installer::globals; ########################################### diff --git a/solenv/bin/modules/installer/profiles.pm b/solenv/bin/modules/installer/profiles.pm index a1a7b4507c71..5e46b5c85b41 100644 --- a/solenv/bin/modules/installer/profiles.pm +++ b/solenv/bin/modules/installer/profiles.pm @@ -18,6 +18,9 @@ package installer::profiles; +use strict; +use warnings; + use installer::converter; use installer::files; use installer::globals; @@ -203,7 +206,7 @@ sub create_profiles } # Saving the profile as a file - $completeprofilename = $localprofilesdir . $installer::globals::separator . $profilename; + my $completeprofilename = $localprofilesdir . $installer::globals::separator . $profilename; installer::files::save_file($completeprofilename, $onefileref); diff --git a/solenv/bin/modules/installer/remover.pm b/solenv/bin/modules/installer/remover.pm index 426056eef37f..c9a069ab8473 100644 --- a/solenv/bin/modules/installer/remover.pm +++ b/solenv/bin/modules/installer/remover.pm @@ -18,6 +18,9 @@ package installer::remover; +use strict; +use warnings; + use installer::globals; ############################################ diff --git a/solenv/bin/modules/installer/scpzipfiles.pm b/solenv/bin/modules/installer/scpzipfiles.pm index e6c773196302..08cc8aeecb63 100644 --- a/solenv/bin/modules/installer/scpzipfiles.pm +++ b/solenv/bin/modules/installer/scpzipfiles.pm @@ -18,6 +18,9 @@ package installer::scpzipfiles; +use strict; +use warnings; + use installer::files; use installer::globals; use installer::logger; diff --git a/solenv/bin/modules/installer/scriptitems.pm b/solenv/bin/modules/installer/scriptitems.pm index 7b552622fb9b..0057d47c82e8 100644 --- a/solenv/bin/modules/installer/scriptitems.pm +++ b/solenv/bin/modules/installer/scriptitems.pm @@ -18,6 +18,10 @@ package installer::scriptitems; +use strict; +no strict 'refs'; +use warnings; + use installer::converter; use installer::exiter; use installer::globals; diff --git a/solenv/bin/modules/installer/setupscript.pm b/solenv/bin/modules/installer/setupscript.pm index 6eefe01f0bd5..042e854804be 100644 --- a/solenv/bin/modules/installer/setupscript.pm +++ b/solenv/bin/modules/installer/setupscript.pm @@ -18,6 +18,9 @@ package installer::setupscript; +use strict; +use warnings; + use base 'Exporter'; use installer::exiter; @@ -473,7 +476,7 @@ sub replace_preset_properties push(@presetproperties, "SYSTEMINTUNIXPACKAGENAME"); - foreach $property ( @presetproperties ) + foreach my $property ( @presetproperties ) { my $presetproperty = "PRESET" . $property; if (( exists($allvariables->{$presetproperty}) ) && ( $allvariables->{$presetproperty} ne "" )) diff --git a/solenv/bin/modules/installer/simplepackage.pm b/solenv/bin/modules/installer/simplepackage.pm index b1811a804aea..9efe7e726141 100644 --- a/solenv/bin/modules/installer/simplepackage.pm +++ b/solenv/bin/modules/installer/simplepackage.pm @@ -18,6 +18,9 @@ package installer::simplepackage; +use strict; +use warnings; + use Cwd; use File::Copy; use installer::download; @@ -309,7 +312,7 @@ sub create_package print "... $systemcall ...\n"; my $localreturnvalue = system($systemcall); - $infoline = "Systemcall: $systemcall\n"; + my $infoline = "Systemcall: $systemcall\n"; push( @installer::globals::logfileinfo, $infoline); if ($localreturnvalue) @@ -410,7 +413,7 @@ sub create_package { $systemcall = "$ENV{'SRCDIR'}/solenv/bin/macosx-codesign-app-bundle $localtempdir/$folder/$volume_name_classic_app.app"; print "... $systemcall ...\n"; - $infoline = "Systemcall: $systemcall\n"; + my $infoline = "Systemcall: $systemcall\n"; push( @installer::globals::logfileinfo, $infoline); my $output = `$systemcall 2>&1`; if ($?) @@ -436,7 +439,7 @@ sub create_package $systemcall = "codesign --force --verbose --options=runtime --identifier='$ENV{MACOSX_BUNDLE_IDENTIFIER}.$sdkbinary' --sign '$ENV{MACOSX_CODESIGNING_IDENTITY}' --entitlements $ENV{BUILDDIR}/hardened_runtime.xcent $sdkbindir/$sdkbinary > /tmp/codesign_losdk_$sdkbinary.log 2>&1"; print "... $systemcall ...\n"; my $returnvalue = system($systemcall); - $infoline = "Systemcall: $systemcall\n"; + my $infoline = "Systemcall: $systemcall\n"; push( @installer::globals::logfileinfo, $infoline); if ($returnvalue) @@ -612,12 +615,10 @@ sub create_simple_package if ($copyreturn) { $infoline = "Copy: $source to $destination\n"; - $returnvalue = 1; } else { $infoline = "ERROR: Could not copy $source to $destination $!\n"; - $returnvalue = 0; } push(@installer::globals::logfileinfo, $infoline); diff --git a/solenv/bin/modules/installer/systemactions.pm b/solenv/bin/modules/installer/systemactions.pm index a33c5a957b06..c036c117ca04 100644 --- a/solenv/bin/modules/installer/systemactions.pm +++ b/solenv/bin/modules/installer/systemactions.pm @@ -18,6 +18,9 @@ package installer::systemactions; +use strict; +use warnings; + use Cwd; use File::Copy; use installer::converter; @@ -198,7 +201,7 @@ sub create_directories } } - $infoline = "create_directories: Using $path for $newdirectory !\n"; + my $infoline = "create_directories: Using $path for $newdirectory !\n"; push( @installer::globals::logfileinfo, $infoline); if ($newdirectory eq "unzip" ) # special handling for common directory @@ -618,7 +621,7 @@ sub copy_directory_with_fileextension $sourcedir =~ s/\Q$installer::globals::separator\E\s*$//; $destdir =~ s/\Q$installer::globals::separator\E\s*$//; - $infoline = "\n"; + my $infoline = "\n"; push(@installer::globals::logfileinfo, $infoline); $infoline = "Copying files with extension $extension from directory $sourcedir to directory $destdir\n"; push(@installer::globals::logfileinfo, $infoline); @@ -708,7 +711,7 @@ sub find_file_with_file_extension push(@installer::globals::logfileinfo, $infoline); opendir(DIR, $dir); - @sourcefiles = sort readdir(DIR); + my @sourcefiles = sort readdir(DIR); closedir(DIR); my $onefile; @@ -762,13 +765,13 @@ sub make_numbered_dir if ( move($olddir, $newdir) ) { - $infoline = "\nMoved directory from $olddir to $newdir\n"; + my $infoline = "\nMoved directory from $olddir to $newdir\n"; push(@installer::globals::logfileinfo, $infoline); $returndir = $newdir; } else { - $infoline = "\nATTENTION: Could not move directory from $olddir to $newdir, \"make_numbered_dir\"\n"; + my $infoline = "\nATTENTION: Could not move directory from $olddir to $newdir, \"make_numbered_dir\"\n"; push(@installer::globals::logfileinfo, $infoline); $returndir = $olddir; } @@ -1033,7 +1036,7 @@ sub try_to_create_directory if ($returnvalue) { $created_directory = 1; - $infoline = "\nCreated directory: $directory\n"; + my $infoline = "\nCreated directory: $directory\n"; push(@installer::globals::logfileinfo, $infoline); chmod 0775, $directory; diff --git a/solenv/bin/modules/installer/windows/admin.pm b/solenv/bin/modules/installer/windows/admin.pm index 27e4ba7c3232..3bc2330d43bc 100644 --- a/solenv/bin/modules/installer/windows/admin.pm +++ b/solenv/bin/modules/installer/windows/admin.pm @@ -18,6 +18,9 @@ package installer::windows::admin; +use strict; +use warnings; + use File::Copy; use installer::exiter; use installer::files; diff --git a/solenv/bin/modules/installer/windows/assembly.pm b/solenv/bin/modules/installer/windows/assembly.pm index 38c04a799627..d7014144ce9a 100644 --- a/solenv/bin/modules/installer/windows/assembly.pm +++ b/solenv/bin/modules/installer/windows/assembly.pm @@ -18,6 +18,9 @@ package installer::windows::assembly; +use strict; +use warnings; + use installer::files; use installer::globals; use installer::worker; diff --git a/solenv/bin/modules/installer/windows/binary.pm b/solenv/bin/modules/installer/windows/binary.pm index b6f979ce03dd..2c63b7bdf799 100644 --- a/solenv/bin/modules/installer/windows/binary.pm +++ b/solenv/bin/modules/installer/windows/binary.pm @@ -18,6 +18,9 @@ package installer::windows::binary; +use strict; +use warnings; + use installer::files; use installer::globals; diff --git a/solenv/bin/modules/installer/windows/component.pm b/solenv/bin/modules/installer/windows/component.pm index 9751caabd4ce..c4dde4ec33d1 100644 --- a/solenv/bin/modules/installer/windows/component.pm +++ b/solenv/bin/modules/installer/windows/component.pm @@ -18,6 +18,9 @@ package installer::windows::component; +use strict; +use warnings; + use installer::exiter; use installer::files; use installer::globals; diff --git a/solenv/bin/modules/installer/windows/createfolder.pm b/solenv/bin/modules/installer/windows/createfolder.pm index a5c534c43637..4669ddd4acf4 100644 --- a/solenv/bin/modules/installer/windows/createfolder.pm +++ b/solenv/bin/modules/installer/windows/createfolder.pm @@ -18,6 +18,9 @@ package installer::windows::createfolder; +use strict; +use warnings; + use installer::exiter; use installer::files; use installer::globals; diff --git a/solenv/bin/modules/installer/windows/directory.pm b/solenv/bin/modules/installer/windows/directory.pm index 829687e8b65c..659037652055 100644 --- a/solenv/bin/modules/installer/windows/directory.pm +++ b/solenv/bin/modules/installer/windows/directory.pm @@ -18,6 +18,9 @@ package installer::windows::directory; +use strict; +use warnings; + use installer::exiter; use installer::files; use installer::globals; @@ -486,7 +489,7 @@ sub add_root_directories if ( $allvariableshashref->{'NOVERSIONINDIRNAME'} ) { $productkey = $productname; - $realproductkey = $realproductname; + $realproductkey = $productname; } if ( $allvariableshashref->{'NOSPACEINDIRECTORYNAME'} ) { diff --git a/solenv/bin/modules/installer/windows/feature.pm b/solenv/bin/modules/installer/windows/feature.pm index 356220829893..6dff3dead168 100644 --- a/solenv/bin/modules/installer/windows/feature.pm +++ b/solenv/bin/modules/installer/windows/feature.pm @@ -18,6 +18,9 @@ package installer::windows::feature; +use strict; +use warnings; + use installer::exiter; use installer::files; use installer::globals; diff --git a/solenv/bin/modules/installer/windows/featurecomponent.pm b/solenv/bin/modules/installer/windows/featurecomponent.pm index 26ab9281c2d6..65ddfff22c71 100644 --- a/solenv/bin/modules/installer/windows/featurecomponent.pm +++ b/solenv/bin/modules/installer/windows/featurecomponent.pm @@ -18,6 +18,9 @@ package installer::windows::featurecomponent; +use strict; +use warnings; + use installer::converter; use installer::exiter; use installer::files; @@ -64,7 +67,7 @@ sub create_featurecomponent_table_from_files_collector installer::windows::idtglobal::shorten_feature_gid(\$featurecomponent{'Feature'}); - $oneline = "$featurecomponent{'Feature'}\t$featurecomponent{'Component'}\n"; + my $oneline = "$featurecomponent{'Feature'}\t$featurecomponent{'Component'}\n"; # control of uniqueness @@ -110,7 +113,7 @@ sub create_featurecomponent_table_from_registry_collector installer::windows::idtglobal::shorten_feature_gid(\$featurecomponent{'Feature'}); - $oneline = "$featurecomponent{'Feature'}\t$featurecomponent{'Component'}\n"; + my $oneline = "$featurecomponent{'Feature'}\t$featurecomponent{'Component'}\n"; # control of uniqueness diff --git a/solenv/bin/modules/installer/windows/file.pm b/solenv/bin/modules/installer/windows/file.pm index 100002f5ad37..9c5e76c52643 100644 --- a/solenv/bin/modules/installer/windows/file.pm +++ b/solenv/bin/modules/installer/windows/file.pm @@ -18,6 +18,9 @@ package installer::windows::file; +use strict; +use warnings; + use Digest::MD5; use installer::exiter; use installer::files; @@ -380,7 +383,7 @@ sub generate_unique_filename_for_filetable { $uniquefilename = $uniquefilenamehashref->{"$component/$uniquefilename"}; # syntax of $value: ($uniquename;$shortname) if ( $uniquefilename =~ /^\s*(.*?)\;\s*(.*?)\s*$/ ) { $uniquefilename = $1; } - $lcuniquefilename = lc($uniquefilename); + my $lcuniquefilename = lc($uniquefilename); $installer::globals::alluniquefilenames{$uniquefilename} = 1; $installer::globals::alllcuniquefilenames{$lcuniquefilename} = 1; return $uniquefilename; @@ -390,7 +393,7 @@ sub generate_unique_filename_for_filetable # If we have a FTK mapping for this component/file, use it. $installer::globals::savedmapping{"$component/$uniquefilename"} =~ m/^(.*);/; $uniquefilename = $1; - $lcuniquefilename = lc($uniquefilename); + my $lcuniquefilename = lc($uniquefilename); $installer::globals::alluniquefilenames{$uniquefilename} = 1; $installer::globals::alllcuniquefilenames{$lcuniquefilename} = 1; return $uniquefilename; @@ -540,6 +543,7 @@ sub get_fileversion { open (EXE, "<$onefile->{'sourcepath'}"); binmode EXE; + my $exedata; {local $/ = undef; $exedata = <EXE>;} close EXE; @@ -993,7 +997,7 @@ sub create_files_table } # putting content from %allfilecomponents to $allfilecomponentsref for later usage - foreach $localkey (keys %allfilecomponents ) { push( @{$allfilecomponentsref}, $localkey); } + foreach my $localkey (keys %allfilecomponents ) { push( @{$allfilecomponentsref}, $localkey); } my $filetablename = $basedir . $installer::globals::separator . "File.idt"; installer::files::save_file($filetablename ,\@filetable); diff --git a/solenv/bin/modules/installer/windows/font.pm b/solenv/bin/modules/installer/windows/font.pm index f1b6788705e3..929d188e795f 100644 --- a/solenv/bin/modules/installer/windows/font.pm +++ b/solenv/bin/modules/installer/windows/font.pm @@ -18,6 +18,9 @@ package installer::windows::font; +use strict; +use warnings; + use installer::files; use installer::globals; use installer::windows::idtglobal; diff --git a/solenv/bin/modules/installer/windows/icon.pm b/solenv/bin/modules/installer/windows/icon.pm index 10cd24e467bd..41faae012ea9 100644 --- a/solenv/bin/modules/installer/windows/icon.pm +++ b/solenv/bin/modules/installer/windows/icon.pm @@ -18,6 +18,9 @@ package installer::windows::icon; +use strict; +use warnings; + use installer::files; use installer::globals; use installer::pathanalyzer; diff --git a/solenv/bin/modules/installer/windows/idtglobal.pm b/solenv/bin/modules/installer/windows/idtglobal.pm index 26c8e951c9c9..f0e59c29efbf 100644 --- a/solenv/bin/modules/installer/windows/idtglobal.pm +++ b/solenv/bin/modules/installer/windows/idtglobal.pm @@ -18,6 +18,9 @@ package installer::windows::idtglobal; +use strict; +use warnings; + use Cwd; use installer::converter; use installer::exiter; @@ -1159,7 +1162,7 @@ sub connect_custom_action_to_control $line =~ s/\s*$//g; - $infoline = "Added line \"$line\" into table $tablename\n"; + my $infoline = "Added line \"$line\" into table $tablename\n"; push(@installer::globals::logfileinfo, $infoline); } @@ -1178,7 +1181,7 @@ sub connect_condition_to_control $line =~ s/\s*$//g; - $infoline = "Added line \"$line\" into table $tablename\n"; + my $infoline = "Added line \"$line\" into table $tablename\n"; push(@installer::globals::logfileinfo, $infoline); } @@ -1277,10 +1280,10 @@ sub include_subdirname_into_directory_table my $newparent = "INSTALLLOCATION"; my $newname = $name . "\:" . $subdir; my $newline = - $line = "$newuniquename\t$newparent\t$newname\n"; + my $line = "$newuniquename\t$newparent\t$newname\n"; push(@{$directorytable}, $line); installer::remover::remove_leading_and_ending_whitespaces(\$line); - $infoline = "Added $line into directory table $directorytablename\n"; + my $infoline = "Added $line into directory table $directorytablename\n"; push(@installer::globals::logfileinfo, $infoline); $includedline = 1; @@ -1321,7 +1324,7 @@ sub include_subdir_into_componenttable installer::remover::remove_leading_and_ending_whitespaces(\$oldvalue); installer::remover::remove_leading_and_ending_whitespaces(\$newvalue); - $infoline = "Change in Component table: From \"$oldvalue\" to \"$newvalue\"\n"; + my $infoline = "Change in Component table: From \"$oldvalue\" to \"$newvalue\"\n"; push(@installer::globals::logfileinfo, $infoline); $changeddirectory = 1; @@ -1722,7 +1725,7 @@ sub addcustomactions } else { - installer::exiter::exit_program("ERROR: gid: $gid, key: $key ! Unknown Windows CustomAction table: $assignmenthashref->{'parameter1'} ! Currently supported: InstallUISequence, InstallESequence, ControlEvent, ControlCondition", "addcustomactions"); + installer::exiter::exit_program("ERROR: gid: $gid, key: $key ! Unknown Windows CustomAction table: $assignment->{'parameter1'} ! Currently supported: InstallUISequence, InstallESequence, ControlEvent, ControlCondition", "addcustomactions"); } } } @@ -1826,7 +1829,7 @@ sub setbidiattributes # Saving the file installer::files::save_file($dialogfilename, $dialogfile); - $infoline = "Set bidi support in idt file \"$dialogfilename\" for language $onelanguage\n"; + my $infoline = "Set bidi support in idt file \"$dialogfilename\" for language $onelanguage\n"; push(@installer::globals::logfileinfo, $infoline); installer::files::save_file($controlfilename, $controlfile); diff --git a/solenv/bin/modules/installer/windows/inifile.pm b/solenv/bin/modules/installer/windows/inifile.pm index b26e41836d1f..a00e4758ef2f 100644 --- a/solenv/bin/modules/installer/windows/inifile.pm +++ b/solenv/bin/modules/installer/windows/inifile.pm @@ -18,6 +18,9 @@ package installer::windows::inifile; +use strict; +use warnings; + use installer::exiter; use installer::files; use installer::globals; @@ -51,7 +54,7 @@ sub file_is_part_of_product for ( my $i = 0; $i <= $#{$filesref}; $i++ ) { - $onefile = ${$filesref}[$i]; + my $onefile = ${$filesref}[$i]; my $filegid = $onefile->{'gid'}; if ( $filegid eq $profilegid ) diff --git a/solenv/bin/modules/installer/windows/language.pm b/solenv/bin/modules/installer/windows/language.pm index 2a5be5b64e76..4a6f78721a98 100644 --- a/solenv/bin/modules/installer/windows/language.pm +++ b/solenv/bin/modules/installer/windows/language.pm @@ -18,6 +18,9 @@ package installer::windows::language; +use strict; +use warnings; + use installer::exiter; #################################################### diff --git a/solenv/bin/modules/installer/windows/media.pm b/solenv/bin/modules/installer/windows/media.pm index e73013ee055d..5b5147b46e3c 100644 --- a/solenv/bin/modules/installer/windows/media.pm +++ b/solenv/bin/modules/installer/windows/media.pm @@ -18,6 +18,9 @@ package installer::windows::media; +use strict; +use warnings; + use installer::exiter; use installer::files; use installer::globals; diff --git a/solenv/bin/modules/installer/windows/mergemodule.pm b/solenv/bin/modules/installer/windows/mergemodule.pm index defd59588c95..f737c2b905c6 100644 --- a/solenv/bin/modules/installer/windows/mergemodule.pm +++ b/solenv/bin/modules/installer/windows/mergemodule.pm @@ -18,6 +18,9 @@ package installer::windows::mergemodule; +use strict; +use warnings; + use Cwd; use Digest::MD5; use installer::converter; @@ -557,7 +560,7 @@ sub merge_mergemodules_into_msi_database my $localworkdir = $workdir; $localmsifilename =~ s/\//\\\\/g; $localworkdir =~ s/\//\\\\/g; - foreach $table (split / /, $workingtables . ' ' . $executetables) { + foreach my $table (split / /, $workingtables . ' ' . $executetables) { $systemcall = $msidb . " -d " . $localmsifilename . " -f " . $localworkdir . " -i " . $table; my $retval = system($systemcall); $infoline = "Systemcall returned $retval: $systemcall\n"; @@ -766,7 +769,7 @@ sub get_source { if ( exists($mediafile->{$line}->{'Source'}) ) { - $diskprompt = $mediafile->{$line}->{'Source'}; + $source = $mediafile->{$line}->{'Source'}; last; } } @@ -1171,7 +1174,7 @@ sub change_file_table # For performance reasons creating a hash with file names and rows # The content of File.idt is changed after every merge -> content cannot be saved in global hash - $merge_filetablehashref = analyze_filetable_file($filecontent, $idtfilename); + my $merge_filetablehashref = analyze_filetable_file($filecontent, $idtfilename); my $attributes = "16384"; # Always @@ -1304,6 +1307,7 @@ sub collect_directories sub collect_feature { + my ($workdir) = @_; my $idtfilename = "Feature.idt"; if ( ! -f $idtfilename ) { installer::exiter::exit_program("ERROR: Could not find file \"$idtfilename\" in \"$workdir\" !", "collect_feature"); } my $filecontent = installer::files::read_file($idtfilename); @@ -1346,7 +1350,7 @@ sub change_featurecomponent_table if ( ! $installer::globals::mergefeaturecollected ) { - collect_feature(); # putting content into hash %installer::globals::merge_allfeature_hash + collect_feature($workdir); # putting content into hash %installer::globals::merge_allfeature_hash $installer::globals::mergefeaturecollected = 1; } @@ -1521,7 +1525,7 @@ sub change_msiassembly_table if ( ! $installer::globals::mergefeaturecollected ) { - collect_feature(); # putting content into hash %installer::globals::merge_allfeature_hash + collect_feature($workdir); # putting content into hash %installer::globals::merge_allfeature_hash $installer::globals::mergefeaturecollected = 1; } diff --git a/solenv/bin/modules/installer/windows/msiglobal.pm b/solenv/bin/modules/installer/windows/msiglobal.pm index f830c6eb0598..6d4282709ab9 100644 --- a/solenv/bin/modules/installer/windows/msiglobal.pm +++ b/solenv/bin/modules/installer/windows/msiglobal.pm @@ -18,6 +18,9 @@ package installer::windows::msiglobal; +use strict; +use warnings; + use Cwd; use Digest::MD5; use installer::converter; @@ -592,7 +595,7 @@ sub get_security_for_sis sub write_summary_into_msi_database { - my ($msifilename, $language, $languagefile, $allvariableshashref) = @_; + my ($msifilename, $language, $allvariableshashref) = @_; # -g : required msi version # -c : codepage @@ -805,11 +808,11 @@ sub create_transforms } } - $systemcall = "TEMP=$ENV{'TMPDIR'} $cscript \"$wilangid\" $basedbname Package $templatevalue"; + my $systemcall = "TEMP=$ENV{'TMPDIR'} $cscript \"$wilangid\" $basedbname Package $templatevalue"; - $returnvalue = system($systemcall); + my $returnvalue = system($systemcall); - $infoline = "Systemcall: $systemcall\n"; + my $infoline = "Systemcall: $systemcall\n"; push( @installer::globals::logfileinfo, $infoline); if ($returnvalue) @@ -1078,7 +1081,7 @@ sub prepare_64bit_database if ( -f $fullfilename ) { my $saving_required = 0; - $filecontent = installer::files::read_file($fullfilename); + my $filecontent = installer::files::read_file($fullfilename); for ( my $i = 3; $i <= $#{$filecontent}; $i++ ) # ignoring the first three lines { @@ -1363,8 +1366,8 @@ sub set_global_code_variables # UpgradeCode can take english as default, if not defined in specified language - $searchstring = "UPGRADECODE"; # searching in the codes.txt file - $codeblock = installer::windows::idtglobal::get_language_block_from_language_file($searchstring, $codefile); + my $searchstring = "UPGRADECODE"; # searching in the codes.txt file + my $codeblock = installer::windows::idtglobal::get_language_block_from_language_file($searchstring, $codefile); $installer::globals::upgradecode = installer::windows::idtglobal::get_language_string_from_language_block($codeblock, $onelanguage, ""); if ( $installer::globals::upgradecode eq "" ) { installer::exiter::exit_program("ERROR: UpgradeCode not defined in $installer::globals::codefilename !", "set_global_code_variables"); } diff --git a/solenv/bin/modules/installer/windows/msishortcutproperty.pm b/solenv/bin/modules/installer/windows/msishortcutproperty.pm index 5436f2565cf2..91729f8d3f35 100644 --- a/solenv/bin/modules/installer/windows/msishortcutproperty.pm +++ b/solenv/bin/modules/installer/windows/msishortcutproperty.pm @@ -18,6 +18,9 @@ package installer::windows::msishortcutproperty; +use strict; +use warnings; + use installer::exiter; use installer::files; use installer::globals; diff --git a/solenv/bin/modules/installer/windows/property.pm b/solenv/bin/modules/installer/windows/property.pm index a385e59a8c27..60300e49ff58 100644 --- a/solenv/bin/modules/installer/windows/property.pm +++ b/solenv/bin/modules/installer/windows/property.pm @@ -18,6 +18,9 @@ package installer::windows::property; +use strict; +use warnings; + use installer::exiter; use installer::files; use installer::globals; diff --git a/solenv/bin/modules/installer/windows/registry.pm b/solenv/bin/modules/installer/windows/registry.pm index f7136b887023..609116afc76c 100644 --- a/solenv/bin/modules/installer/windows/registry.pm +++ b/solenv/bin/modules/installer/windows/registry.pm @@ -18,6 +18,9 @@ package installer::windows::registry; +use strict; +use warnings; + use installer::files; use installer::globals; use installer::worker; diff --git a/solenv/bin/modules/installer/windows/removefile.pm b/solenv/bin/modules/installer/windows/removefile.pm index 21197f694b91..a4d953e64ce4 100644 --- a/solenv/bin/modules/installer/windows/removefile.pm +++ b/solenv/bin/modules/installer/windows/removefile.pm @@ -18,6 +18,9 @@ package installer::windows::removefile; +use strict; +use warnings; + use installer::files; use installer::globals; use installer::windows::idtglobal; diff --git a/solenv/bin/modules/installer/windows/shortcut.pm b/solenv/bin/modules/installer/windows/shortcut.pm index c3469085c244..0ba801b51f59 100644 --- a/solenv/bin/modules/installer/windows/shortcut.pm +++ b/solenv/bin/modules/installer/windows/shortcut.pm @@ -18,6 +18,9 @@ package installer::windows::shortcut; +use strict; +use warnings; + use installer::exiter; use installer::files; use installer::globals; @@ -113,9 +116,12 @@ sub get_shortcut_component my $shortcut_fileid = $shortcut->{'FileID'}; my $absolute_filename = 0; - if ( $shortcut->{'Styles'} ) { $styles = $shortcut->{'Styles'}; } - if ( $styles =~ /\bABSOLUTE_FILENAME\b/ ) { $absolute_filename = 1; } # FileID contains an absolute filename - if ( $styles =~ /\bUSE_HELPER_FILENAME\b/ ) { $absolute_filename = 1; } # ComponentIDFile contains id of a helper file + if ( $shortcut->{'Styles'} ) + { + my $styles = $shortcut->{'Styles'}; + if ( $styles =~ /\bABSOLUTE_FILENAME\b/ ) { $absolute_filename = 1; } # FileID contains an absolute filename + if ( $styles =~ /\bUSE_HELPER_FILENAME\b/ ) { $absolute_filename = 1; } # ComponentIDFile contains id of a helper file + } # if the FileID contains an absolute filename, therefore the entry for "ComponentIDFile" has to be used. if ( $absolute_filename ) { $shortcut_fileid = $shortcut->{'ComponentIDFile'}; } @@ -473,7 +479,7 @@ sub get_folderitem_icon installer::exiter::exit_program("ERROR: Did not find FileID $iconfilegid in file collection", "get_folderitem_icon"); } - $iconfile = $onefile->{'Name'}; + my $iconfile = $onefile->{'Name'}; # collecting all icon files to copy them into the icon directory diff --git a/solenv/bin/modules/installer/windows/strip.pm b/solenv/bin/modules/installer/windows/strip.pm index d7f95499deb4..0a59be7891e3 100644 --- a/solenv/bin/modules/installer/windows/strip.pm +++ b/solenv/bin/modules/installer/windows/strip.pm @@ -18,6 +18,9 @@ package installer::windows::strip; +use strict; +use warnings; + use File::Temp qw(tmpnam); use installer::converter; use installer::globals; @@ -118,7 +121,7 @@ sub strip_binaries my $shortfilename = $sourcefilename; installer::pathanalyzer::make_absolute_filename_to_relative_filename(\$shortfilename); - $infoline = "Strip: $shortfilename\n"; + my $infoline = "Strip: $shortfilename\n"; push( @installer::globals::logfileinfo, $infoline); # copy file into directory for stripped libraries diff --git a/solenv/bin/modules/installer/windows/update.pm b/solenv/bin/modules/installer/windows/update.pm index 45c47ed7ab0d..ad89d4065b14 100644 --- a/solenv/bin/modules/installer/windows/update.pm +++ b/solenv/bin/modules/installer/windows/update.pm @@ -18,6 +18,9 @@ package installer::windows::update; +use strict; +use warnings; + use installer::converter; use installer::exiter; use installer::files; @@ -184,7 +187,7 @@ sub read_all_tables_from_msidatabase my $filecontent = installer::files::read_file($longonefilename); my $idtcontent = analyze_idt_file($filecontent); if ($onefilename eq "Directory.idt") { - collect_directories($filecontent); + collect_directories($filecontent, $longonefilename); } my $key = $onefilename; $key =~ s/\.idt\s*$//; @@ -415,7 +418,7 @@ sub readdatabase sub collect_directories { - my ($filecontent) = @_; + my ($filecontent, $idtfilename) = @_; for ( my $i = 0; $i <= $#{$filecontent}; $i++ ) { diff --git a/solenv/bin/modules/installer/windows/upgrade.pm b/solenv/bin/modules/installer/windows/upgrade.pm index 54838212404c..6f198316d825 100644 --- a/solenv/bin/modules/installer/windows/upgrade.pm +++ b/solenv/bin/modules/installer/windows/upgrade.pm @@ -18,6 +18,9 @@ package installer::windows::upgrade; +use strict; +use warnings; + use installer::exiter; use installer::files; use installer::globals; diff --git a/solenv/bin/modules/installer/worker.pm b/solenv/bin/modules/installer/worker.pm index fb2969f77e1c..191ce01eeb16 100644 --- a/solenv/bin/modules/installer/worker.pm +++ b/solenv/bin/modules/installer/worker.pm @@ -18,6 +18,9 @@ package installer::worker; +use strict; +use warnings; + use Cwd; use File::Copy; use File::stat; @@ -548,7 +551,7 @@ sub add_variables_from_inc_to_hashref { $includefilename =~ s/^\s*//; $includefilename =~ s/\s*$//; - $includefilenameref = $ENV{'SRCDIR'} . "/" . $includefilename; + my $includefilenameref = $ENV{'SRCDIR'} . "/" . $includefilename; if ( ! -f $includefilenameref ) { installer::exiter::exit_program("Include file $includefilename ($includefilenameref) not found!\nADD_INCLUDE_FILES = $allvariables->{'ADD_INCLUDE_FILES'}", "add_variables_from_inc_to_hashref"); } $infoline = "Including inc file: $includefilenameref \n"; @@ -590,7 +593,7 @@ sub collect_all_files_from_includepaths for ( my $i = 0; $i <= $#{$patharrayref}; $i++ ) { - $includepath = ${$patharrayref}[$i]; + my $includepath = ${$patharrayref}[$i]; installer::remover::remove_leading_and_ending_whitespaces(\$includepath); if ( ! -d $includepath ) @@ -913,7 +916,7 @@ sub collectpackagemaps # Create a tar gz file with all package maps my $tarfilename = $subdirname . ".tar"; my $targzname = $tarfilename . ".gz"; - $systemcall = "cd $pkgmapdir; tar -cf - $subdirname | $installer::globals::packertool > $targzname"; + my $systemcall = "cd $pkgmapdir; tar -cf - $subdirname | $installer::globals::packertool > $targzname"; installer::systemactions::make_systemcall($systemcall); installer::systemactions::remove_complete_directory($pkgmapsubdir, 1); } diff --git a/solenv/bin/modules/installer/ziplist.pm b/solenv/bin/modules/installer/ziplist.pm index b76c62fc77d9..ca94f764f9b1 100644 --- a/solenv/bin/modules/installer/ziplist.pm +++ b/solenv/bin/modules/installer/ziplist.pm @@ -18,6 +18,9 @@ package installer::ziplist; +use strict; +use warnings; + use base 'Exporter'; use File::Spec::Functions qw(rel2abs); @@ -613,7 +616,7 @@ sub replace_languages_in_paths my $language = ${$languagesref}[$j]; $line =~ s/\$\(LANG\)/$language/g; push(@patharray ,$line); - $newdir = $line; + my $newdir = $line; $line = $originalline; installer::remover::remove_leading_and_ending_whitespaces(\$newline); @@ -669,8 +672,6 @@ sub list_all_files_from_include_path } push( @installer::globals::logfileinfo, "\n"); - - return \@filesarray; } #####################################################