2 eval 'exec perl -wS $0 ${1+"$@"}'
4 #*************************************************************************
6 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 # Copyright 2008 by Sun Microsystems, Inc.
10 # OpenOffice.org - a multi-platform office productivity suite
12 # $RCSfile: config.pl,v $
16 # This file is part of OpenOffice.org.
18 # OpenOffice.org is free software: you can redistribute it and/or modify
19 # it under the terms of the GNU Lesser General Public License version 3
20 # only, as published by the Free Software Foundation.
22 # OpenOffice.org is distributed in the hope that it will be useful,
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 # GNU Lesser General Public License version 3 for more details
26 # (a copy is included in the LICENSE file that accompanied this code).
28 # You should have received a copy of the GNU Lesser General Public License
29 # version 3 along with OpenOffice.org. If not, see
30 # <http://www.openoffice.org/license.html>
31 # for a copy of the LGPLv3 License.
33 #*************************************************************************
45 if ($^O
=~ /cygwin/) {
49 if (($gui eq "UNX") or ($gui eq $cygwin)) {
57 #### Hardly coded path for
58 # \share\registry\data\org\openoffice\Office\Jobs.xcu
60 $jobs_XML_Path = "share" . $pathslash . "registry" . $pathslash . "data" . $pathslash . "org" . $pathslash . "openoffice" . $pathslash . "Office" . $pathslash . "Jobs.xcu";
62 # \user\registry\data\org\openoffice\
64 $User_Path = "user" . $pathslash . "registry" . $pathslash . "data" . $pathslash . "org" . $pathslash . "openoffice" . $pathslash;
66 # \user\registry\data\org\openoffice\Office\
68 $User_Office_Path = $User_Path . "Office" . $pathslash;
70 # \user\registry\data\org\openoffice\Office\OOoImprovement
72 $OOoImprovement_Path = $User_Office_Path . "OOoImprovement" . $pathslash;
74 $common_XML = "Common.xcu";
75 $setup_XML = "Setup.xcu";
76 $oooimprovement_XML = "Settings.xcu";
78 # $(INPATH)\misc\Common.xcu
79 $inpath_Common_XCU = $ENV{INPATH
} . $pathslash . "misc" . $pathslash . $common_XML;
83 $idStr = ' $Revision: 1.5 $ ';
84 $idStr =~ /Revision:\s+(\S+)\s+\$/
85 ?
($cpflat2minor_rev = $1) : ($cpflat2minor_rev = "-");
87 if ( ($#ARGV >= 3) ) {
98 if ( ! ( ($#ARGV >= 4) && $ARGV[0] && $ARGV[1] && $ARGV[2] && $ARGV[3] && (-d
$ARGV[3]) && $ARGV[4] ) ) {
99 print "Usage: config <basispath> <brandpath> <userinstallpath> <datapath> <buildid>\n" ;
103 $basisdir = $ARGV[0];
104 $branddir = $ARGV[1];
105 $userinstalldir = $ARGV[2];
106 $datapath = $ARGV[3];
109 $fullquickstart_path = $branddir . "program" . $pathslash . "quickstart.exe";
111 print "patching config ... \n";
112 if (!-d
"$userinstalldir$User_Office_Path") {
113 mkpath
("$userinstalldir$User_Office_Path", 0, 0777);
115 if (!-d
"$userinstalldir$OOoImprovement_Path") {
116 mkpath
("$userinstalldir$OOoImprovement_Path", 0, 0777);
120 print "Patching Common.xcu\n" if $is_debug;
121 PatchCommonXcu
($buildid);
122 print "cp $inpath_Common_XCU $userinstalldir$User_Office_Path$common_XML\n" if $is_debug;
123 copy
("$inpath_Common_XCU", "$userinstalldir$User_Office_Path$common_XML");
125 # copy OOoImprovement/Settings.xcu
127 print "cp $datapath$oooimprovement_XML $userinstalldir$OOoImprovement_Path$oooimprovement_XML\n" if $is_debug;
128 copy
("$datapath$oooimprovement_XML", "$userinstalldir$OOoImprovement_Path$oooimprovement_XML");
132 print "cp $datapath$setup_XML $userinstalldir$User_Path$setup_XML\n" if $is_debug;
133 copy
("$datapath$setup_XML", "$userinstalldir$User_Path$setup_XML");
136 # quickstarter loeschen
138 print "kill $fullquickstart_path \n";
139 unlink( $fullquickstart_path ) or die "cannot unlink $fullquickstart_path";
143 $fullsource_path = $basisdir . $jobs_XML_Path;
144 unlink ($fullsource_path);
148 ############################################################################
149 sub PatchCommonXcu
#17.04.2009 10:37
150 ############################################################################
153 open(INFILE
, "< $datapath$common_XML") || die "Can't open $datapath$common_XML (read)\n";
154 open(OUTFILE
, "> $inpath_Common_XCU") || die "Can't open $inpath_Common_XCU (write)\n";
155 my $patch_next_line = 0;
156 my $value = "<value>Patch" . $buildid . "</value>\n";
157 while ( $line = <INFILE
> ) {
158 if ( $patch_next_line ) {
159 print OUTFILE
" $value";
160 $patch_next_line = 0;
165 if ( $line =~ /ReminderDate/ ) {
166 $patch_next_line = 1;