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 .
19 use lib
("$ENV{SRCDIR}/solenv/bin/modules");
22 use par2script
::check
;
23 use par2script
::files
;
24 use par2script
::globals
;
25 use par2script
::parameter
;
26 use par2script
::module
;
27 use par2script
::undefine
;
30 ####################################
32 ####################################
34 par2script
::parameter
::getparameter
();
35 par2script
::parameter
::control_parameter
();
36 par2script
::parameter
::outputparameter
() if $par2script::globals
::verbose
;
38 my $includes = par2script
::work
::setincludes
($par2script::globals
::includepathlist
);
39 my $parfiles = par2script
::work
::setparfiles
($par2script::globals
::parfilelist
);
41 par2script
::work
::make_complete_paths_for_parfiles
($parfiles, $includes);
43 print "Reading par files\n" if $par2script::globals
::verbose
;
44 my $parfilecontent = par2script
::work
::read_all_parfiles
($parfiles);
46 print "Collecting items\n" if $par2script::globals
::verbose
;
47 par2script
::work
::collect_definitions
($parfilecontent);
49 print "Collecting assigned items\n" if $par2script::globals
::verbose
;
50 par2script
::work
::collect_assigned_gids
();
52 # print "First control of multiple assignments\n";
53 # par2script::check::check_multiple_assignments();
55 print "Searching for Undefinitions\n" if $par2script::globals
::verbose
;
56 par2script
::undefine
::undefine_gids
($parfilecontent);
57 par2script
::undefine
::remove_complete_item
("Directory", $parfilecontent);
58 par2script
::undefine
::remove_complete_item
("Profile", $parfilecontent);
60 print "Removing assigned GIDs without definitions\n" if $par2script::globals
::verbose
;
61 par2script
::module
::remove_undefined_gids_from_modules
();
63 print "Adding definitions without assignment to the root\n" if $par2script::globals
::verbose
;
64 par2script
::module
::add_to_root_module
();
66 print "Control of multiple assignments\n" if $par2script::globals
::verbose
;
67 par2script
::check
::check_multiple_assignments
();
69 print "Control of definitions with missing assignments\n" if $par2script::globals
::verbose
;
70 par2script
::check
::check_missing_assignments
();
72 # checking the setup script
73 print "Checking directory definitions ...\n" if $par2script::globals
::verbose
;
74 par2script
::check
::check_needed_directories
();
75 par2script
::check
::check_directories_in_item_definitions
();
76 print "Checking module definitions ...\n" if $par2script::globals
::verbose
;
77 par2script
::check
::check_module_existence
();
78 print "Checking module assignments ...\n" if $par2script::globals
::verbose
;
79 par2script
::check
::check_moduleid_at_items
();
80 print "Checking Root Module ..." if $par2script::globals
::verbose
;
81 par2script
::check
::check_rootmodule
();
82 print "Checking Shortcut assignments ...\n" if $par2script::globals
::verbose
;
83 par2script
::check
::check_shortcut_assignments
();
84 print "Checking missing parents ...\n" if $par2script::globals
::verbose
;
85 par2script
::check
::check_missing_parents
();
87 print "Shorten lines at modules\n" if $par2script::globals
::verbose
;
88 par2script
::module
::shorten_lines_at_modules
();
90 # Now the script can be created
91 print "Creating setup script\n" if $par2script::globals
::verbose
;
92 my $setupscript = par2script
::work
::create_script
();
94 print "Saving script\n" if $par2script::globals
::verbose
;
95 par2script
::files
::save_file
($par2script::globals
::scriptname
, $setupscript);
98 if ($par2script::globals
::logging
)
100 par2script
::files
::save_file
($par2script::globals
::logfilename
, \
@par2script::globals
::logfileinfo
);
101 print "Log file written: $par2script::globals::logfilename\n";
104 ####################################
106 ####################################