2007-03-01 08:57:47 -06:00
|
|
|
:
|
|
|
|
eval 'exec perl -wS $0 ${1+"$@"}'
|
|
|
|
if 0;
|
|
|
|
|
|
|
|
#*************************************************************************
|
|
|
|
#
|
2008-04-10 10:48:02 -05:00
|
|
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2007-03-01 08:57:47 -06:00
|
|
|
#
|
2008-04-10 10:48:02 -05:00
|
|
|
# Copyright 2008 by Sun Microsystems, Inc.
|
2007-03-01 08:57:47 -06:00
|
|
|
#
|
2008-04-10 10:48:02 -05:00
|
|
|
# OpenOffice.org - a multi-platform office productivity suite
|
2007-03-01 08:57:47 -06:00
|
|
|
#
|
2008-04-10 10:48:02 -05:00
|
|
|
# $RCSfile: gen_update_info.pl,v $
|
2007-03-01 08:57:47 -06:00
|
|
|
#
|
2008-06-03 03:17:51 -05:00
|
|
|
# $Revision: 1.5 $
|
2007-03-01 08:57:47 -06:00
|
|
|
#
|
2008-04-10 10:48:02 -05:00
|
|
|
# This file is part of OpenOffice.org.
|
2007-03-01 08:57:47 -06:00
|
|
|
#
|
2008-04-10 10:48:02 -05:00
|
|
|
# OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
# only, as published by the Free Software Foundation.
|
2007-03-01 08:57:47 -06:00
|
|
|
#
|
2008-04-10 10:48:02 -05:00
|
|
|
# OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Lesser General Public License version 3 for more details
|
|
|
|
# (a copy is included in the LICENSE file that accompanied this code).
|
2007-03-01 08:57:47 -06:00
|
|
|
#
|
2008-04-10 10:48:02 -05:00
|
|
|
# You should have received a copy of the GNU Lesser General Public License
|
|
|
|
# version 3 along with OpenOffice.org. If not, see
|
|
|
|
# <http://www.openoffice.org/license.html>
|
|
|
|
# for a copy of the LGPLv3 License.
|
2007-03-01 08:57:47 -06:00
|
|
|
#
|
|
|
|
#*************************************************************************
|
|
|
|
|
|
|
|
|
|
|
|
#*********************************************************************
|
|
|
|
#
|
|
|
|
# main
|
|
|
|
#
|
|
|
|
|
2008-06-03 03:17:51 -05:00
|
|
|
my($product, $buildid, $id, $os, $arch, $lstfile, $languages, $productname, $productversion, $productextension);
|
2007-03-01 08:57:47 -06:00
|
|
|
|
|
|
|
while ($_ = $ARGV[0], /^-/) {
|
|
|
|
shift;
|
|
|
|
last if /^--$/;
|
|
|
|
if (/^--product/) {
|
|
|
|
$product= $ARGV[0];
|
|
|
|
shift;
|
|
|
|
}
|
|
|
|
if (/^--buildid/) {
|
|
|
|
$buildid = $ARGV[0];
|
|
|
|
shift;
|
|
|
|
}
|
|
|
|
if (/^--os/) {
|
|
|
|
$os = $ARGV[0];
|
|
|
|
shift;
|
|
|
|
}
|
|
|
|
if (/^--arch/) {
|
|
|
|
$arch = $ARGV[0];
|
|
|
|
shift;
|
|
|
|
}
|
|
|
|
if (/^--lstfile/) {
|
|
|
|
$lstfile = $ARGV[0];
|
|
|
|
shift;
|
|
|
|
}
|
|
|
|
if (/^--languages/) {
|
|
|
|
$languages = $ARGV[0];
|
|
|
|
shift;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-03-05 09:24:24 -06:00
|
|
|
$sourcefile = $ARGV[0];
|
|
|
|
|
|
|
|
if( $^O =~ /cygwin/i ) {
|
|
|
|
# We might get paths with backslashes, fix that.
|
|
|
|
$lstfile =~ s/\\/\//g;
|
|
|
|
$sourcefile =~ s/\\/\//g;
|
|
|
|
}
|
|
|
|
|
2007-03-01 08:57:47 -06:00
|
|
|
# read openoffice.lst
|
|
|
|
unless(open(LSTFILE, "sed -n \"/^$product\$/,/^}\$/ p\" $lstfile |")) {
|
|
|
|
print STDERR "Can't open $lstfile file: $!\n";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
while (<LSTFILE>) {
|
|
|
|
if( /\bPRODUCTNAME / ) {
|
|
|
|
chomp;
|
|
|
|
s/.*PRODUCTNAME //;
|
|
|
|
$productname = $_;
|
|
|
|
}
|
|
|
|
if( /\bPRODUCTVERSION / ) {
|
|
|
|
chomp;
|
|
|
|
s/.*PRODUCTVERSION //;
|
|
|
|
$productversion = $_;
|
|
|
|
}
|
2008-06-03 03:17:51 -05:00
|
|
|
if( /\bPRODUCTEXTENSION / ) {
|
|
|
|
chomp;
|
|
|
|
s/.*PRODUCTEXTENSION //;
|
|
|
|
$productextension = $_;
|
|
|
|
}
|
2007-03-01 08:57:47 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
close(LSTFILE);
|
|
|
|
|
|
|
|
# simulate the behavior of make_installer.pl when writing versionrc
|
|
|
|
unless( "$os" eq "Windows" ) {
|
|
|
|
$languages =~ s/_.*//;
|
|
|
|
}
|
|
|
|
|
|
|
|
$id = $productversion;
|
|
|
|
$id =~ s/\..*//;
|
|
|
|
$id = $productname . "_" . $id . "_" . $languages;
|
|
|
|
|
|
|
|
# open input file
|
2008-03-05 09:24:24 -06:00
|
|
|
unless (open(SOURCE, $sourcefile)) {
|
|
|
|
print STDERR "Can't open $sourcefile file: $!\n";
|
2007-03-01 08:57:47 -06:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
while (<SOURCE>) {
|
|
|
|
s/:id></:id>$id</;
|
|
|
|
s/buildid></buildid>$buildid</;
|
|
|
|
s/os></os>$os</;
|
|
|
|
s/arch></arch>$arch</;
|
2008-06-03 03:17:51 -05:00
|
|
|
if ( $productextension ) {
|
|
|
|
s/extension></extension>$productextension</;
|
|
|
|
} else {
|
|
|
|
next if ( /extension></ );
|
|
|
|
}
|
2007-03-01 08:57:47 -06:00
|
|
|
s/version></version>$productversion</;
|
|
|
|
s/name></name>$productname</;
|
|
|
|
print;
|
|
|
|
}
|
|
|
|
|
|
|
|
close(SOURCE);
|