summaryrefslogtreecommitdiffstats
path: root/postprocess/packconfig
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-01-07 15:00:52 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-01-07 15:00:52 +0000
commit728704bfec23dac79e413d432f3dc2037c9240cc (patch)
treee4853de20b0e6d2a4e4bc674a7e6eb4ddecebfd9 /postprocess/packconfig
parentCWS-TOOLING: integrate CWS mooxlsc (diff)
downloadcore-728704bfec23dac79e413d432f3dc2037c9240cc.tar.gz
core-728704bfec23dac79e413d432f3dc2037c9240cc.zip
CWS-TOOLING: integrate CWS macmenusquit
2009-01-07 13:36:33 +0100 jsk r265962 : #i97382, #i97825 2008-12-29 22:35:29 +0100 ericb r265826 : CWS-TOOLING: rebase CWS macmenusquit to trunk@265758 (milestone: DEV300:m38) 2008-12-18 08:43:55 +0100 jsk r265663 : #i97382# 2008-12-18 08:19:11 +0100 jsk r265659 : #i97382# 2008-12-11 19:26:17 +0100 ericb r265350 : #i97142# remove Tools -> Options menu on Mac OS X (not Aqua HIG compliant) 2008-11-27 14:13:25 +0100 ericb r264488 : #i82140# ause suggested to check whether xsltproc operation was successfull 2008-11-27 13:34:58 +0100 ericb r264483 : #i82140# on mod demand, remove useless About cannot be bad either 2008-10-11 12:50:13 +0200 ericb r262155 : #i82140#: migrate CWS macmenusquit to SVN: adding macosx specific files 2008-10-11 12:49:13 +0200 ericb r262154 : #i82140#: migrate CWS macmenusquit to SVN.
Diffstat (limited to 'postprocess/packconfig')
-rw-r--r--postprocess/packconfig/macosx/macosx_menubar_modification.xsl26
-rwxr-xr-xpostprocess/packconfig/packconfig.pl51
2 files changed, 70 insertions, 7 deletions
diff --git a/postprocess/packconfig/macosx/macosx_menubar_modification.xsl b/postprocess/packconfig/macosx/macosx_menubar_modification.xsl
new file mode 100644
index 000000000000..91c1d6fc2522
--- /dev/null
+++ b/postprocess/packconfig/macosx/macosx_menubar_modification.xsl
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet version='1.0'
+ xmlns:menu="http://openoffice.org/2001/menu"
+ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >
+
+ <!-- identity template, does reproduce every IN node on the output -->
+ <xsl:template match="node()|@*">
+ <xsl:copy>
+ <xsl:apply-templates select="node()|@*"/>
+ </xsl:copy>
+ </xsl:template>
+
+ <!-- filtering template : removes the concerned nodes -->
+ <!-- removes the separator just before the expected item -->
+ <xsl:template match="menu:menuseparator[following-sibling::menu:menuitem[1]/@menu:id='.uno:Quit']"/>
+ <!-- suppression of the Quit item -->
+ <xsl:template match="menu:menuitem[@menu:id='.uno:Quit']"/>
+
+ <xsl:template match="menu:menuseparator[following-sibling::menu:menuitem[1]/@menu:id='.uno:About']"/>
+ <!-- suppression of the About item -->
+ <xsl:template match="menu:menuitem[@menu:id='.uno:About']"/>
+
+ <!-- suppression of the OptionsTreeDialog item -->
+ <xsl:template match="menu:menuitem[@menu:id='.uno:OptionsTreeDialog']"/>
+
+</xsl:stylesheet>
diff --git a/postprocess/packconfig/packconfig.pl b/postprocess/packconfig/packconfig.pl
index 0d4728497d75..d34b8fd5449c 100755
--- a/postprocess/packconfig/packconfig.pl
+++ b/postprocess/packconfig/packconfig.pl
@@ -11,7 +11,7 @@ eval 'exec perl -wS $0 ${1+"$@"}'
#
# $RCSfile: packconfig.pl,v $
#
-# $Revision: 1.3 $
+# $Revision: 1.3.24.2 $
#
# This file is part of OpenOffice.org.
#
@@ -56,7 +56,7 @@ my $do_rebuild = 0; # is rebuilding zipfile required?
( my $script_name = $0 ) =~ s/^.*\b(\w+)\.pl$/$1/;
my $script_rev;
-my $id_str = ' $Revision$ ';
+my $id_str = ' $Revision: 1.3.24.2 $ ';
$id_str =~ /Revision:\s+(\S+)\s+\$/
? ($script_rev = $1) : ($script_rev = "-");
@@ -175,16 +175,23 @@ sub is_file_newer
sub create_zip_archive
{
my $zip_hash_ref = shift;
-
print_message("creating config archive ...") if $verbose;
my $zip = Archive::Zip->new();
+ # on Mac OS X Intel we have unxmacxi.pro, on Mac OS X PowerPC unxmacxp.pro .. and so on
+ my $platform = $ENV{INPATH};
+
foreach ( sort keys %{$zip_hash_ref} ) {
my $path = "$files_path/$_";
- print_message("zipping '$path' ...") if $extra_verbose;
- if ( !$zip->addFile($path, $_) ) {
- print_error("can't add file '$path' to config zip archive: $!", 5);
- }
+ # only Mac OS X Aqua is concerned here
+ # but changes for other platforms can easely be added following the same principle
+ if ( ( $platform =~ /^.*macx*/) && ($path =~ /^.*menubar.xml/ ) ) {
+ $path = modify_mac_menus($path);
+ }
+ print_message("zipping '$path' ...") if $extra_verbose;
+ if ( !$zip->addFile($path, $_) ) {
+ print_error("can't add file '$path' to config zip archive: $!", 5);
+ }
}
my $status = $zip->writeToFileNamed($tmp_out_file);
if ( $status != AZ_OK ) {
@@ -193,6 +200,36 @@ sub create_zip_archive
return;
}
+sub modify_mac_menus
+{
+ my $path_base = "$ENV{'SOLARENV'}";
+ $path_base =~ s/solenv//;
+
+ my $new_file_name = "$path_base"."postprocess"."\/"."$ENV{INPATH}"."\/"."misc"."\/"."$_";
+
+ my $new_directory = $new_file_name;
+ $new_directory =~ s/\/menubar.xml//;
+ if ( ! -e $new_directory) {
+ `mkdir -p "$new_directory"`;
+ }
+
+ my $old_file_name = "$files_path/$_";
+
+ `cp $old_file_name $new_file_name`;
+
+ my $temp_file_name = "$new_file_name"."_tmp";
+ my $xsl_file = "macosx/macosx_menubar_modification.xsl";
+
+ my $result = `xsltproc $xsl_file $new_file_name > $temp_file_name`;
+
+ if ( $result != 0) {
+ print_error("xsltproc '$xsl_file' '$new_file_name'> '$temp_file_name' failed",1)
+ }
+
+ replace_file( $temp_file_name, $new_file_name );
+ return $new_file_name;
+}
+
sub replace_file
{
my $source_file = shift;