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
;
25 use par2script
::systemactions
;
27 ############################################
28 # Parameter Operations
29 ############################################
31 ###############################################################################
33 # perl par2script.pl -i ..\wntmsci8.pro\par,o:\SRX645\wntmsci8.pro\par.m24
34 # @@C:\DOCUMEN~1\is\LOCALS~1\Temp\mk6pd
35 # -o ..\wntmsci8.pro\bin\osl\setup_osl.inf
36 ###############################################################################
42 --------------------------------------------------------------
43 $par2script::globals::prog
44 The following parameter are needed:
45 -i: include paths, comma separated list
46 -o: setup script file name
47 -v: writing logfile.txt (optional)
48 \@\@list: list of all par files
51 perl par2script.pl -i ..\\wntmsci8\\par\,o\:\\SRX645\\wntmsci8\\par.m24
52 \@\@C\:\\DOCUMEN\~1\\is\\LOCALS\~1\\Temp\\mk6pd
53 -o ..\\wntmsci8.pro\\bin\\osl\\setup_osl.inf \[-v\]
55 --------------------------------------------------------------
60 #####################################
62 #####################################
68 my $param = shift(@ARGV);
70 if ($param eq "-o") { $par2script::globals
::scriptname
= shift(@ARGV); }
71 elsif ($param eq "-q") { $par2script::globals
::verbose
= 0; }
72 elsif ($param eq "-v") { $par2script::globals
::logging
= 1; }
73 elsif ($param =~ /\@\@/) { $par2script::globals
::parfilelistorig
= $param; }
74 elsif ($param eq "-i") { $par2script::globals
::includepathlist
= shift(@ARGV); }
75 elsif (($param =~ /\//) || ($param =~ /\\/)) # another include parameter!
77 $par2script::globals
::includepathlist
= $par2script::globals
::includepathlist
. "," . $param;
81 print("\n*************************************\n");
82 print("Sorry, unknown parameter: $param");
83 print("\n*************************************\n");
90 ############################################
91 # Controlling the fundamental parameter
92 # (required for every process)
93 ############################################
97 if ($par2script::globals
::includepathlist
eq "")
99 print "\n************************************************\n";
100 print "Error: Include paths not set not set (-i)!";
101 print "\n************************************************\n";
106 if ($par2script::globals
::scriptname
eq "")
108 print "\n************************************************\n";
109 print "Error: Name of the setup script not set (-o)!";
110 print "\n************************************************\n";
115 if ($par2script::globals
::parfilelistorig
eq "")
117 print "\n************************************************\n";
118 print "Error: List of par files not set!";
119 print "\n************************************************\n";
124 # The par file list has to exist
126 $par2script::globals
::parfilelist
= $par2script::globals
::parfilelistorig
;
127 $par2script::globals
::parfilelist
=~ s/\@\@//;
128 par2script
::files
::check_file
($par2script::globals
::parfilelist
);
131 #####################################
132 # Writing parameter to shell
133 #####################################
137 my $outputline = "\n$par2script::globals::prog -i $par2script::globals::includepathlist $par2script::globals::parfilelistorig -o $par2script::globals::scriptname";
139 if ($par2script::globals
::logging
) { $outputline .= " -v"; }