diff options
author | David Tardon <dtardon@redhat.com> | 2012-05-12 17:05:57 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2012-05-29 07:34:20 +0200 |
commit | 78aab1de75c05b47dab5c883c474b0fb42be8eb9 (patch) | |
tree | 362150f2af13a46b2eff5e447275c6b920e5d4fe /solenv | |
parent | cdf8d40394e0b407d4958fcfa3b77bf9d4b0f259 (diff) |
allow to run par2script silently
Change-Id: Ib1d9cd1dc1e9c24a5a72c51060797f2214a95c89
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/bin/modules/par2script/check.pm | 2 | ||||
-rw-r--r-- | solenv/bin/modules/par2script/globals.pm | 2 | ||||
-rw-r--r-- | solenv/bin/modules/par2script/parameter.pm | 1 | ||||
-rw-r--r-- | solenv/bin/par2script.pl | 36 |
4 files changed, 22 insertions, 19 deletions
diff --git a/solenv/bin/modules/par2script/check.pm b/solenv/bin/modules/par2script/check.pm index 78808cee9191..3cfd9b374ab4 100644 --- a/solenv/bin/modules/par2script/check.pm +++ b/solenv/bin/modules/par2script/check.pm @@ -169,7 +169,7 @@ sub check_rootmodule die "\nERROR: Could not find Root module. Did not find module without ParentID or with empty ParentID.\n"; } - print " $rootgid\n"; + print " $rootgid\n" if $par2script::globals::verbose; } diff --git a/solenv/bin/modules/par2script/globals.pm b/solenv/bin/modules/par2script/globals.pm index 9a3c06f23879..82103c03b2ab 100644 --- a/solenv/bin/modules/par2script/globals.pm +++ b/solenv/bin/modules/par2script/globals.pm @@ -57,6 +57,8 @@ BEGIN $logfilename = "logfile.log"; # the default logfile name for global errors @logfileinfo = (); + $verbose = 1; + $multidefinitionerror = 0; $multiassignmenterror = 0; diff --git a/solenv/bin/modules/par2script/parameter.pm b/solenv/bin/modules/par2script/parameter.pm index 38a2d39dcb78..0c29339496f2 100644 --- a/solenv/bin/modules/par2script/parameter.pm +++ b/solenv/bin/modules/par2script/parameter.pm @@ -77,6 +77,7 @@ sub getparameter my $param = shift(@ARGV); if ($param eq "-o") { $par2script::globals::scriptname = shift(@ARGV); } + elsif ($param eq "-q") { $par2script::globals::verbose = 0; } elsif ($param eq "-v") { $par2script::globals::logging = 1; } elsif ($param =~ /\@\@/) { $par2script::globals::parfilelistorig = $param; } elsif ($param eq "-i") { $par2script::globals::includepathlist = shift(@ARGV); } diff --git a/solenv/bin/par2script.pl b/solenv/bin/par2script.pl index 1f4fdf4335ad..4ed0ed989fab 100644 --- a/solenv/bin/par2script.pl +++ b/solenv/bin/par2script.pl @@ -42,65 +42,65 @@ use par2script::work; par2script::parameter::getparameter(); par2script::parameter::control_parameter(); -par2script::parameter::outputparameter(); +par2script::parameter::outputparameter() if $par2script::globals::verbose; my $includes = par2script::work::setincludes($par2script::globals::includepathlist); my $parfiles = par2script::work::setparfiles($par2script::globals::parfilelist); par2script::work::make_complete_paths_for_parfiles($parfiles, $includes); -print "Reading par files\n"; +print "Reading par files\n" if $par2script::globals::verbose; my $parfilecontent = par2script::work::read_all_parfiles($parfiles); -print "Collecting items\n"; +print "Collecting items\n" if $par2script::globals::verbose; par2script::work::collect_definitions($parfilecontent); -print "Collecting assigned items\n"; +print "Collecting assigned items\n" if $par2script::globals::verbose; par2script::work::collect_assigned_gids(); # print "First control of multiple assignments\n"; # par2script::check::check_multiple_assignments(); -print "Searching for Undefinitions\n"; +print "Searching for Undefinitions\n" if $par2script::globals::verbose; par2script::undefine::undefine_gids($parfilecontent); par2script::undefine::remove_complete_item("Directory", $parfilecontent); par2script::undefine::remove_complete_item("Profile", $parfilecontent); -print "Removing assigned GIDs without definitions\n"; +print "Removing assigned GIDs without definitions\n" if $par2script::globals::verbose; par2script::module::remove_undefined_gids_from_modules(); -print "Adding definitions without assignment to the root\n"; +print "Adding definitions without assignment to the root\n" if $par2script::globals::verbose; par2script::module::add_to_root_module(); -print "Control of multiple assignments\n"; +print "Control of multiple assignments\n" if $par2script::globals::verbose; par2script::check::check_multiple_assignments(); -print "Control of definitions with missing assignments\n"; +print "Control of definitions with missing assignments\n" if $par2script::globals::verbose; par2script::check::check_missing_assignments(); # checking the setup script -print "Checking directory definitions ...\n"; +print "Checking directory definitions ...\n" if $par2script::globals::verbose; par2script::check::check_needed_directories(); par2script::check::check_directories_in_item_definitions(); -print "Checking module definitions ...\n"; +print "Checking module definitions ...\n" if $par2script::globals::verbose; par2script::check::check_module_existence(); -print "Checking module assignments ...\n"; +print "Checking module assignments ...\n" if $par2script::globals::verbose; par2script::check::check_moduleid_at_items(); -print "Checking Root Module ..."; +print "Checking Root Module ..." if $par2script::globals::verbose; par2script::check::check_rootmodule(); -print "Checking Shortcut assignments ...\n"; +print "Checking Shortcut assignments ...\n" if $par2script::globals::verbose; par2script::check::check_shortcut_assignments(); -print "Checking missing parents ...\n"; +print "Checking missing parents ...\n" if $par2script::globals::verbose; par2script::check::check_missing_parents(); -print "Shorten lines at modules\n"; +print "Shorten lines at modules\n" if $par2script::globals::verbose; par2script::module::shorten_lines_at_modules(); # Now the script can be created -print "Creating setup script\n"; +print "Creating setup script\n" if $par2script::globals::verbose; my $setupscript = par2script::work::create_script(); -print "Saving script\n"; +print "Saving script\n" if $par2script::globals::verbose; par2script::files::save_file($par2script::globals::scriptname, $setupscript); # logging, if set |