1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: parameter.pm,v $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
33 package par2script
::parameter
;
36 use par2script
::files
;
37 use par2script
::globals
;
38 use par2script
::systemactions
;
40 ############################################
41 # Parameter Operations
42 ############################################
44 ###############################################################################
46 # perl par2script.pl -i ..\wntmsci8.pro\par,o:\SRX645\wntmsci8.pro\par.m24
47 # @@C:\DOCUMEN~1\is\LOCALS~1\Temp\mk6pd
48 # -o ..\wntmsci8.pro\bin\osl\setup_osl.inf
49 ###############################################################################
55 --------------------------------------------------------------
56 $par2script::globals::prog
57 The following parameter are needed:
58 -i: include pathes, comma separated list
59 -o: setup script file name
60 -v: writing logfile.txt (optional)
61 \@\@list: list of all par files
64 perl par2script.pl -i ..\\wntmsci8\\par\,o\:\\SRX645\\wntmsci8\\par.m24
65 \@\@C\:\\DOCUMEN\~1\\is\\LOCALS\~1\\Temp\\mk6pd
66 -o ..\\wntmsci8.pro\\bin\\osl\\setup_osl.inf \[-v\]
68 --------------------------------------------------------------
73 #####################################
75 #####################################
81 my $param = shift(@ARGV);
83 if ($param eq "-o") { $par2script::globals
::scriptname
= shift(@ARGV); }
84 elsif ($param eq "-v") { $par2script::globals
::logging
= 1; }
85 elsif ($param =~ /\@\@/) { $par2script::globals
::parfilelistorig
= $param; }
86 elsif ($param eq "-i") { $par2script::globals
::includepathlist
= shift(@ARGV); }
87 elsif (($param =~ /\//) || ($param =~ /\\/)) # another include parameter!
89 $par2script::globals
::includepathlist
= $par2script::globals
::includepathlist
. "," . $param;
93 print("\n*************************************\n");
94 print("Sorry, unknown parameter: $param");
95 print("\n*************************************\n");
102 ############################################
103 # Controlling the fundamental parameter
104 # (required for every process)
105 ############################################
107 sub control_parameter
109 if ($par2script::globals
::includepathlist
eq "")
111 print "\n************************************************\n";
112 print "Error: Include pathes not set not set (-i)!";
113 print "\n************************************************\n";
118 if ($par2script::globals
::scriptname
eq "")
120 print "\n************************************************\n";
121 print "Error: Name of the setup script not set (-o)!";
122 print "\n************************************************\n";
127 if ($par2script::globals
::parfilelistorig
eq "")
129 print "\n************************************************\n";
130 print "Error: List of par files not set!";
131 print "\n************************************************\n";
136 # The par file list has to exist
138 $par2script::globals
::parfilelist
= $par2script::globals
::parfilelistorig
;
139 $par2script::globals
::parfilelist
=~ s/\@\@//;
140 par2script
::files
::check_file
($par2script::globals
::parfilelist
);
143 #####################################
144 # Writing parameter to shell
145 #####################################
149 my $outputline = "\n$par2script::globals::prog -i $par2script::globals::includepathlist $par2script::globals::parfilelistorig -o $par2script::globals::scriptname";
151 if ($par2script::globals
::logging
) { $outputline .= " -v"; }