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
::exiter
;
22 use par2script
::files
;
23 use par2script
::globals
;
25 ############################################
26 # Exiting the program with an error
27 # This function is used instead of "die"
28 ############################################
32 my ($message, $function) = @_;
36 $infoline = "\n***************************************************************\n";
37 push(@par2script::globals
::logfileinfo
, $infoline);
40 $infoline = "$message\n";
41 push(@par2script::globals
::logfileinfo
, $infoline);
44 $infoline = "in function: $function\n";
45 push(@par2script::globals
::logfileinfo
, $infoline);
48 $infoline = "***************************************************************\n";
49 push(@par2script::globals
::logfileinfo
, $infoline);
51 if ($par2script::globals
::logging
)
53 par2script
::files
::save_file
($par2script::globals
::logfilename
, \
@par2script::globals
::logfileinfo
);
54 print("Saved logfile: $par2script::globals::logfilename\n");
62 #####################################
63 # Error, because a gid is defined
65 #####################################
67 sub multidefinitionerror
69 my ( $multidefinitiongids ) = @_;
70 print "************************************************\n";
71 print "ERROR: multiple definition of gids:\n";
72 print "************************************************\n";
75 foreach $gid ( @
{$multidefinitiongids} ) { print "\t$gid\n"; }
79 #####################################
80 # Error, because a gid is assigned
82 #####################################
84 sub multiassignmenterror
86 my ( $multiassignmentgids ) = @_;
87 print "************************************************\n";
88 print "WARNING: multiple assignments of gids:\n";
89 print "************************************************\n";
92 foreach $line ( @
{$multiassignmentgids} ) { print "\t$line\n"; }
95 #####################################
96 # Error, because a defined gid
98 #####################################
100 sub missingassignmenterror
102 my ( $missingassignmentgids ) = @_;
103 print "********************************************************\n";
104 print "ERROR: Missing assignments for the following GIDs:\n";
105 print "********************************************************\n";
108 foreach $gid ( @
{$missingassignmentgids} ) { print "\t$gid\n"; }