2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This file incorporates work covered by the following license notice:
10 # Licensed to the Apache Software Foundation (ASF) under one or more
11 # contributor license agreements. See the NOTICE file distributed
12 # with this work for additional information regarding copyright
13 # ownership. The ASF licenses this file to you under the Apache
14 # License, Version 2.0 (the "License"); you may not use this file
15 # except in compliance with the License. You may obtain a copy of
16 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 package par2script
::parameter
;
23 use par2script
::files
;
24 use par2script
::globals
;
26 ############################################
27 # Parameter Operations
28 ############################################
30 ###############################################################################
32 # perl par2script.pl -i ..\wntmsci8.pro\par,o:\SRX645\wntmsci8.pro\par.m24
33 # @@C:\DOCUMEN~1\is\LOCALS~1\Temp\mk6pd
34 # -o ..\wntmsci8.pro\bin\osl\setup_osl.inf
35 ###############################################################################
41 --------------------------------------------------------------
42 $par2script::globals::prog
43 The following parameter are needed:
44 -i: include paths, comma separated list
45 -o: setup script file name
46 -v: writing logfile.txt (optional)
47 \@\@list: list of all par files
50 perl par2script.pl -i ..\\wntmsci8\\par\,o\:\\SRX645\\wntmsci8\\par.m24
51 \@\@C\:\\DOCUMEN\~1\\is\\LOCALS\~1\\Temp\\mk6pd
52 -o ..\\wntmsci8.pro\\bin\\osl\\setup_osl.inf \[-v\]
54 --------------------------------------------------------------
59 #####################################
61 #####################################
67 my $param = shift(@ARGV);
69 if ($param eq "-o") { $par2script::globals
::scriptname
= shift(@ARGV); }
70 elsif ($param eq "-q") { $par2script::globals
::verbose
= 0; }
71 elsif ($param eq "-v") { $par2script::globals
::logging
= 1; }
72 elsif ($param =~ /\@\@/) { $par2script::globals
::parfilelistorig
= $param; }
73 elsif ($param eq "-i") { $par2script::globals
::includepathlist
= shift(@ARGV); }
74 elsif (($param =~ /\//) || ($param =~ /\\/)) # another include parameter!
76 $par2script::globals
::includepathlist
= $par2script::globals
::includepathlist
. "," . $param;
80 print("\n*************************************\n");
81 print("Sorry, unknown parameter: $param");
82 print("\n*************************************\n");
89 ############################################
90 # Controlling the fundamental parameter
91 # (required for every process)
92 ############################################
96 if ($par2script::globals
::includepathlist
eq "")
98 print "\n************************************************\n";
99 print "Error: Include paths not set not set (-i)!";
100 print "\n************************************************\n";
105 if ($par2script::globals
::scriptname
eq "")
107 print "\n************************************************\n";
108 print "Error: Name of the setup script not set (-o)!";
109 print "\n************************************************\n";
114 if ($par2script::globals
::parfilelistorig
eq "")
116 print "\n************************************************\n";
117 print "Error: List of par files not set!";
118 print "\n************************************************\n";
123 # The par file list has to exist
125 $par2script::globals
::parfilelist
= $par2script::globals
::parfilelistorig
;
126 $par2script::globals
::parfilelist
=~ s/\@\@//;
127 par2script
::files
::check_file
($par2script::globals
::parfilelist
);
130 #####################################
131 # Writing parameter to shell
132 #####################################
136 my $outputline = "\n$par2script::globals::prog -i $par2script::globals::includepathlist $par2script::globals::parfilelistorig -o $par2script::globals::scriptname";
138 if ($par2script::globals
::logging
) { $outputline .= " -v"; }