2 eval 'exec perl -wS $0 ${1+"$@"}'
5 #*************************************************************************
7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9 # Copyright 2008 by Sun Microsystems, Inc.
11 # OpenOffice.org - a multi-platform office productivity suite
13 # $RCSfile: gen_update_info.pl,v $
17 # This file is part of OpenOffice.org.
19 # OpenOffice.org is free software: you can redistribute it and/or modify
20 # it under the terms of the GNU Lesser General Public License version 3
21 # only, as published by the Free Software Foundation.
23 # OpenOffice.org is distributed in the hope that it will be useful,
24 # but WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 # GNU Lesser General Public License version 3 for more details
27 # (a copy is included in the LICENSE file that accompanied this code).
29 # You should have received a copy of the GNU Lesser General Public License
30 # version 3 along with OpenOffice.org. If not, see
31 # <http://www.openoffice.org/license.html>
32 # for a copy of the LGPLv3 License.
34 #*************************************************************************
37 #*********************************************************************
42 my($product, $buildid, $id, $os, $arch, $lstfile, $languages, $productname, $productversion, $productedition);
44 while ($_ = $ARGV[0], /^-/) {
68 $languages = $ARGV[0];
73 $sourcefile = $ARGV[0];
75 if( $^O
=~ /cygwin/i ) {
76 # We might get paths with backslashes, fix that.
77 $lstfile =~ s/\\/\//g
;
78 $sourcefile =~ s/\\/\//g
;
82 # reading Globals section
83 unless(open(LSTFILE
, "sed -n \"/^Globals\$/,/^}\$/ p\" $lstfile |")) {
84 print STDERR
"Can't open $lstfile file: $!\n";
89 if( /\bPRODUCTNAME / ) {
94 if( /\bPACKAGEVERSION / ) {
96 s/.*PACKAGEVERSION //;
99 if( /\bPRODUCTEDITION / ) {
101 s/.*PRODUCTEDITION //;
102 $productedition = $_;
108 ### may be hierarchical ...
109 if(open(LSTFILE
, "sed -n \"/^$product:/,/^}\$/ p\" $lstfile |")) {
111 if ( /^$product\s?:\s?(\w+)$/ ) {
114 if( /\bPRODUCTEDITION / ) {
116 s/.*PRODUCTEDITION //;
117 $productedition = $_;
123 # Reading product specific settings
125 unless(open(LSTFILE
, "sed -n \"/^$product\$/,/^}\$/ p\" $lstfile |")) {
126 print STDERR
"Can't open $lstfile file: $!\n";
131 if( /\bPRODUCTNAME / ) {
136 if( /\bPACKAGEVERSION / ) {
138 s/.*PACKAGEVERSION //;
139 $productversion = $_;
141 if( /\bPRODUCTEDITION / ) {
143 s/.*PRODUCTEDITION //;
144 $productedition = $_;
150 # simulate the behavior of make_installer.pl when writing versionrc
151 unless( "$os" eq "Windows" ) {
152 $languages =~ s/_.*//;
155 $id = $productversion;
157 $id = $productname . "_" . $id . "_" . $languages;
160 unless (open(SOURCE
, $sourcefile)) {
161 print STDERR
"Can't open $sourcefile file: $!\n";
167 s/buildid></buildid>$buildid</;
169 s/arch></arch>$arch</;
170 if ( $productedition ) {
171 s/edition></edition>$productedition</;
173 next if ( /edition></ );
175 s/version></version>$productversion</;
176 s/name></name>$productname</;