1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: par2script.pl,v $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 use lib
("$ENV{SOLARENV}/bin/modules");
35 use par2script
::check
;
36 use par2script
::files
;
37 use par2script
::globals
;
38 use par2script
::parameter
;
39 use par2script
::module
;
40 use par2script
::undefine
;
43 ####################################
45 ####################################
47 par2script
::parameter
::getparameter
();
48 par2script
::parameter
::control_parameter
();
49 par2script
::parameter
::outputparameter
();
51 my $includes = par2script
::work
::setincludes
($par2script::globals
::includepathlist
);
52 my $parfiles = par2script
::work
::setparfiles
($par2script::globals
::parfilelist
);
54 par2script
::work
::make_complete_pathes_for_parfiles
($parfiles, $includes);
56 print "Reading par files\n";
57 my $parfilecontent = par2script
::work
::read_all_parfiles
($parfiles);
59 print "Collecting items\n";
60 par2script
::work
::collect_definitions
($parfilecontent);
62 print "Collecting assigned items\n";
63 par2script
::work
::collect_assigned_gids
();
65 # print "First control of multiple assignments\n";
66 # par2script::check::check_multiple_assignments();
68 print "Searching for Undefinitions\n";
69 par2script
::undefine
::undefine_gids
($parfilecontent);
70 par2script
::undefine
::remove_complete_item
("Directory", $parfilecontent);
71 par2script
::undefine
::remove_complete_item
("Profile", $parfilecontent);
73 print "Removing assigned GIDs without definitions\n";
74 par2script
::module
::remove_undefined_gids_from_modules
();
76 print "Adding definitions without assignment to the root\n";
77 par2script
::module
::add_to_root_module
();
79 print "Control of multiple assignments\n";
80 par2script
::check
::check_multiple_assignments
();
82 print "Control of definitions with missing assignments\n";
83 par2script
::check
::check_missing_assignments
();
85 # checking the setup script
86 print "Checking directory definitions ...\n";
87 par2script
::check
::check_needed_directories
();
88 par2script
::check
::check_directories_in_item_definitions
();
89 print "Checking module definitions ...\n";
90 par2script
::check
::check_module_existence
();
91 print "Checking module assignments ...\n";
92 par2script
::check
::check_moduleid_at_items
();
93 print "Checking StarRegistry ...\n";
94 par2script
::check
::check_registry_at_files
();
95 print "Checking Root Module ...";
96 par2script
::check
::check_rootmodule
();
97 print "Checking Shortcut assignments ...\n";
98 par2script
::check
::check_shortcut_assignments
();
99 print "Checking missing parents ...\n";
100 par2script
::check
::check_missing_parents
();
102 print "Shorten lines at modules\n";
103 par2script
::module
::shorten_lines_at_modules
();
105 # Now the script can be created
106 print "Creating setup script\n";
107 my $setupscript = par2script
::work
::create_script
();
109 print "Saving script\n";
110 par2script
::files
::save_file
($par2script::globals
::scriptname
, $setupscript);
113 if ($par2script::globals
::logging
)
115 par2script
::files
::save_file
($par2script::globals
::logfilename
, \
@par2script::globals
::logfileinfo
);
116 print "Log file written: $par2script::globals::logfilename\n";
119 ####################################
121 ####################################