1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2000, 2010 Oracle and/or its affiliates.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # This file is part of OpenOffice.org.
11 # OpenOffice.org is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU Lesser General Public License version 3
13 # only, as published by the Free Software Foundation.
15 # OpenOffice.org is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU Lesser General Public License version 3 for more details
19 # (a copy is included in the LICENSE file that accompanied this code).
21 # You should have received a copy of the GNU Lesser General Public License
22 # version 3 along with OpenOffice.org. If not, see
23 # <http://www.openoffice.org/license.html>
24 # for a copy of the LGPLv3 License.
26 #*************************************************************************
28 use lib
("$ENV{SOLARENV}/bin/modules");
31 use par2script
::check
;
32 use par2script
::files
;
33 use par2script
::globals
;
34 use par2script
::parameter
;
35 use par2script
::module
;
36 use par2script
::undefine
;
39 ####################################
41 ####################################
43 par2script
::parameter
::getparameter
();
44 par2script
::parameter
::control_parameter
();
45 par2script
::parameter
::outputparameter
() if $par2script::globals
::verbose
;
47 my $includes = par2script
::work
::setincludes
($par2script::globals
::includepathlist
);
48 my $parfiles = par2script
::work
::setparfiles
($par2script::globals
::parfilelist
);
50 par2script
::work
::make_complete_paths_for_parfiles
($parfiles, $includes);
52 print "Reading par files\n" if $par2script::globals
::verbose
;
53 my $parfilecontent = par2script
::work
::read_all_parfiles
($parfiles);
55 print "Collecting items\n" if $par2script::globals
::verbose
;
56 par2script
::work
::collect_definitions
($parfilecontent);
58 print "Collecting assigned items\n" if $par2script::globals
::verbose
;
59 par2script
::work
::collect_assigned_gids
();
61 # print "First control of multiple assignments\n";
62 # par2script::check::check_multiple_assignments();
64 print "Searching for Undefinitions\n" if $par2script::globals
::verbose
;
65 par2script
::undefine
::undefine_gids
($parfilecontent);
66 par2script
::undefine
::remove_complete_item
("Directory", $parfilecontent);
67 par2script
::undefine
::remove_complete_item
("Profile", $parfilecontent);
69 print "Removing assigned GIDs without definitions\n" if $par2script::globals
::verbose
;
70 par2script
::module
::remove_undefined_gids_from_modules
();
72 print "Adding definitions without assignment to the root\n" if $par2script::globals
::verbose
;
73 par2script
::module
::add_to_root_module
();
75 print "Control of multiple assignments\n" if $par2script::globals
::verbose
;
76 par2script
::check
::check_multiple_assignments
();
78 print "Control of definitions with missing assignments\n" if $par2script::globals
::verbose
;
79 par2script
::check
::check_missing_assignments
();
81 # checking the setup script
82 print "Checking directory definitions ...\n" if $par2script::globals
::verbose
;
83 par2script
::check
::check_needed_directories
();
84 par2script
::check
::check_directories_in_item_definitions
();
85 print "Checking module definitions ...\n" if $par2script::globals
::verbose
;
86 par2script
::check
::check_module_existence
();
87 print "Checking module assignments ...\n" if $par2script::globals
::verbose
;
88 par2script
::check
::check_moduleid_at_items
();
89 print "Checking Root Module ..." if $par2script::globals
::verbose
;
90 par2script
::check
::check_rootmodule
();
91 print "Checking Shortcut assignments ...\n" if $par2script::globals
::verbose
;
92 par2script
::check
::check_shortcut_assignments
();
93 print "Checking missing parents ...\n" if $par2script::globals
::verbose
;
94 par2script
::check
::check_missing_parents
();
96 print "Shorten lines at modules\n" if $par2script::globals
::verbose
;
97 par2script
::module
::shorten_lines_at_modules
();
99 # Now the script can be created
100 print "Creating setup script\n" if $par2script::globals
::verbose
;
101 my $setupscript = par2script
::work
::create_script
();
103 print "Saving script\n" if $par2script::globals
::verbose
;
104 par2script
::files
::save_file
($par2script::globals
::scriptname
, $setupscript);
107 if ($par2script::globals
::logging
)
109 par2script
::files
::save_file
($par2script::globals
::logfilename
, \
@par2script::globals
::logfileinfo
);
110 print "Log file written: $par2script::globals::logfilename\n";
113 ####################################
115 ####################################