diff options
author | Kurt Zenker <kz@openoffice.org> | 2010-08-18 12:00:05 +0200 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2010-08-18 12:00:05 +0200 |
commit | 0dfc03a267c37793f8360612b08c9a6102a43a35 (patch) | |
tree | d41e9c941eee1f954e6f95fc0debcecae0834c1b | |
parent | ce36f29b1f93dc4cd000289b7e23c47be65147b2 (diff) | |
parent | d2436b01297dc63d986bd1f2fd6c5902e01464fa (diff) |
CWS-TOOLING: integrate CWS jl154
-rw-r--r-- | scp2/source/ooo/common_brand.scp | 18 | ||||
-rw-r--r-- | scp2/source/ooo/profileitem_ooo.scp | 1 | ||||
-rwxr-xr-x | scp2/source/ooo/windowscustomaction_ooo.scp | 29 | ||||
-rw-r--r-- | solenv/bin/modules/installer/epmfile.pm | 48 | ||||
-rw-r--r-- | solenv/bin/modules/installer/simplepackage.pm | 144 | ||||
-rw-r--r--[-rwxr-xr-x] | solenv/bin/subsequenttests | 2 |
6 files changed, 126 insertions, 116 deletions
diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp index a7c1f2826381..5ed8c9739f9c 100644 --- a/scp2/source/ooo/common_brand.scp +++ b/scp2/source/ooo/common_brand.scp @@ -43,6 +43,8 @@ Module gid_Module_Root_Brand gid_Brand_Dir_Share_C05_Faq, gid_Brand_Dir_Share_Config, gid_Brand_Dir_Share_Extension, + gid_Brand_Dir_Share_Extensions, + gid_Brand_Dir_Share_Prereg, gid_Brand_Dir_Share_Uno_Packages, gid_Brand_Dir_Share_Uno_Packages_Cache, gid_Brand_Dir_Share_Registry, @@ -97,7 +99,8 @@ Module gid_Module_Root_Brand gid_Brand_File_Share_Xdg_Printeradmin, gid_Brand_File_Share_Xdg_QStart, gid_Brand_File_Share_Xdg_StartCenter, - gid_Brand_File_Share_Xdg_Writer); + gid_Brand_File_Share_Xdg_Writer, + gid_Brand_File_Txt_Package); Unixlinks = (gid_Brand_Unixlink_BasisLink, gid_Brand_Unixlink_Program, gid_Brand_Unixlink_Unopkg, @@ -221,6 +224,12 @@ Directory gid_Brand_Dir_Share_Extensions DosName = "extensions"; End +Directory gid_Brand_Dir_Share_Prereg + ParentID = gid_Brand_Dir_Share; + DosName = "prereg"; + Styles = (CREATE); +End + Directory gid_Brand_Dir_Share_Extensions_Install ParentID = gid_Brand_Dir_Share_Extension; DosName = "install"; @@ -644,6 +653,13 @@ File gid_Brand_File_Images_Brand_Zip Styles = (PACKED); End +File gid_Brand_File_Txt_Package + TXT_FILE_BODY; + Dir = gid_Brand_Dir_Share_Extensions; + Name = "package.txt"; + Styles = (PACKED); +End + File gid_Brand_File_Share_Registry_Brand_Xcd TXT_FILE_BODY; Styles = (PACKED, SCPZIP_REPLACE); diff --git a/scp2/source/ooo/profileitem_ooo.scp b/scp2/source/ooo/profileitem_ooo.scp index 9818d5b26749..724316ba6f5e 100644 --- a/scp2/source/ooo/profileitem_ooo.scp +++ b/scp2/source/ooo/profileitem_ooo.scp @@ -461,4 +461,3 @@ ProfileItem gid_Basis_Profileitem_Version_Ooopackageversion Key = "OOOPackageVersion"; Value = "${OOOPACKAGEVERSION}"; End - diff --git a/scp2/source/ooo/windowscustomaction_ooo.scp b/scp2/source/ooo/windowscustomaction_ooo.scp index e129f147932a..7bd6c18fae99 100755 --- a/scp2/source/ooo/windowscustomaction_ooo.scp +++ b/scp2/source/ooo/windowscustomaction_ooo.scp @@ -199,6 +199,25 @@ WindowsCustomAction gid_Customaction_Shellextensionsdll7 Assignment1 = ("InstallExecuteSequence", "REMOVE=\"ALL\" And Not PATCH", "InstallValidate"); End +WindowsCustomAction gid_Customaction_Register_Extensions + Name = "RegisterExtensions"; + Typ = "65"; + Source = "shlxtmsi.dll"; + Target = "RegisterExtensions"; + Inbinarytable = 1; + Assignment1 = ("InstallExecuteSequence", "Not REMOVE=\"ALL\"", "end"); + Assignment2 = ("AdminExecuteSequence", "Not REMOVE=\"ALL\"", "end"); +End + +WindowsCustomAction gid_Customaction_Remove_Extensions + Name = "RemoveExtensions"; + Typ = "65"; + Source = "shlxtmsi.dll"; + Target = "RemoveExtensions"; + Inbinarytable = 1; + Assignment1 = ("InstallExecuteSequence", "REMOVE=\"ALL\" And Not PATCH", "FileCost"); +End + WindowsCustomAction gid_Customaction_Set_Admininstall Name = "SetAdminInstallProperty"; Typ = "65"; @@ -287,6 +306,16 @@ WindowsCustomAction gid_Customaction_Patch_InstallExchangeFiles Assignment2 = ("AdminExecuteSequence", "", "behind_InstallFinalize"); End +WindowsCustomAction gid_Customaction_Langpack_Register_Extensions + Name = "RegisterExtensions"; + Typ = "65"; + Source = "lngpckinsthlp.dll"; + Target = "RegisterExtensions"; + Inbinarytable = 1; + Assignment1 = ("InstallExecuteSequence", "", "end"); + Assignment2 = ("AdminExecuteSequence", "", "end"); +End + WindowsCustomAction gid_Customaction_Patch_SetFeatureState Name = "SetFeatureState"; Typ = "65"; diff --git a/solenv/bin/modules/installer/epmfile.pm b/solenv/bin/modules/installer/epmfile.pm index f8e35f208251..8b828b85335f 100644 --- a/solenv/bin/modules/installer/epmfile.pm +++ b/solenv/bin/modules/installer/epmfile.pm @@ -762,33 +762,13 @@ sub replace_many_variables_in_shellscripts foreach $key (keys %{$variableshashref}) { my $value = $variableshashref->{$key}; - if ( ! $value =~ /.oxt/ ) { $value = lc($value); } # lowercase ! - if ( $installer::globals::issolarisbuild) { $value =~ s/\.org/org/g; } # openofficeorg instead of openoffice.org + # $value = lc($value); # lowercase ! + # if ( $installer::globals::issolarisbuild) { $value =~ s/\.org/org/g; } # openofficeorg instead of openoffice.org replace_variable_in_shellscripts($scriptref, $value, $key); } } ####################################### -# Setting oxt file name variable -####################################### - -sub set_oxt_filename -{ - my ($filesinpackage, $allvariables) = @_; - - for ( my $i = 0; $i <= $#{$filesinpackage}; $i++ ) - { - my $onefile = ${$filesinpackage}[$i]; - if ( $onefile->{'Name'} =~ /.oxt\s*$/ ) - { - $allvariables->{'OXTFILENAME'} = $onefile->{'Name'}; - # $allvariables->{'FULLOXTFILENAME'} = $onefile->{'destination'}; - last; # only one oxt file for each rpm! - } - } -} - -####################################### # Adding shell scripts to epm file ####################################### @@ -796,9 +776,6 @@ sub adding_shellscripts_to_epm_file { my ($epmfileref, $shellscriptsfilename, $localrootpath, $allvariableshashref, $filesinpackage) = @_; - # Setting variable for ${OXTFILENAME} into $allvariableshashref, if this is a RPM with an extension - set_oxt_filename($filesinpackage, $allvariableshashref); - # $installer::globals::shellscriptsfilename push( @{$epmfileref}, "\n\n" ); @@ -1803,26 +1780,27 @@ sub is_extension_package # share/extension/install ###################################################################### -sub get_extension_name +sub contains_extension_dir { my ($prototypefile) = @_; - my $extensionName = ""; + my $contains_extension_dir = 0; + + # d none opt/openoffice.org3/share/extensions/ for ( my $i = 0; $i <= $#{$prototypefile}; $i++ ) { my $line = ${$prototypefile}[$i]; - if ( $line =~ /^\s*f\s+none\s+share\/extension\/install\/(\w+?\.oxt)\s*\=/ ) + if ( $line =~ /^\s*d\s+none\s.*\/share\/extensions\// ) { - $extensionName = $1; + $contains_extension_dir = 1; last; } } - return $extensionName; + return $contains_extension_dir; } - ############################################################ # A Solaris patch contains 7 specific scripts ############################################################ @@ -1839,9 +1817,9 @@ sub add_scripts_into_prototypefile $path = $path . $installer::globals::separator; my @newlines = (); - my $extensionname = get_extension_name($prototypefile); + my $is_extension_package = contains_extension_dir($prototypefile); - if ( $extensionname ne "" ) + if ( $is_extension_package ) { for ( my $i = 0; $i <= $#installer::globals::solarispatchscriptsforextensions; $i++ ) { @@ -1865,9 +1843,7 @@ sub add_scripts_into_prototypefile my $scriptfile = installer::files::read_file($sourcefilename); # Replacing variables - my $oldstring = "\$\{OXTFILENAME\}"; - replace_variables_in_shellscripts_for_patch($scriptfile, $destpath, $oldstring, $extensionname); - $oldstring = "PRODUCTDIRECTORYNAME"; + my $oldstring = "PRODUCTDIRECTORYNAME"; replace_variables_in_shellscripts_for_patch($scriptfile, $destpath, $oldstring, $staticpath); # Saving file diff --git a/solenv/bin/modules/installer/simplepackage.pm b/solenv/bin/modules/installer/simplepackage.pm index fdf9fc6fa4c3..518edc683c3d 100644 --- a/solenv/bin/modules/installer/simplepackage.pm +++ b/solenv/bin/modules/installer/simplepackage.pm @@ -71,9 +71,10 @@ sub get_extensions_dir my $extensiondir = $subfolderdir . $installer::globals::separator; if ( $installer::globals::officedirhostname ne "" ) { $extensiondir = $extensiondir . $installer::globals::officedirhostname . $installer::globals::separator; } - $extensiondir = $extensiondir . "share" . $installer::globals::separator . "extensions"; + my $extensionsdir = $extensiondir . "share" . $installer::globals::separator . "extensions"; + my $preregdir = $extensiondir . "share" . $installer::globals::separator . "prereg" . $installer::globals::separator . "bundled"; - return $extensiondir; + return ( $extensionsdir, $preregdir ); } #################################################### @@ -82,21 +83,24 @@ sub get_extensions_dir sub register_extensions { - my ($officedir, $languagestringref) = @_; + 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::sundirhostname ne "" ) { $programdir = $programdir . $installer::globals::sundirhostname . $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 $infoline = ""; - - # my $unopkgfile = $officedir . $installer::globals::separator . "program" . - # $installer::globals::separator . $installer::globals::unopkgfile; - my $unopkgfile = $installer::globals::unopkgfile; my $unopkgexists = 1; @@ -107,87 +111,73 @@ sub register_extensions push( @installer::globals::logfileinfo, $infoline); } - # my $extensiondir = $officedir . $installer::globals::separator . "share" . - # $installer::globals::separator . "extension" . - # $installer::globals::separator . "install"; - - my $extensiondir = ".." . $installer::globals::separator . "share" . $installer::globals::separator . "extension" . $installer::globals::separator . "install"; - - my $allextensions = installer::systemactions::find_file_with_file_extension("oxt", $extensiondir); + if ( ! -f $unopkgfile ) + { + $unopkgexists = 0; + $infoline = "Info: File $unopkgfile does not exist! Extensions cannot be registered.\n"; + push( @installer::globals::logfileinfo, $infoline); + } - if (( $#{$allextensions} > -1 ) && ( $unopkgexists )) + if ( $unopkgexists ) { my $currentdir = cwd(); print "... current dir: $currentdir ...\n"; $infoline = "Current dir: $currentdir\n"; push( @installer::globals::logfileinfo, $infoline); - for ( my $i = 0; $i <= $#{$allextensions}; $i++ ) - { - my $oneextension = $extensiondir . $installer::globals::separator . ${$allextensions}[$i]; - - # my $systemcall = $unopkgfile . " add --shared --suppress-license " . "\"" . $oneextension . "\""; + if ( ! -f $unopkgfile ) { installer::exiter::exit_program("ERROR: $unopkgfile not found!", "register_extensions"); } - if ( ! -f $unopkgfile ) { installer::exiter::exit_program("ERROR: $unopkgfile not found!", "register_extensions"); } - if ( ! -f $oneextension ) { installer::exiter::exit_program("ERROR: $oneextension not found!", "register_extensions"); } + my $localtemppath = installer::systemactions::create_directories("uno", $languagestringref); - my $localtemppath = installer::systemactions::create_directories("uno", $languagestringref); + my $slash = ""; - if ( $installer::globals::iswindowsbuild ) + if ( $installer::globals::iswindowsbuild ) + { + if ( $^O =~ /cygwin/i ) { - if ( $^O =~ /cygwin/i ) - { - $localtemppath = $installer::globals::cyg_temppath; - } - else - { - $windowsslash = "\/"; - } - $localtemppath =~ s/\\/\//g; - $localtemppath = "/".$localtemppath; + $localtemppath = $installer::globals::cyg_temppath; + $preregdir = qx{cygpath -m "$preregdir"}; + chomp($preregdir); } - my $systemcall = $unopkgfile . " add --shared --suppress-license --verbose " . $oneextension . " -env:UserInstallation=file://" . $localtemppath . " 2\>\&1 |"; + $localtemppath =~ s/\\/\//g; + $slash = "/"; # Third slash for Windows. Other OS pathes already start with "/" + } - print "... $systemcall ...\n"; + $preregdir =~ s/\/\s*$//g; - $infoline = "Systemcall: $systemcall\n"; - push( @installer::globals::logfileinfo, $infoline); + my $systemcall = $unopkgfile . " sync --verbose -env:BUNDLED_EXTENSIONS_USER=\"file://" . $slash . $preregdir . "\"" . " -env:UserInstallation=file://" . $slash . $localtemppath . " 2\>\&1 |"; - my @unopkgoutput = (); + print "... $systemcall ...\n"; - open (UNOPKG, $systemcall); - while (<UNOPKG>) - { - my $lastline = $_; - push(@unopkgoutput, $lastline); - } - close (UNOPKG); + $infoline = "Systemcall: $systemcall\n"; + push( @installer::globals::logfileinfo, $infoline); - my $returnvalue = $?; # $? contains the return value of the systemcall + my @unopkgoutput = (); - 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]"); } + open (UNOPKG, $systemcall); + while (<UNOPKG>) + { + my $lastline = $_; + push(@unopkgoutput, $lastline); + } + close (UNOPKG); - $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); - } + 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 - { - if ( ! ( $#{$allextensions} > -1 )) + else { - $infoline = "No extensions located in directory $extensiondir.\n"; + $infoline = "Success: Executed \"$systemcall\" successfully!\n"; push( @installer::globals::logfileinfo, $infoline); } } @@ -662,6 +652,7 @@ sub create_simple_package if ( $onedir->{'HostName'} ) { my $destdir = $subfolderdir . $installer::globals::separator . $onedir->{'HostName'}; + if ( ! -d $destdir ) { if ( $^O =~ /cygwin/i ) # Cygwin performance check @@ -787,19 +778,18 @@ sub create_simple_package system($localcall); } - # Registering the extensions - - # installer::logger::print_message( "... registering extensions ...\n" ); - # installer::logger::include_header_into_logfile("Registering extensions:"); - # register_extensions($subfolderdir, $languagestringref); - installer::logger::print_message( "... removing superfluous directories ...\n" ); installer::logger::include_header_into_logfile("Removing superfluous directories:"); - my $extensionfolder = get_extensions_dir($subfolderdir); - + 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/subsequenttests b/solenv/bin/subsequenttests index 34e6b8034c70..3caa84293f3e 100755..100644 --- a/solenv/bin/subsequenttests +++ b/solenv/bin/subsequenttests @@ -47,7 +47,7 @@ while (@ARGV) { } my @testpaths = (); -my $sc = SourceConfig->new(); +my $sc = SourceConfig->new($ENV{'SOLARSRC'}); my $module; foreach $module ($sc->get_active_modules()) { my $buildlst = $sc->get_module_build_list($module); |