tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / solenv / bin / modules / par2script / parameter.pm
blob86416cd9e26531d4766ad3c06a7e3db8b87f648f
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;
22 use Cwd;
23 use par2script::files;
24 use par2script::globals;
26 ############################################
27 # Parameter Operations
28 ############################################
30 ###############################################################################
31 # Usage:
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 ###############################################################################
37 sub usage
39 print <<End;
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
49 Example:
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 --------------------------------------------------------------
55 End
56 exit(-1);
59 #####################################
60 # Reading parameter
61 #####################################
63 sub getparameter
65 while ( $#ARGV >= 0 )
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;
78 else
80 print("\n*************************************\n");
81 print("Sorry, unknown parameter: $param");
82 print("\n*************************************\n");
83 usage();
84 exit(-1);
89 ############################################
90 # Controlling the fundamental parameter
91 # (required for every process)
92 ############################################
94 sub control_parameter
96 if ($par2script::globals::includepathlist eq "")
98 print "\n************************************************\n";
99 print "Error: Include paths not set not set (-i)!";
100 print "\n************************************************\n";
101 usage();
102 exit(-1);
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";
110 usage();
111 exit(-1);
114 if ($par2script::globals::parfilelistorig eq "")
116 print "\n************************************************\n";
117 print "Error: List of par files not set!";
118 print "\n************************************************\n";
119 usage();
120 exit(-1);
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 #####################################
134 sub outputparameter
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"; }
140 $outputline .= "\n";
142 print $outputline;