diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-08-10 15:52:22 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-08-10 16:03:28 +0200 |
commit | 6dcb3d4ef46312729bb6f16c473b433474863f68 (patch) | |
tree | 58f2f577d9883e32b886bbe4086f83d0bb16fc81 /solenv | |
parent | f2f3703740f65b76e891ecc3591d7e60d5b7caef (diff) |
Related fdo#51252: No more prereg, no more unopkg sync
Now that 5c47e5f63a79a9e72ec4a100786b1bbf65137ed4 "fdo#51252 Disable copying
share/prereg/bundled to avoid startup crashes" removed the use of share/prereg,
there is no longer need to generate it in the first place (by calling "unopkg
sync" at build or installation time), and so no need for the "unopkg sync" sub-
command, either. This also allows to simplify some of the jvmfwk code that was
only there so that "unopkg sync" (which can require a JVM) can work in "hostile"
environments (during build and installation).
Change-Id: I52657384f4561bf27948ba4f0f88f4498e90987f
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/bin/modules/installer/epmfile.pm | 41 | ||||
-rw-r--r-- | solenv/bin/modules/installer/globals.pm | 2 | ||||
-rwxr-xr-x | solenv/bin/modules/installer/simplepackage.pm | 122 | ||||
-rw-r--r-- | solenv/bin/modules/installer/systemactions.pm | 47 | ||||
-rw-r--r-- | solenv/bin/modules/installer/windows/admin.pm | 75 |
5 files changed, 1 insertions, 286 deletions
diff --git a/solenv/bin/modules/installer/epmfile.pm b/solenv/bin/modules/installer/epmfile.pm index 388f9cc82d84..3b19d9cd9581 100644 --- a/solenv/bin/modules/installer/epmfile.pm +++ b/solenv/bin/modules/installer/epmfile.pm @@ -1437,46 +1437,6 @@ sub make_prototypefile_relocatable } } - -######################################################################### -# In scp the flag VOLATEFILE can be used. This shall lead to style "v" -# in Solaris prototype file. This is not supported by epm and has -# therefore to be included in prototypefile, not in epm list file. -######################################################################### - -sub set_volatilefile_into_prototypefile -{ - my ($prototypefile, $filesref) = @_; - - for ( my $i = 0; $i <= $#{$filesref}; $i++ ) - { - my $onefile = ${$filesref}[$i]; - - my $styles = ""; - if ( $onefile->{'Styles'} ) { $styles = $onefile->{'Styles'}; } - - if ( $styles =~ /\bVOLATILEFILE\b/ ) - { - my $sourcepath = $onefile->{'sourcepath'}; - - for ( my $j = 0; $j <= $#{$prototypefile}; $j++ ) - { - if (( ${$prototypefile}[$j] =~ /^\s*f\s+none\s+/ ) && ( ${$prototypefile}[$j] =~ /\=\Q$sourcepath\E\s+/ )) - { - my $oldline = ${$prototypefile}[$j]; - ${$prototypefile}[$j] =~ s/^\s*f/v/; - my $newline = ${$prototypefile}[$j]; - $oldline =~ s/\s*$//; - $newline =~ s/\s*$//; - my $infoline = "Volatile file: Changing content from \"$oldline\" to \"$newline\" .\n"; - push(@installer::globals::logfileinfo, $infoline); - last; - } - } - } - } -} - ######################################################################### # Replacing the variables in the Solaris patch shell scripts. # Taking care, that multiple slashes are not always removed. @@ -2066,7 +2026,6 @@ sub prepare_packages my $prototypefile = installer::files::read_file($prototypefilename); make_prototypefile_relocatable($prototypefile, $relocatablepath); - set_volatilefile_into_prototypefile($prototypefile, $filesref); my $classesstring = set_tab_into_datafile($prototypefile, $filesref); if ($classesstring) { diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm index 09b3b2d14f3a..7b5876f33eb8 100644 --- a/solenv/bin/modules/installer/globals.pm +++ b/solenv/bin/modules/installer/globals.pm @@ -456,7 +456,6 @@ BEGIN { $zippath = "zip"; # Has to be in the path: /usr/bin/zip $checksumfile = "so_checksum"; - $unopkgfile = "unopkg.exe"; $separator = "/"; $pathseparator = "\:"; $libextension = "\.dll"; @@ -472,7 +471,6 @@ BEGIN { $zippath = "zip"; # Has to be in the path: /usr/bin/zip $checksumfile = "so_checksum"; - $unopkgfile = "unopkg"; $separator = "/"; $pathseparator = "\:"; if ( $plat =~ /darwin/i ) diff --git a/solenv/bin/modules/installer/simplepackage.pm b/solenv/bin/modules/installer/simplepackage.pm index 5f477a5c8924..d15ad28a2912 100755 --- a/solenv/bin/modules/installer/simplepackage.pm +++ b/solenv/bin/modules/installer/simplepackage.pm @@ -60,119 +60,6 @@ sub check_simple_packager_project } } -#################################################### -# Detecting the directory with extensions -#################################################### - -sub get_extensions_dir -{ - my ( $subfolderdir ) = @_; - - my $extensiondir = $subfolderdir . $installer::globals::separator; - if ( $installer::globals::officedirhostname ne "" ) { $extensiondir = $extensiondir . $installer::globals::officedirhostname . $installer::globals::separator; } - my $extensionsdir = $extensiondir . "share" . $installer::globals::separator . "extensions"; - my $preregdir = $extensiondir . "share" . $installer::globals::separator . "prereg" . $installer::globals::separator . "bundled"; - - return ( $extensionsdir, $preregdir ); -} - -#################################################### -# Registering extensions -#################################################### - -sub register_extensions -{ - my ($officedir, $languagestringref, $preregdir) = @_; - - my $infoline = ""; - - if ( $preregdir eq "" ) - { - $infoline = "ERROR: Failed to determine directory \"prereg\" for extension registration! Please check your installation set.\n"; - push( @installer::globals::logfileinfo, $infoline); - installer::exiter::exit_program($infoline, "register_extensions"); - } - - my $programdir = $officedir . $installer::globals::separator; - if ( $installer::globals::officedirhostname ne "" ) { $programdir = $programdir . $installer::globals::officedirhostname . $installer::globals::separator; } - $programdir = $programdir . "program"; - - my $from = cwd(); - chdir($programdir); - - my $unopkgfile = $installer::globals::unopkgfile; - - my $unopkgexists = 1; - if (( $installer::globals::languagepack ) && ( ! -f $unopkgfile )) - { - $unopkgexists = 0; - $infoline = "Language packs do not contain unopkg!\n"; - push( @installer::globals::logfileinfo, $infoline); - } - - if (( $installer::globals::helppack ) && ( ! -f $unopkgfile )) - { - $unopkgexists = 0; - $infoline = "Help packs do not contain unopkg!\n"; - push( @installer::globals::logfileinfo, $infoline); - } - - if ( ! -f $unopkgfile ) - { - $unopkgexists = 0; - $infoline = "Info: File $unopkgfile does not exist! Extensions cannot be registered.\n"; - push( @installer::globals::logfileinfo, $infoline); - } - - if ( $unopkgexists ) - { - my $currentdir = cwd(); - print "... current dir: $currentdir ...\n"; - $infoline = "Current dir: $currentdir\n"; - push( @installer::globals::logfileinfo, $infoline); - - if ( ! -f $unopkgfile ) { installer::exiter::exit_program("ERROR: $unopkgfile not found!", "register_extensions"); } - - my $systemcall = "JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1 " . $unopkgfile . " sync --verbose" . " -env:UNO_JAVA_JFW_ENV_JREHOME=true 2\>\&1 |"; - - print "... $systemcall ...\n"; - - $infoline = "Systemcall: $systemcall\n"; - push( @installer::globals::logfileinfo, $infoline); - - my @unopkgoutput = (); - - open (UNOPKG, $systemcall); - while (<UNOPKG>) - { - my $lastline = $_; - push(@unopkgoutput, $lastline); - } - close (UNOPKG); - - my $returnvalue = $?; # $? contains the return value of the systemcall - - if ($returnvalue) - { - # Writing content of @unopkgoutput only in the error case into the log file. Sometimes it - # contains strings like "Error" even in the case of success. This causes a packaging error - # when the log file is analyzed at the end, even if there is no real error. - for ( my $j = 0; $j <= $#unopkgoutput; $j++ ) { push( @installer::globals::logfileinfo, "$unopkgoutput[$j]"); } - - $infoline = "ERROR: Could not execute \"$systemcall\"!\nExitcode: '$returnvalue'\n"; - push( @installer::globals::logfileinfo, $infoline); - installer::exiter::exit_program("ERROR: $systemcall failed!", "register_extensions"); - } - else - { - $infoline = "Success: Executed \"$systemcall\" successfully!\n"; - push( @installer::globals::logfileinfo, $infoline); - } - } - - chdir($from); -} - ######################################################################## # Getting the translation file for the Mac Language Pack installer ######################################################################## @@ -784,15 +671,6 @@ sub create_simple_package installer::logger::print_message( "... removing superfluous directories ...\n" ); installer::logger::include_header_into_logfile("Removing superfluous directories:"); - my ( $extensionfolder, $preregdir ) = get_extensions_dir($subfolderdir); - installer::systemactions::remove_empty_dirs_in_folder($extensionfolder); - - # Registering the extensions - - installer::logger::print_message( "... registering extensions ...\n" ); - installer::logger::include_header_into_logfile("Registering extensions:"); - register_extensions($subfolderdir, $languagestringref, $preregdir); - if ( $installer::globals::compiler =~ /^unxmacx/ ) { installer::worker::put_scpactions_into_installset("$installdir/$packagename"); diff --git a/solenv/bin/modules/installer/systemactions.pm b/solenv/bin/modules/installer/systemactions.pm index 1ad4e4104eb4..713c520d0de2 100644 --- a/solenv/bin/modules/installer/systemactions.pm +++ b/solenv/bin/modules/installer/systemactions.pm @@ -1578,51 +1578,4 @@ sub read_full_directory { return } -############################################################## -# Removing all empty directories below a specified directory -############################################################## - -sub remove_empty_dirs_in_folder -{ - my ( $dir ) = @_; - - my @content = (); - my $infoline = ""; - - $dir =~ s/\Q$installer::globals::separator\E\s*$//; - - if ( -d $dir ) - { - opendir(DIR, $dir); - @content = readdir(DIR); - closedir(DIR); - - my $oneitem; - - foreach $oneitem (@content) - { - if ((!($oneitem eq ".")) && (!($oneitem eq ".."))) - { - my $item = $dir . $installer::globals::separator . $oneitem; - - if ( -d $item ) # recursive - { - remove_empty_dirs_in_folder($item); - } - } - } - - # try to remove empty directory - my $returnvalue = rmdir $dir; - - if ( $returnvalue ) - { - $infoline = "Successfully removed empty dir $dir\n"; - push(@installer::globals::logfileinfo, $infoline); - } - - } - -} - 1; diff --git a/solenv/bin/modules/installer/windows/admin.pm b/solenv/bin/modules/installer/windows/admin.pm index e088cafd88a4..e6e69b8f5509 100644 --- a/solenv/bin/modules/installer/windows/admin.pm +++ b/solenv/bin/modules/installer/windows/admin.pm @@ -440,8 +440,6 @@ sub copy_files_into_directory_structure { my ($fileorder, $filehash, $componenthash, $fullpathhash, $maxsequence, $unpackdir, $installdir, $dirhash) = @_; - my $unopkgfile = ""; - for ( my $i = 1; $i <= $maxsequence; $i++ ) { if ( exists($fileorder->{$i}) ) @@ -491,12 +489,8 @@ sub copy_files_into_directory_structure push(@installer::globals::logfileinfo, $infoline); installer::exiter::exit_program($infoline, "copy_files_into_directory_structure"); } - - if ( $destfile =~ /unopkg\.exe\s*$/ ) { $unopkgfile = $destfile; } } } - - return $unopkgfile; } @@ -750,66 +744,6 @@ sub write_sis_info } } -#################################################### -# Detecting the directory with extensions -#################################################### - -sub get_extensions_dir -{ - my ( $unopkgfile ) = @_; - - my $localbranddir = $unopkgfile; - installer::pathanalyzer::get_path_from_fullqualifiedname(\$localbranddir); # "program" dir in brand layer - installer::pathanalyzer::get_path_from_fullqualifiedname(\$localbranddir); # root dir in brand layer - $localbranddir =~ s/\Q$installer::globals::separator\E\s*$//; - my $extensiondir = $localbranddir . $installer::globals::separator . "share" . $installer::globals::separator . "extensions"; - - return $extensiondir; -} - -############################################################## -# Removing all empty directories below a specified directory -############################################################## - -sub remove_empty_dirs_in_folder -{ - my ( $dir, $firstrun ) = @_; - - if ( $firstrun ) - { - print "Removing superfluous directories\n"; - } - - my @content = (); - - $dir =~ s/\Q$installer::globals::separator\E\s*$//; - - if ( -d $dir ) - { - opendir(DIR, $dir); - @content = readdir(DIR); - closedir(DIR); - - my $oneitem; - - foreach $oneitem (@content) - { - if ((!($oneitem eq ".")) && (!($oneitem eq ".."))) - { - my $item = $dir . $installer::globals::separator . $oneitem; - - if ( -d $item ) # recursive - { - remove_empty_dirs_in_folder($item, 0); - } - } - } - - # try to remove empty directory - my $returnvalue = rmdir $dir; - } -} - #################################################################################### # Simulating an administrative installation #################################################################################### @@ -881,18 +815,11 @@ sub make_admin_install my $fullpathhash = create_directory_structure($dirhash, $targetdir); # Copying files - my $unopkgfile = copy_files_into_directory_structure($fileorder, $filehash, $componenthash, $fullpathhash, $maxsequence, $unpackdir, $installdir, $dirhash); + copy_files_into_directory_structure($fileorder, $filehash, $componenthash, $fullpathhash, $maxsequence, $unpackdir, $installdir, $dirhash); my $msidatabase = $targetdir . $installer::globals::separator . $databasefilename; installer::systemactions::copy_one_file($databasepath, $msidatabase); - if ( $unopkgfile ne "" ) - { - # Removing empty dirs in extension folder - my $extensionfolder = get_extensions_dir($unopkgfile); - if ( -d $extensionfolder ) { remove_empty_dirs_in_folder($extensionfolder, 1); } - } - # Editing registry table because of wrong Property value # my $registryfilename = $helperdir . $installer::globals::separator . "Registry.idt"; # my $componentfilename = $helperdir . $installer::globals::separator . "Component.idt"; |