build.pl (b9fd132d) | build.pl (3dd3751b) |
---|---|
1: 2 eval 'exec perl -S $0 ${1+"$@"}' 3 if 0; 4#************************************************************** | 1: 2 eval 'exec perl -S $0 ${1+"$@"}' 3 if 0; 4#************************************************************** |
5# | 5# |
6# Licensed to the Apache Software Foundation (ASF) under one 7# or more contributor license agreements. See the NOTICE file 8# distributed with this work for additional information 9# regarding copyright ownership. The ASF licenses this file 10# to you under the Apache License, Version 2.0 (the 11# "License"); you may not use this file except in compliance 12# with the License. You may obtain a copy of the License at | 6# Licensed to the Apache Software Foundation (ASF) under one 7# or more contributor license agreements. See the NOTICE file 8# distributed with this work for additional information 9# regarding copyright ownership. The ASF licenses this file 10# to you under the Apache License, Version 2.0 (the 11# "License"); you may not use this file except in compliance 12# with the License. You may obtain a copy of the License at |
13# | 13# |
14# http://www.apache.org/licenses/LICENSE-2.0 | 14# http://www.apache.org/licenses/LICENSE-2.0 |
15# | 15# |
16# Unless required by applicable law or agreed to in writing, 17# software distributed under the License is distributed on an 18# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 19# KIND, either express or implied. See the License for the 20# specific language governing permissions and limitations 21# under the License. | 16# Unless required by applicable law or agreed to in writing, 17# software distributed under the License is distributed on an 18# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 19# KIND, either express or implied. See the License for the 20# specific language governing permissions and limitations 21# under the License. |
22# | 22# |
23#************************************************************** 24 25# 26# build - build entire project 27# 28 use strict; 29 use Config; 30 use POSIX; --- 7 unchanged lines hidden (view full) --- 38 use Fcntl; 39 use POSIX qw(:errno_h); 40 use Sys::Hostname; 41 42 use lib ("$ENV{SOLARENV}/bin/modules"); 43 use SourceConfig; 44 use RepositoryHelper; 45 use Cwd 'chdir'; | 23#************************************************************** 24 25# 26# build - build entire project 27# 28 use strict; 29 use Config; 30 use POSIX; --- 7 unchanged lines hidden (view full) --- 38 use Fcntl; 39 use POSIX qw(:errno_h); 40 use Sys::Hostname; 41 42 use lib ("$ENV{SOLARENV}/bin/modules"); 43 use SourceConfig; 44 use RepositoryHelper; 45 use Cwd 'chdir'; |
46 | 46 |
47 my $in_so_env = 0; 48 if (defined $ENV{COMMON_ENV_TOOLS}) { 49 unshift(@INC, "$ENV{COMMON_ENV_TOOLS}/modules"); 50 $in_so_env++; 51 }; 52 if (defined $ENV{CWS_WORK_STAMP}) { 53 require GenInfoParser; import GenInfoParser; 54 require IO::Handle; import IO::Handle; --- 18 unchanged lines hidden (view full) --- 73 my $script_rev = 0; 74 $id_str =~ /Revision:\s+(\S+)\s+\$/ 75 ? ($script_rev = $1) : ($script_rev = "-"); 76 77 print "$script_name -- version: $script_rev\n"; 78 79######################### 80# # | 47 my $in_so_env = 0; 48 if (defined $ENV{COMMON_ENV_TOOLS}) { 49 unshift(@INC, "$ENV{COMMON_ENV_TOOLS}/modules"); 50 $in_so_env++; 51 }; 52 if (defined $ENV{CWS_WORK_STAMP}) { 53 require GenInfoParser; import GenInfoParser; 54 require IO::Handle; import IO::Handle; --- 18 unchanged lines hidden (view full) --- 73 my $script_rev = 0; 74 $id_str =~ /Revision:\s+(\S+)\s+\$/ 75 ? ($script_rev = $1) : ($script_rev = "-"); 76 77 print "$script_name -- version: $script_rev\n"; 78 79######################### 80# # |
81# Globale Variablen # | 81# Global variables # |
82# # 83######################### 84 85 my $modules_number++; 86 my $perl = 'perl'; 87 my $remove_command = 'rm -rf'; 88 my $nul = '> /dev/null'; 89 --- 15 unchanged lines hidden (view full) --- 105 my $custom_job = ''; 106 my $post_custom_job = ''; 107 my %local_deps_hash = (); 108 my %path_hash = (); 109 my %platform_hash = (); 110 my %alive_dependencies = (); 111 my %global_deps_hash = (); # hash of dependencies of the all modules 112 my %global_deps_hash_backup = (); # backup hash of external dependencies of the all modules | 82# # 83######################### 84 85 my $modules_number++; 86 my $perl = 'perl'; 87 my $remove_command = 'rm -rf'; 88 my $nul = '> /dev/null'; 89 --- 15 unchanged lines hidden (view full) --- 105 my $custom_job = ''; 106 my $post_custom_job = ''; 107 my %local_deps_hash = (); 108 my %path_hash = (); 109 my %platform_hash = (); 110 my %alive_dependencies = (); 111 my %global_deps_hash = (); # hash of dependencies of the all modules 112 my %global_deps_hash_backup = (); # backup hash of external dependencies of the all modules |
113 my %module_deps_hash_backup = (); # backup hash of internal dependencies for aech module 114 my @broken_module_names = (); # array of modules, which cannot be built further | 113 my %module_deps_hash_backup = (); # backup hash of internal dependencies for each module 114 my @broken_module_names = (); # array of modules, which cannot be built further |
115 my @dmake_args = (); 116 my %dead_parents = (); 117 my $initial_module = ''; | 115 my @dmake_args = (); 116 my %dead_parents = (); 117 my $initial_module = ''; |
118 my $all_dependent = 1; # a flag indicating if the hash has independent keys | 118 my $all_dependent = 1; # a flag indicating if the hash has independent keys |
119 my $build_from_with_branches = ''; 120 my $build_all_cont = ''; 121 my $build_since = ''; 122 my $dlv_switch = ''; 123 my $child = 0; 124 my %processes_hash = (); 125 my %module_announced = (); 126 my $prepare = ''; # prepare for following incompatible build --- 9 unchanged lines hidden (view full) --- 136 my $maximal_processes = 0; # the max number of the processes run 137 my %modules_types = (); # modules types ('mod', 'img', 'lnk') hash 138 my %platforms = (); # platforms available or being working with 139 my %platforms_to_copy = (); # copy output trees for the platforms when --prepare 140 my $tmp_dir = get_tmp_dir(); # temp directory for checkout and other actions 141# $dmake_batch = undef; # 142 my @possible_build_lists = ('build.lst', 'build.xlist'); # build lists names 143 my %build_list_paths = (); # build lists names | 119 my $build_from_with_branches = ''; 120 my $build_all_cont = ''; 121 my $build_since = ''; 122 my $dlv_switch = ''; 123 my $child = 0; 124 my %processes_hash = (); 125 my %module_announced = (); 126 my $prepare = ''; # prepare for following incompatible build --- 9 unchanged lines hidden (view full) --- 136 my $maximal_processes = 0; # the max number of the processes run 137 my %modules_types = (); # modules types ('mod', 'img', 'lnk') hash 138 my %platforms = (); # platforms available or being working with 139 my %platforms_to_copy = (); # copy output trees for the platforms when --prepare 140 my $tmp_dir = get_tmp_dir(); # temp directory for checkout and other actions 141# $dmake_batch = undef; # 142 my @possible_build_lists = ('build.lst', 'build.xlist'); # build lists names 143 my %build_list_paths = (); # build lists names |
144 my %build_lists_hash = (); # hash of arrays $build_lists_hash{$module} = \($path, $xml_list_object) | 144 my %build_lists_hash = (); # hash of arrays $build_lists_hash{$module} = \($path, $xml_list_object) |
145 my $pre_job = 'announce'; # job to add for not-single module build 146 my $post_job = ''; # -"- 147 my @warnings = (); # array of warnings to be shown at the end of the process 148 my @errors = (); # array of errors to be shown at the end of the process 149 my %html_info = (); # hash containing all necessary info for generating of html page 150 my %module_by_hash = (); # hash containing all modules names as values and correspondent hashes as keys | 145 my $pre_job = 'announce'; # job to add for not-single module build 146 my $post_job = ''; # -"- 147 my @warnings = (); # array of warnings to be shown at the end of the process 148 my @errors = (); # array of errors to be shown at the end of the process 149 my %html_info = (); # hash containing all necessary info for generating of html page 150 my %module_by_hash = (); # hash containing all modules names as values and correspondent hashes as keys |
151 my %build_in_progress = (); # hash of modules currently being built | 151 my %build_in_progress = (); # hash of modules currently being built |
152 my %build_is_finished = (); # hash of already built modules 153 my %modules_with_errors = (); # hash of modules with build errors | 152 my %build_is_finished = (); # hash of already built modules 153 my %modules_with_errors = (); # hash of modules with build errors |
154 my %build_in_progress_shown = (); # hash of modules being built, | 154 my %build_in_progress_shown = (); # hash of modules being built, |
155 # and shown last time (to keep order) 156 my $build_time = time; 157 my $html_last_updated = 0; 158 my %jobs_hash = (); 159 my $html_path = undef; 160 my $build_finished = 0; 161 my $html_file = ''; | 155 # and shown last time (to keep order) 156 my $build_time = time; 157 my $html_last_updated = 0; 158 my %jobs_hash = (); 159 my $html_path = undef; 160 my $build_finished = 0; 161 my $html_file = ''; |
162 my %had_error = (); # hack for misteriuos windows problems - try run dmake 2 times if first time there was an error | 162 my %had_error = (); # hack for mysterious Windows problems - try run dmake 2 times if first time there was an error |
163 my $mkout = correct_path("$ENV{SOLARENV}/bin/mkout.pl"); 164 my %weights_hash = (); # hash contains info about how many modules are dependent from one module 165# %weight_stored = (); 166 my $grab_output = 1; 167 my $stop_build_on_error = 0; # for multiprocessing mode: do not build further module if there is an error 168 my $interactive = 0; # for interactive mode... (for testing purpose enabled by default) 169 my $parent_process = 1; 170 my $server_mode = 0; 171 my $setenv_string = ''; # string for configuration of the client environment 172 my $ports_string = ''; # string with possible ports for server 173 my @server_ports = (); 174 my $html_port = 0; 175 my $server_socket_obj = undef; # socket object for server 176 my $html_socket_obj = undef; # socket object for server 177 my %clients_jobs = (); 178 my %clients_times = (); | 163 my $mkout = correct_path("$ENV{SOLARENV}/bin/mkout.pl"); 164 my %weights_hash = (); # hash contains info about how many modules are dependent from one module 165# %weight_stored = (); 166 my $grab_output = 1; 167 my $stop_build_on_error = 0; # for multiprocessing mode: do not build further module if there is an error 168 my $interactive = 0; # for interactive mode... (for testing purpose enabled by default) 169 my $parent_process = 1; 170 my $server_mode = 0; 171 my $setenv_string = ''; # string for configuration of the client environment 172 my $ports_string = ''; # string with possible ports for server 173 my @server_ports = (); 174 my $html_port = 0; 175 my $server_socket_obj = undef; # socket object for server 176 my $html_socket_obj = undef; # socket object for server 177 my %clients_jobs = (); 178 my %clients_times = (); |
179 my $client_timeout = 0; # time for client to build (in sec)... | 179 my $client_timeout = 0; # time for client to build (in sec)... |
180 # The longest time period after that | 180 # The longest time period after that |
181 # the server considered as an error/client crash | 181 # the server considered as an error/client crash |
182 my %lost_client_jobs = (); # hash containing lost jobs 183 my %job_jobdir = (); # hash containing job-dir pairs 184 my $reschedule_queue = 0; 185 my %module_build_queue = (); 186 my %reversed_dependencies = (); | 182 my %lost_client_jobs = (); # hash containing lost jobs 183 my %job_jobdir = (); # hash containing job-dir pairs 184 my $reschedule_queue = 0; 185 my %module_build_queue = (); 186 my %reversed_dependencies = (); |
187 my %module_paths = (); # hash with absolute module paths | 187 my %module_paths = (); # hash with absolute module paths |
188 my %active_modules = (); 189 my $generate_config = 0; 190 my %add_to_config = (); 191 my %remove_from_config = (); 192 my $clear_config = 0; 193 my $finisched_children = 0; 194 my $debug = 0; 195 my %module_deps_hash_pids = (); --- 7 unchanged lines hidden (view full) --- 203 my $dmake_args = ''; 204 my $echo = ''; 205 my $new_line = "\n"; 206 my $incompatible = 0; 207 my $local_host_ip = 'localhost'; 208### main ### 209 210 get_options(); | 188 my %active_modules = (); 189 my $generate_config = 0; 190 my %add_to_config = (); 191 my %remove_from_config = (); 192 my $clear_config = 0; 193 my $finisched_children = 0; 194 my $debug = 0; 195 my %module_deps_hash_pids = (); --- 7 unchanged lines hidden (view full) --- 203 my $dmake_args = ''; 204 my $echo = ''; 205 my $new_line = "\n"; 206 my $incompatible = 0; 207 my $local_host_ip = 'localhost'; 208### main ### 209 210 get_options(); |
211 | 211 |
212# my $temp_html_file = correct_path($tmp_dir. '/' . $ENV{INPATH}. '.build.html'); 213 get_build_modes(); 214 my %deliver_env = (); 215 if ($prepare) { 216 get_platforms(\%platforms); 217 218 $deliver_env{'BUILD_SOSL'}++; 219 $deliver_env{'COMMON_OUTDIR'}++; 220 $deliver_env{'GUI'}++; 221 $deliver_env{'INPATH'}++; 222 $deliver_env{'OFFENV_PATH'}++; 223 $deliver_env{'OUTPATH'}++; 224 $deliver_env{'L10N_framework'}++; 225 }; | 212# my $temp_html_file = correct_path($tmp_dir. '/' . $ENV{INPATH}. '.build.html'); 213 get_build_modes(); 214 my %deliver_env = (); 215 if ($prepare) { 216 get_platforms(\%platforms); 217 218 $deliver_env{'BUILD_SOSL'}++; 219 $deliver_env{'COMMON_OUTDIR'}++; 220 $deliver_env{'GUI'}++; 221 $deliver_env{'INPATH'}++; 222 $deliver_env{'OFFENV_PATH'}++; 223 $deliver_env{'OUTPATH'}++; 224 $deliver_env{'L10N_framework'}++; 225 }; |
226 my $workspace_path = get_workspace_path(); # This also sets $initial_module | 226 my $workspace_path = get_workspace_path(); # This also sets $initial_module |
227 my @additional_repositories = (); 228 229 # Collect additional repository directories from the ADDITIONAL_REPOSITORIES 230 # environment variable (typically set by configure). 231 foreach my $additional_repository (split(" ", $ENV{ADDITIONAL_REPOSITORIES})) 232 { 233 next if $additional_repository eq ""; 234 # The repository path is expected to be relative to the workspace_path. 235 # For support of absolute paths we need functionality to distinguish between 236 # relative and absolute paths (provided by File::Spec). 237 my $path = Cwd::realpath(correct_path($workspace_path . "/" . $additional_repository)); 238 if ( -d $path) 239 { 240 push @additional_repositories, $path; 241 } 242 } 243 244 my $source_config = SourceConfig -> new($workspace_path, @additional_repositories); 245 check_partial_gnumake_build($initial_module); | 227 my @additional_repositories = (); 228 229 # Collect additional repository directories from the ADDITIONAL_REPOSITORIES 230 # environment variable (typically set by configure). 231 foreach my $additional_repository (split(" ", $ENV{ADDITIONAL_REPOSITORIES})) 232 { 233 next if $additional_repository eq ""; 234 # The repository path is expected to be relative to the workspace_path. 235 # For support of absolute paths we need functionality to distinguish between 236 # relative and absolute paths (provided by File::Spec). 237 my $path = Cwd::realpath(correct_path($workspace_path . "/" . $additional_repository)); 238 if ( -d $path) 239 { 240 push @additional_repositories, $path; 241 } 242 } 243 244 my $source_config = SourceConfig -> new($workspace_path, @additional_repositories); 245 check_partial_gnumake_build($initial_module); |
246 | 246 |
247 if ($html) { 248 if (defined $html_path) { 249 $html_file = correct_path($html_path . '/' . $ENV{INPATH}. '.build.html'); 250 } else { 251 my $log_directory = Cwd::realpath(correct_path($workspace_path . '/..')) . '/log'; 252 if ((!-d $log_directory) && (!mkdir($log_directory))) { 253 print_error("Cannot create $log_directory for writing html file\n"); 254 }; --- 30 unchanged lines hidden (view full) --- 285 }; 286# } elsif ($show) { 287# select STDOUT; 288 }; 289 290 print $new_line; 291 get_server_ports(); 292 start_interactive() if ($interactive); | 247 if ($html) { 248 if (defined $html_path) { 249 $html_file = correct_path($html_path . '/' . $ENV{INPATH}. '.build.html'); 250 } else { 251 my $log_directory = Cwd::realpath(correct_path($workspace_path . '/..')) . '/log'; 252 if ((!-d $log_directory) && (!mkdir($log_directory))) { 253 print_error("Cannot create $log_directory for writing html file\n"); 254 }; --- 30 unchanged lines hidden (view full) --- 285 }; 286# } elsif ($show) { 287# select STDOUT; 288 }; 289 290 print $new_line; 291 get_server_ports(); 292 start_interactive() if ($interactive); |
293 | 293 |
294 if ($checkparents) { 295 get_parent_deps( $initial_module, \%global_deps_hash ); 296 } else { 297 build_all(); 298 } 299 if (scalar keys %broken_build) { 300 cancel_build(); 301# } elsif (!$custom_job && $post_custom_job) { --- 45 unchanged lines hidden (view full) --- 347 if (scalar @warnings) { 348 print STDERR "\nWARNING(S):\n"; 349 print STDERR $_ foreach (@warnings); 350 }; 351}; 352 353sub rename_file { 354 my ($old_file_name, $new_file_name, $throw_error) = @_; | 294 if ($checkparents) { 295 get_parent_deps( $initial_module, \%global_deps_hash ); 296 } else { 297 build_all(); 298 } 299 if (scalar keys %broken_build) { 300 cancel_build(); 301# } elsif (!$custom_job && $post_custom_job) { --- 45 unchanged lines hidden (view full) --- 347 if (scalar @warnings) { 348 print STDERR "\nWARNING(S):\n"; 349 print STDERR $_ foreach (@warnings); 350 }; 351}; 352 353sub rename_file { 354 my ($old_file_name, $new_file_name, $throw_error) = @_; |
355 | 355 |
356 if(-e $old_file_name) { 357 rename($old_file_name, $new_file_name) or system("mv", $old_file_name, $new_file_name); 358 if (-e $old_file_name) { 359 system("rm -rf $old_file_name") if (!unlink $old_file_name); 360 }; 361 } elsif ($throw_error) { 362 print_error("No such file $old_file_name"); 363 }; --- 45 unchanged lines hidden (view full) --- 409 close($new_socket_obj); 410 } else { 411 sleep(10); 412 }; 413 } while(1); 414}; 415 416sub start_html_message_trigger { | 356 if(-e $old_file_name) { 357 rename($old_file_name, $new_file_name) or system("mv", $old_file_name, $new_file_name); 358 if (-e $old_file_name) { 359 system("rm -rf $old_file_name") if (!unlink $old_file_name); 360 }; 361 } elsif ($throw_error) { 362 print_error("No such file $old_file_name"); 363 }; --- 45 unchanged lines hidden (view full) --- 409 close($new_socket_obj); 410 } else { 411 sleep(10); 412 }; 413 } while(1); 414}; 415 416sub start_html_message_trigger { |
417 my $child_id=fork(); ### VG: for windows there is a "simulation of the "fork"", no new procs... One can use Win32::Process::Create 418 | 417 my $child_id=fork(); ### VG: for Windows there is a "simulation of the "fork"", no new procs... One can use Win32::Process::Create 418 |
419 if ($child_id) { | 419 if ($child_id) { |
420 # parent | 420 # parent |
421# print "started listener trigger\n"; 422 } else { 423 my $buffer_size = 1024; 424 my $buffer; 425 my $rv; 426 my $full_buffer = ''; 427 my %modules_to_rebuild = (); 428 my $paddr; --- 11 unchanged lines hidden (view full) --- 440 die "Child connect: $!"; 441 }; 442 } 443 _exit(0); 444 }; 445}; 446 447sub get_html_orders { | 421# print "started listener trigger\n"; 422 } else { 423 my $buffer_size = 1024; 424 my $buffer; 425 my $rv; 426 my $full_buffer = ''; 427 my %modules_to_rebuild = (); 428 my $paddr; --- 11 unchanged lines hidden (view full) --- 440 die "Child connect: $!"; 441 }; 442 } 443 _exit(0); 444 }; 445}; 446 447sub get_html_orders { |
448 return if (!$interactive); | 448 return if (!$interactive); |
449 my $buffer_size = 1024; 450 my $buffer; 451 my $rv; 452 my $full_buffer = ''; 453 my %modules_to_rebuild = (); 454 my %modules_to_delete = (); 455 while ($rv = sysread(HTML_PIPE, $buffer, $buffer_size)) { 456 $full_buffer .= $buffer; --- 80 unchanged lines hidden (view full) --- 537 if (defined ${$global_deps_hash_backup{$_}}{$module} && (!defined $build_is_finished{$module})) { 538 $single_module_dep_hash{$module}++; 539 }; 540 }; 541 $global_deps_hash{$_} = \%single_module_dep_hash; 542 }; 543 }; 544}; | 449 my $buffer_size = 1024; 450 my $buffer; 451 my $rv; 452 my $full_buffer = ''; 453 my %modules_to_rebuild = (); 454 my %modules_to_delete = (); 455 while ($rv = sysread(HTML_PIPE, $buffer, $buffer_size)) { 456 $full_buffer .= $buffer; --- 80 unchanged lines hidden (view full) --- 537 if (defined ${$global_deps_hash_backup{$_}}{$module} && (!defined $build_is_finished{$module})) { 538 $single_module_dep_hash{$module}++; 539 }; 540 }; 541 $global_deps_hash{$_} = \%single_module_dep_hash; 542 }; 543 }; 544}; |
545 546 | 545 546 |
547# 548# procedure retrieves build list path 549# (all possibilities are taken into account) 550# 551sub get_build_list_path { 552 my $module = shift; 553 return $build_list_paths{$module} if (defined $build_list_paths{$module}); 554 my @possible_dirs = ($module, $module. '.lnk', $module. '.link'); --- 10 unchanged lines hidden (view full) --- 565 } 566 print_error("There's no build list for $module"); 567 }; 568 }; 569 $dead_parents{$module}++; 570 $build_list_paths{$module} = correct_path(retrieve_build_list($module)) if (!defined $build_list_paths{$module}); 571 return $build_list_paths{$module}; 572}; | 547# 548# procedure retrieves build list path 549# (all possibilities are taken into account) 550# 551sub get_build_list_path { 552 my $module = shift; 553 return $build_list_paths{$module} if (defined $build_list_paths{$module}); 554 my @possible_dirs = ($module, $module. '.lnk', $module. '.link'); --- 10 unchanged lines hidden (view full) --- 565 } 566 print_error("There's no build list for $module"); 567 }; 568 }; 569 $dead_parents{$module}++; 570 $build_list_paths{$module} = correct_path(retrieve_build_list($module)) if (!defined $build_list_paths{$module}); 571 return $build_list_paths{$module}; 572}; |
573 | 573 |
574# 575# Get dependencies hash of the current and all parent projects 576# 577sub get_parent_deps { 578 my $prj_dir = shift; 579 my $deps_hash = shift; 580 my @unresolved_parents = ($prj_dir); 581 my %skipped_branches = (); --- 32 unchanged lines hidden (view full) --- 614 foreach my $dependency (keys %$module_deps_hash) { 615 $weights_hash{$dependency}++; 616 }; 617 }; 618 }; 619}; 620 621# | 574# 575# Get dependencies hash of the current and all parent projects 576# 577sub get_parent_deps { 578 my $prj_dir = shift; 579 my $deps_hash = shift; 580 my @unresolved_parents = ($prj_dir); 581 my %skipped_branches = (); --- 32 unchanged lines hidden (view full) --- 614 foreach my $dependency (keys %$module_deps_hash) { 615 $weights_hash{$dependency}++; 616 }; 617 }; 618 }; 619}; 620 621# |
622# This procedure builds comlete dependency for each module, ie if the deps look like: 623# mod1 -> mod2 -> mod3 -> mod4,mod5, 624# than mod1 get mod3,mod4,mod5 as eplicit list of deps, not only mod2 as earlier | 622# This procedure builds complete dependency for each module, i.e. if the deps look like: 623# mod1 -> mod2 -> mod3 -> mod4,mod5, 624# then mod1 get mod3,mod4,mod5 as explicit list of deps, not only mod2 as earlier |
625# 626sub expand_dependencies { 627 my $deps_hash = shift; 628 629 foreach my $module1 (keys %$deps_hash) { 630 foreach my $module2 (keys %$deps_hash) { 631 next if ($module1 eq $module2); 632 if (defined ${$$deps_hash{$module2}}{$module1}) { 633 ${$$deps_hash{$module2}}{$_}++ foreach (keys %{$$deps_hash{$module1}}) 634 }; 635 }; 636 }; 637}; 638 639# 640# This procedure fills the second hash with reversed dependencies, | 625# 626sub expand_dependencies { 627 my $deps_hash = shift; 628 629 foreach my $module1 (keys %$deps_hash) { 630 foreach my $module2 (keys %$deps_hash) { 631 next if ($module1 eq $module2); 632 if (defined ${$$deps_hash{$module2}}{$module1}) { 633 ${$$deps_hash{$module2}}{$_}++ foreach (keys %{$$deps_hash{$module1}}) 634 }; 635 }; 636 }; 637}; 638 639# 640# This procedure fills the second hash with reversed dependencies, |
641# ie, with info about modules "waiting" for the module | 641# i.e. with info about modules "waiting" for the module |
642# 643sub reverse_dependensies { 644 my ($deps_hash, $reversed) = @_; 645 foreach my $module (keys %$deps_hash) { 646 foreach (keys %{$$deps_hash{$module}}) { 647 if (defined $$reversed{$_}) { 648 ${$$reversed{$_}}{$module}++ 649 } else { 650 my %single_module_dep_hash = ($module => 1); 651 $$reversed{$_} = \%single_module_dep_hash; | 642# 643sub reverse_dependensies { 644 my ($deps_hash, $reversed) = @_; 645 foreach my $module (keys %$deps_hash) { 646 foreach (keys %{$$deps_hash{$module}}) { 647 if (defined $$reversed{$_}) { 648 ${$$reversed{$_}}{$module}++ 649 } else { 650 my %single_module_dep_hash = ($module => 1); 651 $$reversed{$_} = \%single_module_dep_hash; |
652 }; | 652 }; |
653 }; 654 }; 655}; 656 657# 658# Build everything that should be built 659# 660sub build_all { --- 42 unchanged lines hidden (view full) --- 703 if ($processes_to_run) { 704 build_multiprocessing(); 705 return; 706 }; 707 if ($server_mode) { 708 run_server(); 709 }; 710 while ($prj = pick_prj_to_build(\%global_deps_hash)) { | 653 }; 654 }; 655}; 656 657# 658# Build everything that should be built 659# 660sub build_all { --- 42 unchanged lines hidden (view full) --- 703 if ($processes_to_run) { 704 build_multiprocessing(); 705 return; 706 }; 707 if ($server_mode) { 708 run_server(); 709 }; 710 while ($prj = pick_prj_to_build(\%global_deps_hash)) { |
711 if (!defined $dead_parents{$prj}) { | 711 if (!defined $dead_parents{$prj}) { |
712 if (scalar keys %broken_build) { 713 print $echo . "Skipping project $prj because of error(s)\n"; 714 remove_from_dependencies($prj, \%global_deps_hash); 715 $build_is_finished{$prj}++; 716 next; 717 }; 718 719 $prj_dir = $module_paths{$prj}; 720 get_module_dep_hash($prj, \%local_deps_hash); 721 my $info_hash = $html_info{$prj}; 722 $$info_hash{DIRS} = check_deps_hash(\%local_deps_hash, $prj); 723 $module_by_hash{\%local_deps_hash} = $prj; 724 build_dependent(\%local_deps_hash); 725 print $check_error_string; 726 }; | 712 if (scalar keys %broken_build) { 713 print $echo . "Skipping project $prj because of error(s)\n"; 714 remove_from_dependencies($prj, \%global_deps_hash); 715 $build_is_finished{$prj}++; 716 next; 717 }; 718 719 $prj_dir = $module_paths{$prj}; 720 get_module_dep_hash($prj, \%local_deps_hash); 721 my $info_hash = $html_info{$prj}; 722 $$info_hash{DIRS} = check_deps_hash(\%local_deps_hash, $prj); 723 $module_by_hash{\%local_deps_hash} = $prj; 724 build_dependent(\%local_deps_hash); 725 print $check_error_string; 726 }; |
727 | 727 |
728 remove_from_dependencies($prj, \%global_deps_hash); 729 $build_is_finished{$prj}++; 730 }; 731 } else { 732 store_build_list_content($initial_module); 733 get_module_dep_hash($initial_module, \%local_deps_hash); 734 initialize_html_info($initial_module); 735 my $info_hash = $html_info{$initial_module}; --- 16 unchanged lines hidden (view full) --- 752 }; 753}; 754 755sub initialize_html_info { 756 my $module = shift; 757 return if (defined $dead_parents{$module}); 758 $html_info{$module} = { 'DIRS' => [], 759 'ERRORFUL' => [], | 728 remove_from_dependencies($prj, \%global_deps_hash); 729 $build_is_finished{$prj}++; 730 }; 731 } else { 732 store_build_list_content($initial_module); 733 get_module_dep_hash($initial_module, \%local_deps_hash); 734 initialize_html_info($initial_module); 735 my $info_hash = $html_info{$initial_module}; --- 16 unchanged lines hidden (view full) --- 752 }; 753}; 754 755sub initialize_html_info { 756 my $module = shift; 757 return if (defined $dead_parents{$module}); 758 $html_info{$module} = { 'DIRS' => [], 759 'ERRORFUL' => [], |
760 'SUCCESSFUL' => [], | 760 'SUCCESSFUL' => [], |
761 'BUILD_TIME' => 0}; 762} 763 764# | 761 'BUILD_TIME' => 0}; 762} 763 764# |
765# Do job | 765# Do job |
766# 767sub dmake_dir { 768 my ($new_job_name, $error_code); 769 my $job_name = shift; 770 $jobs_hash{$job_name}->{START_TIME} = time(); 771 $jobs_hash{$job_name}->{STATUS} = 'building'; 772 if ($job_name =~ /(\s)/o && (!-d $job_name)) { 773 $error_code = do_custom_job($job_name, \%local_deps_hash); --- 20 unchanged lines hidden (view full) --- 794 print "\n" if ( ! $show ); 795 print "Entering $job_name\n"; 796 }; 797 remove_from_dependencies($job_name, \%local_deps_hash) if (!$child); 798 return if ($cmd_file || $show); 799 $error_code = run_job($dmake, $job_name); 800 html_store_job_info(\%local_deps_hash, $job_name, $error_code) if (!$child); 801 }; | 766# 767sub dmake_dir { 768 my ($new_job_name, $error_code); 769 my $job_name = shift; 770 $jobs_hash{$job_name}->{START_TIME} = time(); 771 $jobs_hash{$job_name}->{STATUS} = 'building'; 772 if ($job_name =~ /(\s)/o && (!-d $job_name)) { 773 $error_code = do_custom_job($job_name, \%local_deps_hash); --- 20 unchanged lines hidden (view full) --- 794 print "\n" if ( ! $show ); 795 print "Entering $job_name\n"; 796 }; 797 remove_from_dependencies($job_name, \%local_deps_hash) if (!$child); 798 return if ($cmd_file || $show); 799 $error_code = run_job($dmake, $job_name); 800 html_store_job_info(\%local_deps_hash, $job_name, $error_code) if (!$child); 801 }; |
802 | 802 |
803 if ($error_code && $ignore) { 804 push(@ignored_errors, $job_name); 805 $error_code = 0; 806 }; 807 if ($child) { 808 my $oldfh = select STDERR; 809 $| = 1; 810 select $oldfh; --- 39 unchanged lines hidden (view full) --- 850} 851# 852# Get string (list) of parent projects to build 853# 854sub get_parents_array { 855 my $module = shift; 856 store_build_list_content($module); 857 my $build_list_ref = $build_lists_hash{$module}; | 803 if ($error_code && $ignore) { 804 push(@ignored_errors, $job_name); 805 $error_code = 0; 806 }; 807 if ($child) { 808 my $oldfh = select STDERR; 809 $| = 1; 810 select $oldfh; --- 39 unchanged lines hidden (view full) --- 850} 851# 852# Get string (list) of parent projects to build 853# 854sub get_parents_array { 855 my $module = shift; 856 store_build_list_content($module); 857 my $build_list_ref = $build_lists_hash{$module}; |
858 | 858 |
859 if (ref($build_list_ref) eq 'XMLBuildListParser') { 860 return $build_list_ref->getModuleDependencies(\@modes_array); 861 }; 862 foreach (@$build_list_ref) { 863 if ($_ =~ /#/) { 864 if ($`) { 865 $_ = $`; 866 } else { --- 36 unchanged lines hidden (view full) --- 903# 904sub get_deps_from_object { 905 my ($module, $build_list_object, $dependencies_hash) = @_; 906 907 foreach my $dir ($build_list_object->getJobDirectories("make", $ENV{GUI})) { 908 $path_hash{$dir} = $module_paths{$module}; 909 $path_hash{$dir} .= $dir if ($dir ne '/'); 910 my %deps_hash = (); | 859 if (ref($build_list_ref) eq 'XMLBuildListParser') { 860 return $build_list_ref->getModuleDependencies(\@modes_array); 861 }; 862 foreach (@$build_list_ref) { 863 if ($_ =~ /#/) { 864 if ($`) { 865 $_ = $`; 866 } else { --- 36 unchanged lines hidden (view full) --- 903# 904sub get_deps_from_object { 905 my ($module, $build_list_object, $dependencies_hash) = @_; 906 907 foreach my $dir ($build_list_object->getJobDirectories("make", $ENV{GUI})) { 908 $path_hash{$dir} = $module_paths{$module}; 909 $path_hash{$dir} .= $dir if ($dir ne '/'); 910 my %deps_hash = (); |
911 | 911 |
912 foreach my $dep ($build_list_object->getJobDependencies($dir, "make", $ENV{GUI})) { 913 $deps_hash{$dep}++; 914 }; 915 $$dependencies_hash{$dir} = \%deps_hash; 916 }; 917}; 918 919# | 912 foreach my $dep ($build_list_object->getJobDependencies($dir, "make", $ENV{GUI})) { 913 $deps_hash{$dep}++; 914 }; 915 $$dependencies_hash{$dir} = \%deps_hash; 916 }; 917}; 918 919# |
920# this function wraps the get_module_dep_hash and backups the resultung hash | 920# this function wraps the get_module_dep_hash and backups the resulting hash |
921# 922sub get_module_dep_hash { 923 my ($module, $module_dep_hash) = @_; 924 if (defined $module_deps_hash_backup{$module}) { 925 backup_deps_hash($module_deps_hash_backup{$module}, $module_dep_hash); 926 } else { 927 get_deps_hash($module, $module_dep_hash); 928 my %values_hash = (); --- 101 unchanged lines hidden (view full) --- 1030 add_dependent_job($dependencies_hash, $module_to_build, $custom_job); 1031 add_dependent_job($dependencies_hash, $module_to_build, $post_job) if ($module_to_build ne $initial_module); 1032 add_dependent_job($dependencies_hash, $module_to_build, $post_custom_job); 1033 }; 1034 store_weights($dependencies_hash); 1035}; 1036 1037# | 921# 922sub get_module_dep_hash { 923 my ($module, $module_dep_hash) = @_; 924 if (defined $module_deps_hash_backup{$module}) { 925 backup_deps_hash($module_deps_hash_backup{$module}, $module_dep_hash); 926 } else { 927 get_deps_hash($module, $module_dep_hash); 928 my %values_hash = (); --- 101 unchanged lines hidden (view full) --- 1030 add_dependent_job($dependencies_hash, $module_to_build, $custom_job); 1031 add_dependent_job($dependencies_hash, $module_to_build, $post_job) if ($module_to_build ne $initial_module); 1032 add_dependent_job($dependencies_hash, $module_to_build, $post_custom_job); 1033 }; 1034 store_weights($dependencies_hash); 1035}; 1036 1037# |
1038# procedure adds which is independent from anothers, but anothers are dependent from it | 1038# procedure adds a job which is independent from others, but others are dependent from it |
1039# 1040sub add_prerequisite_job { 1041 my ($dependencies_hash, $module, $job) = @_; 1042 return if (!$job); 1043 $job = "$module $job"; 1044 foreach (keys %$dependencies_hash) { 1045 my $deps_hash = $$dependencies_hash{$_}; 1046 $$deps_hash{$job}++; --- 79 unchanged lines hidden (view full) --- 1126 1127 if ($cmd_file) { 1128 if ($ENV{GUI} eq 'UNX') { 1129 $check_error_string = "if \"\$?\" != \"0\" exit\n"; 1130 } else { 1131 $check_error_string = "if \"\%?\" != \"0\" quit\n"; 1132 }; 1133 }; | 1039# 1040sub add_prerequisite_job { 1041 my ($dependencies_hash, $module, $job) = @_; 1042 return if (!$job); 1043 $job = "$module $job"; 1044 foreach (keys %$dependencies_hash) { 1045 my $deps_hash = $$dependencies_hash{$_}; 1046 $$deps_hash{$job}++; --- 79 unchanged lines hidden (view full) --- 1126 1127 if ($cmd_file) { 1128 if ($ENV{GUI} eq 'UNX') { 1129 $check_error_string = "if \"\$?\" != \"0\" exit\n"; 1130 } else { 1131 $check_error_string = "if \"\%?\" != \"0\" quit\n"; 1132 }; 1133 }; |
1134 | 1134 |
1135 $dmake_args = join(' ', 'dmake', @dmake_args); | 1135 $dmake_args = join(' ', 'dmake', @dmake_args); |
1136 | 1136 |
1137 while ($arg = pop(@dmake_args)) { 1138 $dmake .= ' '.$arg; 1139 }; 1140 $dmake .= ' verbose=true' if ($html); 1141}; 1142 1143# 1144# Procedure retrieves list of projects to be built from build.lst --- 422 unchanged lines hidden (view full) --- 1567 print_error('Switch --skip is for building multiple modules only!!') if ((scalar keys %skip_modules) && (!$build_all_parents)); 1568# print_error('Please prepare the workspace on one of UNIX platforms') if ($prepare && ($ENV{GUI} ne 'UNX')); 1569 print_error('Switches --with_branches and --since collision') if ($build_from_with_branches && $build_since); 1570 if ($show) { 1571 $processes_to_run = 0; 1572 $cmd_file = ''; 1573 }; 1574 print_error('Switches --job and --deliver collision') if ($custom_job && $deliver); | 1137 while ($arg = pop(@dmake_args)) { 1138 $dmake .= ' '.$arg; 1139 }; 1140 $dmake .= ' verbose=true' if ($html); 1141}; 1142 1143# 1144# Procedure retrieves list of projects to be built from build.lst --- 422 unchanged lines hidden (view full) --- 1567 print_error('Switch --skip is for building multiple modules only!!') if ((scalar keys %skip_modules) && (!$build_all_parents)); 1568# print_error('Please prepare the workspace on one of UNIX platforms') if ($prepare && ($ENV{GUI} ne 'UNX')); 1569 print_error('Switches --with_branches and --since collision') if ($build_from_with_branches && $build_since); 1570 if ($show) { 1571 $processes_to_run = 0; 1572 $cmd_file = ''; 1573 }; 1574 print_error('Switches --job and --deliver collision') if ($custom_job && $deliver); |
1575 $custom_job = 'deliver' if $deliver; | 1575 $custom_job = 'deliver' if $deliver; |
1576 $post_job = 'deliver' if (!$custom_job); 1577 $incompatible = scalar keys %incompatibles; 1578 if ($prepare) { 1579 print_error("--prepare is for use with --from switch only!\n") if (!$incompatible); 1580 }; 1581 if ($processes_to_run) { 1582 if ($ignore && !$html) { 1583 print_error("Cannot ignore errors in multiprocessing build"); --- 30 unchanged lines hidden (view full) --- 1614 $only_common = 'common'; 1615 $only_common .= '.pro' if ($only_platform =~ /\.pro$/); 1616 }; 1617 if ($interactive) { 1618 $html++; # enable html page generation... 1619 my $local_host_name = hostname(); 1620 $local_host_ip = inet_ntoa(scalar(gethostbyname($local_host_name)) || 'localhost'); 1621 } | 1576 $post_job = 'deliver' if (!$custom_job); 1577 $incompatible = scalar keys %incompatibles; 1578 if ($prepare) { 1579 print_error("--prepare is for use with --from switch only!\n") if (!$incompatible); 1580 }; 1581 if ($processes_to_run) { 1582 if ($ignore && !$html) { 1583 print_error("Cannot ignore errors in multiprocessing build"); --- 30 unchanged lines hidden (view full) --- 1614 $only_common = 'common'; 1615 $only_common .= '.pro' if ($only_platform =~ /\.pro$/); 1616 }; 1617 if ($interactive) { 1618 $html++; # enable html page generation... 1619 my $local_host_name = hostname(); 1620 $local_host_ip = inet_ntoa(scalar(gethostbyname($local_host_name)) || 'localhost'); 1621 } |
1622 # Default build modes(for OpenOffice.org) | 1622 # Default build modes (for OpenOffice.org) |
1623 $ENV{BUILD_TYPE} = 'OOo EXT' if (!defined $ENV{BUILD_TYPE}); 1624 @ARGV = @dmake_args; 1625 foreach $arg (@dmake_args) { 1626 $arg =~ /^verbose=(\S+)$/i and $verbose_mode = ($1 =~ /^t\S*$/i); 1627 } 1628}; 1629 1630sub get_module_and_buildlist_paths { --- 9 unchanged lines hidden (view full) --- 1640 } 1641 $dead_parents{$_}++ foreach (keys %active_modules_copy); 1642 }; 1643}; 1644 1645 1646sub get_dmake_args { 1647 my $arg; | 1623 $ENV{BUILD_TYPE} = 'OOo EXT' if (!defined $ENV{BUILD_TYPE}); 1624 @ARGV = @dmake_args; 1625 foreach $arg (@dmake_args) { 1626 $arg =~ /^verbose=(\S+)$/i and $verbose_mode = ($1 =~ /^t\S*$/i); 1627 } 1628}; 1629 1630sub get_module_and_buildlist_paths { --- 9 unchanged lines hidden (view full) --- 1640 } 1641 $dead_parents{$_}++ foreach (keys %active_modules_copy); 1642 }; 1643}; 1644 1645 1646sub get_dmake_args { 1647 my $arg; |
1648 my @job_args = (); | 1648 my @job_args = (); |
1649 while ($arg = shift @ARGV) { 1650 next if ($arg =~ /^--$/); 1651 push (@job_args, $arg); 1652 }; 1653 return @job_args; 1654}; 1655 1656# --- 76 unchanged lines hidden (view full) --- 1733 $had_error{$child_nick}++; 1734 return 1; 1735 }; 1736 }; 1737 $modules_with_errors{$folders_hashes{$child_nick}}++; 1738 $broken_build{$child_nick} = $error_code; 1739 if ($stop_build_on_error) { 1740 clear_from_child($pid); | 1649 while ($arg = shift @ARGV) { 1650 next if ($arg =~ /^--$/); 1651 push (@job_args, $arg); 1652 }; 1653 return @job_args; 1654}; 1655 1656# --- 76 unchanged lines hidden (view full) --- 1733 $had_error{$child_nick}++; 1734 return 1; 1735 }; 1736 }; 1737 $modules_with_errors{$folders_hashes{$child_nick}}++; 1738 $broken_build{$child_nick} = $error_code; 1739 if ($stop_build_on_error) { 1740 clear_from_child($pid); |
1741 # Let all children finish their work | 1741 # Let all children finish their work |
1742 while (children_number()) { 1743 handle_dead_children(1); 1744 }; 1745 cancel_build(); 1746 }; 1747 return 0; 1748}; 1749 --- 22 unchanged lines hidden (view full) --- 1772 }; 1773 $finisched_children++; 1774 }; 1775 } while(children_number() >= $processes_to_run); 1776}; 1777 1778sub give_second_chance { 1779 my $pid = shift; | 1742 while (children_number()) { 1743 handle_dead_children(1); 1744 }; 1745 cancel_build(); 1746 }; 1747 return 0; 1748}; 1749 --- 22 unchanged lines hidden (view full) --- 1772 }; 1773 $finisched_children++; 1774 }; 1775 } while(children_number() >= $processes_to_run); 1776}; 1777 1778sub give_second_chance { 1779 my $pid = shift; |
1780 # A malicious hack for mysterious windows problems - try 2 times | 1780 # A malicious hack for mysterious Windows problems - try 2 times |
1781 # to run dmake in the same directory if errors occurs 1782 my $child_nick = $processes_hash{$pid}; 1783 $running_children{$folders_hashes{$child_nick}}--; 1784 delete $processes_hash{$pid}; 1785 start_child($child_nick, $folders_hashes{$child_nick}); 1786}; 1787 1788sub clear_from_child { --- 138 unchanged lines hidden (view full) --- 1927 build_actual_queue(\%module_build_queue); 1928 } while (scalar keys %global_deps_hash); 1929 # Let the last module be built till the end 1930 while (scalar keys %module_build_queue) { 1931 build_actual_queue(\%module_build_queue); 1932# print "#### 1988: Starting waiting for dead child\n"; 1933 handle_dead_children(1); 1934 }; | 1781 # to run dmake in the same directory if errors occurs 1782 my $child_nick = $processes_hash{$pid}; 1783 $running_children{$folders_hashes{$child_nick}}--; 1784 delete $processes_hash{$pid}; 1785 start_child($child_nick, $folders_hashes{$child_nick}); 1786}; 1787 1788sub clear_from_child { --- 138 unchanged lines hidden (view full) --- 1927 build_actual_queue(\%module_build_queue); 1928 } while (scalar keys %global_deps_hash); 1929 # Let the last module be built till the end 1930 while (scalar keys %module_build_queue) { 1931 build_actual_queue(\%module_build_queue); 1932# print "#### 1988: Starting waiting for dead child\n"; 1933 handle_dead_children(1); 1934 }; |
1935 # Let all children finish their work | 1935 # Let all children finish their work |
1936 while (children_number()) { 1937 handle_dead_children(1); 1938 }; 1939 cancel_build() if (scalar keys %broken_build); 1940 mp_success_exit(); 1941}; 1942 1943sub mp_success_exit { --- 6 unchanged lines hidden (view full) --- 1950 do_exit(0); 1951}; 1952 1953# 1954# Here the built queue is built as long as possible 1955# 1956sub build_actual_queue { 1957 my $build_queue = shift; | 1936 while (children_number()) { 1937 handle_dead_children(1); 1938 }; 1939 cancel_build() if (scalar keys %broken_build); 1940 mp_success_exit(); 1941}; 1942 1943sub mp_success_exit { --- 6 unchanged lines hidden (view full) --- 1950 do_exit(0); 1951}; 1952 1953# 1954# Here the built queue is built as long as possible 1955# 1956sub build_actual_queue { 1957 my $build_queue = shift; |
1958 my $finished_projects = 0; | 1958 my $finished_projects = 0; |
1959 do { 1960 my @sorted_queue = sort {(scalar keys %{$projects_deps_hash{$a}}) <=> (scalar keys %{$projects_deps_hash{$b}})} keys %$build_queue; | 1959 do { 1960 my @sorted_queue = sort {(scalar keys %{$projects_deps_hash{$a}}) <=> (scalar keys %{$projects_deps_hash{$b}})} keys %$build_queue; |
1961 my $started_children = 0; | 1961 my $started_children = 0; |
1962 foreach my $prj (keys %$build_queue) { 1963 get_html_orders(); 1964 if ($reschedule_queue) { 1965 $reschedule_queue = 0; 1966 foreach (keys %$build_queue) { 1967 # Remove the module from the build queue if there is a dependency emerged 1968 if ((defined $global_deps_hash{$_}) && (scalar keys %{$global_deps_hash{$_}})) { 1969 delete $$build_queue{$_}; --- 35 unchanged lines hidden (view full) --- 2005 my $job_to_do = $job; 2006 my $error_code = 0; 2007 print "$registered_name\n"; 2008 return 0 if ( $show ); 2009 $job_to_do = $deliver_command if ($job eq 'deliver'); 2010 $registered_name = $path if (!defined $registered_name); 2011 chdir $path; 2012 getcwd(); | 1962 foreach my $prj (keys %$build_queue) { 1963 get_html_orders(); 1964 if ($reschedule_queue) { 1965 $reschedule_queue = 0; 1966 foreach (keys %$build_queue) { 1967 # Remove the module from the build queue if there is a dependency emerged 1968 if ((defined $global_deps_hash{$_}) && (scalar keys %{$global_deps_hash{$_}})) { 1969 delete $$build_queue{$_}; --- 35 unchanged lines hidden (view full) --- 2005 my $job_to_do = $job; 2006 my $error_code = 0; 2007 print "$registered_name\n"; 2008 return 0 if ( $show ); 2009 $job_to_do = $deliver_command if ($job eq 'deliver'); 2010 $registered_name = $path if (!defined $registered_name); 2011 chdir $path; 2012 getcwd(); |
2013 | 2013 |
2014 if ($html) { 2015 my $log_file = $jobs_hash{$registered_name}->{LONG_LOG_PATH}; 2016 my $log_dir = File::Basename::dirname($log_file); 2017 if (!-d $log_dir) { 2018 system("$perl $mkout"); 2019 }; 2020 $error_code = system ("$job_to_do > $log_file 2>&1"); 2021 if (!$grab_output && -f $log_file) { --- 14 unchanged lines hidden (view full) --- 2036 my $error_code = 0; 2037 if ($job eq $pre_job) { 2038 announce_module($module); 2039# html_store_job_info($dependencies_hash, $job_dir); 2040 remove_from_dependencies($module_job, $dependencies_hash); 2041 } else { 2042 $error_code = run_job($job, $module_paths{$module}, $module_job); 2043 if ($error_code) { | 2014 if ($html) { 2015 my $log_file = $jobs_hash{$registered_name}->{LONG_LOG_PATH}; 2016 my $log_dir = File::Basename::dirname($log_file); 2017 if (!-d $log_dir) { 2018 system("$perl $mkout"); 2019 }; 2020 $error_code = system ("$job_to_do > $log_file 2>&1"); 2021 if (!$grab_output && -f $log_file) { --- 14 unchanged lines hidden (view full) --- 2036 my $error_code = 0; 2037 if ($job eq $pre_job) { 2038 announce_module($module); 2039# html_store_job_info($dependencies_hash, $job_dir); 2040 remove_from_dependencies($module_job, $dependencies_hash); 2041 } else { 2042 $error_code = run_job($job, $module_paths{$module}, $module_job); 2043 if ($error_code) { |
2044 # give windows one more chance | 2044 # give windows one more chance |
2045 if ($ENV{GUI} eq 'WNT') { 2046 $error_code = run_job($job, $module_paths{$module}, $module_job); 2047 }; 2048 }; 2049 if ($error_code && $ignore) { 2050 push(@ignored_errors, $module_job); 2051 $error_code = 0; 2052 }; --- 80 unchanged lines hidden (view full) --- 2133 next; 2134 }; 2135 $modules_types{$module} = 'mod'; 2136 }; 2137}; 2138 2139# 2140# This procedure provides consistency for cws | 2045 if ($ENV{GUI} eq 'WNT') { 2046 $error_code = run_job($job, $module_paths{$module}, $module_job); 2047 }; 2048 }; 2049 if ($error_code && $ignore) { 2050 push(@ignored_errors, $module_job); 2051 $error_code = 0; 2052 }; --- 80 unchanged lines hidden (view full) --- 2133 next; 2134 }; 2135 $modules_types{$module} = 'mod'; 2136 }; 2137}; 2138 2139# 2140# This procedure provides consistency for cws |
2141# and optimized build (ie in case of --with_branches, -all:prj_name | 2141# and optimized build (i.e. in case of --with_branches, -all:prj_name |
2142# and -since switches) 2143# 2144sub provide_consistency { 2145 check_dir(); 2146 foreach my $var_ref (\$build_all_cont, \$build_since) { 2147 if ($$var_ref) { 2148 return if (defined $module_paths{$$var_ref}); 2149 print_error("Cannot find module '$$var_ref'", 9); --- 24 unchanged lines hidden (view full) --- 2174 my $module = shift; 2175 if ($modules_types{$module} eq 'mod') { 2176 clear_module($module); 2177 return; 2178 }; 2179 if ($modules_types{$module} eq 'lnk' && (File::Basename::basename($module_paths{$module}) ne $module)) { 2180 if(rename($module_paths{$module}, File::Basename::dirname($module_paths{$module}) ."/$module")) { 2181 $module_paths{$module} = File::Basename::dirname($module_paths{$module}) ."/$module"; | 2142# and -since switches) 2143# 2144sub provide_consistency { 2145 check_dir(); 2146 foreach my $var_ref (\$build_all_cont, \$build_since) { 2147 if ($$var_ref) { 2148 return if (defined $module_paths{$$var_ref}); 2149 print_error("Cannot find module '$$var_ref'", 9); --- 24 unchanged lines hidden (view full) --- 2174 my $module = shift; 2175 if ($modules_types{$module} eq 'mod') { 2176 clear_module($module); 2177 return; 2178 }; 2179 if ($modules_types{$module} eq 'lnk' && (File::Basename::basename($module_paths{$module}) ne $module)) { 2180 if(rename($module_paths{$module}, File::Basename::dirname($module_paths{$module}) ."/$module")) { 2181 $module_paths{$module} = File::Basename::dirname($module_paths{$module}) ."/$module"; |
2182 clear_module($module); | 2182 clear_module($module); |
2183 } else { 2184 print_error("Cannot rename link to $module. Please rename it manually"); 2185 }; 2186 }; 2187}; 2188 2189# 2190# Procedure removes output tree from the module (without common trees) --- 57 unchanged lines hidden (view full) --- 2248 print_error("Cannot create temporary directory for checkout in $tmp_dir") if ($@); 2249 }; 2250 return $tmp_dir; 2251}; 2252 2253sub retrieve_build_list { 2254 my $module = shift; 2255 my $old_fh = select(STDOUT); | 2183 } else { 2184 print_error("Cannot rename link to $module. Please rename it manually"); 2185 }; 2186 }; 2187}; 2188 2189# 2190# Procedure removes output tree from the module (without common trees) --- 57 unchanged lines hidden (view full) --- 2248 print_error("Cannot create temporary directory for checkout in $tmp_dir") if ($@); 2249 }; 2250 return $tmp_dir; 2251}; 2252 2253sub retrieve_build_list { 2254 my $module = shift; 2255 my $old_fh = select(STDOUT); |
2256 2257 # Try to get global depencies from solver's build.lst if such exists | 2256 2257 # Try to get global dependencies from solver's build.lst if such exist |
2258 my $solver_inc_dir = "$ENV{SOLARVER}/$ENV{OUTPATH}"; 2259 $solver_inc_dir .= $ENV{PROEXT} if (defined $ENV{PROEXT}); 2260 $solver_inc_dir .= '/inc'; 2261 $solver_inc_dir .= $ENV{UPDMINOREXT} if (defined $ENV{UPDMINOREXT}); 2262 $solver_inc_dir .= "/$module"; 2263 $solver_inc_dir = correct_path($solver_inc_dir); 2264 $dead_parents{$module}++; 2265 print "Fetching dependencies for module $module from solver..."; --- 26 unchanged lines hidden (view full) --- 2292# print "Removed $prerequisite\n"; 2293 last; 2294 }; 2295 }; 2296 }; 2297}; 2298 2299# | 2258 my $solver_inc_dir = "$ENV{SOLARVER}/$ENV{OUTPATH}"; 2259 $solver_inc_dir .= $ENV{PROEXT} if (defined $ENV{PROEXT}); 2260 $solver_inc_dir .= '/inc'; 2261 $solver_inc_dir .= $ENV{UPDMINOREXT} if (defined $ENV{UPDMINOREXT}); 2262 $solver_inc_dir .= "/$module"; 2263 $solver_inc_dir = correct_path($solver_inc_dir); 2264 $dead_parents{$module}++; 2265 print "Fetching dependencies for module $module from solver..."; --- 26 unchanged lines hidden (view full) --- 2292# print "Removed $prerequisite\n"; 2293 last; 2294 }; 2295 }; 2296 }; 2297}; 2298 2299# |
2300# Removes projects which it is not necessary to build | 2300# Removes projects which are not necessary to build |
2301# in incompatible build 2302# 2303sub prepare_incompatible_build { 2304 my ($prj, $deps_hash, @missing_modules); 2305 $deps_hash = shift; 2306 foreach my $module (keys %incompatibles) { 2307 if (!defined $$deps_hash{$module}) { 2308 print_error("The module $initial_module is independent from $module\n"); --- 56 unchanged lines hidden (view full) --- 2365 if (scalar @warnings) { 2366 print " with WARNINGS!!\n\n"; 2367 } else {print " successfully\n\n";} 2368 } 2369 do_exit(0) if ($prepare); 2370}; 2371 2372# | 2301# in incompatible build 2302# 2303sub prepare_incompatible_build { 2304 my ($prj, $deps_hash, @missing_modules); 2305 $deps_hash = shift; 2306 foreach my $module (keys %incompatibles) { 2307 if (!defined $$deps_hash{$module}) { 2308 print_error("The module $initial_module is independent from $module\n"); --- 56 unchanged lines hidden (view full) --- 2365 if (scalar @warnings) { 2366 print " with WARNINGS!!\n\n"; 2367 } else {print " successfully\n\n";} 2368 } 2369 do_exit(0) if ($prepare); 2370}; 2371 2372# |
2373# Removes projects which it is not necessary to build | 2373# Removes projects which are not necessary to build |
2374# with --all:prj_name or --since switch 2375# 2376sub prepare_build_all_cont { 2377 my ($prj, $deps_hash, $border_prj); 2378 $deps_hash = shift; 2379 $border_prj = $build_all_cont if ($build_all_cont); 2380 $border_prj = $build_since if ($build_since); 2381 while ($prj = pick_prj_to_build($deps_hash)) { --- 117 unchanged lines hidden (view full) --- 2499 foreach (@platforms_available) { 2500 my $s_path = $solver . '/' . $_; 2501 $$platforms_ref{$_}++ if (-d $s_path); 2502 }; 2503 } else { 2504 get_workspace_platforms(\%platforms); 2505 }; 2506 }; | 2374# with --all:prj_name or --since switch 2375# 2376sub prepare_build_all_cont { 2377 my ($prj, $deps_hash, $border_prj); 2378 $deps_hash = shift; 2379 $border_prj = $build_all_cont if ($build_all_cont); 2380 $border_prj = $build_since if ($build_since); 2381 while ($prj = pick_prj_to_build($deps_hash)) { --- 117 unchanged lines hidden (view full) --- 2499 foreach (@platforms_available) { 2500 my $s_path = $solver . '/' . $_; 2501 $$platforms_ref{$_}++ if (-d $s_path); 2502 }; 2503 } else { 2504 get_workspace_platforms(\%platforms); 2505 }; 2506 }; |
2507 | 2507 |
2508 if (!scalar keys %platforms) { 2509 # An Auses wish - fallback to INPATH for new platforms | 2508 if (!scalar keys %platforms) { 2509 # An Auses wish - fallback to INPATH for new platforms |
2510 if (defined $ENV{INPATH}) { | 2510 if (defined $ENV{INPATH}) { |
2511 $$platforms_ref{$ENV{INPATH}}++; 2512 } else { 2513 print_error("There is no platform found!!") ; 2514 }; 2515 }; 2516}; 2517 2518# 2519# This procedure clears solver from delivered | 2511 $$platforms_ref{$ENV{INPATH}}++; 2512 } else { 2513 print_error("There is no platform found!!") ; 2514 }; 2515 }; 2516}; 2517 2518# 2519# This procedure clears solver from delivered |
2520# by the modules to be build | 2520# by the modules to be built |
2521# 2522sub clear_delivered { 2523 my $message = 'Clearing up delivered'; 2524 my %backup_vars; 2525 my $deliver_delete_switches = '-delete'; 2526 if (scalar keys %platforms < scalar keys %platforms_to_copy) { 2527 $message .= ' without common trees'; 2528 $deliver_delete_switches .= ' -dontdeletecommon'; 2529 $only_common = ''; 2530 }; 2531 print "$message\n"; | 2521# 2522sub clear_delivered { 2523 my $message = 'Clearing up delivered'; 2524 my %backup_vars; 2525 my $deliver_delete_switches = '-delete'; 2526 if (scalar keys %platforms < scalar keys %platforms_to_copy) { 2527 $message .= ' without common trees'; 2528 $deliver_delete_switches .= ' -dontdeletecommon'; 2529 $only_common = ''; 2530 }; 2531 print "$message\n"; |
2532 | 2532 |
2533 foreach my $platform (keys %platforms) { 2534 print "\nRemoving files delivered for $platform\n"; 2535 my %solar_vars = (); 2536 read_ssolar_vars($platform, \%solar_vars); 2537 if (scalar keys %solar_vars) { 2538 foreach (keys %solar_vars) { 2539 if (!defined $backup_vars{$_}) { 2540 $backup_vars{$_} = $ENV{$_}; --- 35 unchanged lines hidden (view full) --- 2576 print STDERR "There is no setsolar found. Falling back to current platform settings\n"; 2577 return; 2578 } 2579 my $pro = ""; 2580 if ($platform =~ /\.pro$/) { 2581 $pro = "-pro"; 2582 $platform = $`; 2583 }; | 2533 foreach my $platform (keys %platforms) { 2534 print "\nRemoving files delivered for $platform\n"; 2535 my %solar_vars = (); 2536 read_ssolar_vars($platform, \%solar_vars); 2537 if (scalar keys %solar_vars) { 2538 foreach (keys %solar_vars) { 2539 if (!defined $backup_vars{$_}) { 2540 $backup_vars{$_} = $ENV{$_}; --- 35 unchanged lines hidden (view full) --- 2576 print STDERR "There is no setsolar found. Falling back to current platform settings\n"; 2577 return; 2578 } 2579 my $pro = ""; 2580 if ($platform =~ /\.pro$/) { 2581 $pro = "-pro"; 2582 $platform = $`; 2583 }; |
2584 | 2584 |
2585 my ($verswitch, $source_root, $cwsname); 2586 $verswitch = "-ver $ENV{UPDMINOR}" if (defined $ENV{UPDMINOR}); 2587 $source_root = '-sourceroot' if (defined $ENV{SOURCE_ROOT_USED}); 2588 my $cws_name = "-cwsname $ENV{CWS_WORK_STAMP}" if (defined $ENV{CWS_WORK_STAMP}); | 2585 my ($verswitch, $source_root, $cwsname); 2586 $verswitch = "-ver $ENV{UPDMINOR}" if (defined $ENV{UPDMINOR}); 2587 $source_root = '-sourceroot' if (defined $ENV{SOURCE_ROOT_USED}); 2588 my $cws_name = "-cwsname $ENV{CWS_WORK_STAMP}" if (defined $ENV{CWS_WORK_STAMP}); |
2589 | 2589 |
2590 my $param = "-$ENV{WORK_STAMP} $verswitch $source_root $cws_name $pro $platform"; 2591 my $ss_command = "$perl $setsolar -file $tmp_file $param $nul"; 2592 if (system($ss_command)) { 2593 unlink $tmp_file; 2594 print_error("Cannot run command:\n$ss_command"); 2595 }; 2596 get_solar_vars($solar_vars, $tmp_file); 2597}; 2598 2599# 2600# read variables to hash 2601# 2602sub get_solar_vars { 2603 my ($solar_vars, $file) = @_; 2604 my ($var, $value); | 2590 my $param = "-$ENV{WORK_STAMP} $verswitch $source_root $cws_name $pro $platform"; 2591 my $ss_command = "$perl $setsolar -file $tmp_file $param $nul"; 2592 if (system($ss_command)) { 2593 unlink $tmp_file; 2594 print_error("Cannot run command:\n$ss_command"); 2595 }; 2596 get_solar_vars($solar_vars, $tmp_file); 2597}; 2598 2599# 2600# read variables to hash 2601# 2602sub get_solar_vars { 2603 my ($solar_vars, $file) = @_; 2604 my ($var, $value); |
2605 open SOLARTABLE, "<$file" or die "can�t open solarfile $file"; | 2605 open SOLARTABLE, "<$file" or die "cannot open solarfile $file"; |
2606 while(<SOLARTABLE>) { 2607 s/\r\n//o; 2608 next if(!/^\w+\s+(\w+)/o); 2609 next if (!defined $deliver_env{$1}); 2610 $var = $1; 2611 /\'(\S+)\'$/o; 2612 $value = $1; 2613 $$solar_vars{$var} = $value; --- 35 unchanged lines hidden (view full) --- 2649 return; 2650 } else { 2651 chdir $start_dir; 2652 getcwd(); 2653 }; 2654}; 2655 2656# | 2606 while(<SOLARTABLE>) { 2607 s/\r\n//o; 2608 next if(!/^\w+\s+(\w+)/o); 2609 next if (!defined $deliver_env{$1}); 2610 $var = $1; 2611 /\'(\S+)\'$/o; 2612 $value = $1; 2613 $$solar_vars{$var} = $value; --- 35 unchanged lines hidden (view full) --- 2649 return; 2650 } else { 2651 chdir $start_dir; 2652 getcwd(); 2653 }; 2654}; 2655 2656# |
2657# Store all available build modi in %build_modes | 2657# Store all available build modes in %build_modes |
2658# 2659sub get_build_modes { 2660 return if (scalar keys %build_modes); 2661 if (defined $ENV{BUILD_TYPE}) { 2662 if ($ENV{BUILD_TYPE} =~ /\s+/o) { 2663 my @build_modes = split (/\s+/, $ENV{BUILD_TYPE}); 2664 $build_modes{$_}++ foreach (@build_modes); 2665 } else { --- 44 unchanged lines hidden (view full) --- 2710sub sort_modules_appearance { 2711 foreach (keys %dead_parents) { 2712 delete $build_is_finished{$_} if (defined $build_is_finished{$_}); 2713 delete $build_in_progress{$_} if (defined $build_in_progress{$_}); 2714 }; 2715 foreach (keys %build_is_finished) { 2716 delete $build_in_progress{$_} if (defined $build_in_progress{$_}); 2717 delete $build_in_progress_shown{$_} if (defined $build_in_progress_shown{$_}); | 2658# 2659sub get_build_modes { 2660 return if (scalar keys %build_modes); 2661 if (defined $ENV{BUILD_TYPE}) { 2662 if ($ENV{BUILD_TYPE} =~ /\s+/o) { 2663 my @build_modes = split (/\s+/, $ENV{BUILD_TYPE}); 2664 $build_modes{$_}++ foreach (@build_modes); 2665 } else { --- 44 unchanged lines hidden (view full) --- 2710sub sort_modules_appearance { 2711 foreach (keys %dead_parents) { 2712 delete $build_is_finished{$_} if (defined $build_is_finished{$_}); 2713 delete $build_in_progress{$_} if (defined $build_in_progress{$_}); 2714 }; 2715 foreach (keys %build_is_finished) { 2716 delete $build_in_progress{$_} if (defined $build_in_progress{$_}); 2717 delete $build_in_progress_shown{$_} if (defined $build_in_progress_shown{$_}); |
2718 }; | 2718 }; |
2719 my @modules_order = sort keys %modules_with_errors; 2720 foreach (keys %modules_with_errors) { 2721 delete $build_in_progress{$_} if (defined $build_in_progress{$_}); 2722 delete $build_is_finished{$_} if (defined $build_is_finished{$_}); 2723 delete $build_in_progress_shown{$_} if (defined $build_in_progress_shown{$_}); 2724 }; 2725 $build_in_progress_shown{$_}++ foreach (keys %build_in_progress); 2726 push(@modules_order, $_) foreach (sort { $build_in_progress_shown{$b} <=> $build_in_progress_shown{$a} } keys %build_in_progress_shown); --- 74 unchanged lines hidden (view full) --- 2801 print HTML 'document.write(" <td width=* align=\"center\"><strong style=\"color:blue\">Status</strong></td>");' . "\n"; 2802 print HTML 'document.write(" <td width=15% align=\"center\"><strong style=\"color:blue\">CPU Time</strong></td>");' . "\n"; 2803 print HTML 'document.write(" </tr>");' . "\n"; 2804 2805 foreach (@modules_order) { 2806 next if ($modules_types{$_} eq 'lnk'); 2807 next if (!defined $active_modules{$_}); 2808 my ($errors_info_line, $dirs_info_line, $errors_number, $successes_percent, $errors_percent, $time) = get_html_info($_); | 2719 my @modules_order = sort keys %modules_with_errors; 2720 foreach (keys %modules_with_errors) { 2721 delete $build_in_progress{$_} if (defined $build_in_progress{$_}); 2722 delete $build_is_finished{$_} if (defined $build_is_finished{$_}); 2723 delete $build_in_progress_shown{$_} if (defined $build_in_progress_shown{$_}); 2724 }; 2725 $build_in_progress_shown{$_}++ foreach (keys %build_in_progress); 2726 push(@modules_order, $_) foreach (sort { $build_in_progress_shown{$b} <=> $build_in_progress_shown{$a} } keys %build_in_progress_shown); --- 74 unchanged lines hidden (view full) --- 2801 print HTML 'document.write(" <td width=* align=\"center\"><strong style=\"color:blue\">Status</strong></td>");' . "\n"; 2802 print HTML 'document.write(" <td width=15% align=\"center\"><strong style=\"color:blue\">CPU Time</strong></td>");' . "\n"; 2803 print HTML 'document.write(" </tr>");' . "\n"; 2804 2805 foreach (@modules_order) { 2806 next if ($modules_types{$_} eq 'lnk'); 2807 next if (!defined $active_modules{$_}); 2808 my ($errors_info_line, $dirs_info_line, $errors_number, $successes_percent, $errors_percent, $time) = get_html_info($_); |
2809#<one module> | 2809#<one module> |
2810 print HTML 'document.write(" <tr>");' . "\n"; 2811 print HTML 'document.write(" <td width=*>");' . "\n"; 2812 2813 if (defined $dirs_info_line) { 2814 print HTML 'document.write(" <a id='; 2815 print HTML $_; 2816 print HTML ' href=\"javascript:top.Error(\''; 2817 print HTML $_ , '\', ' ; 2818 print HTML $errors_info_line; 2819 print HTML ','; 2820 print HTML $dirs_info_line; 2821 print HTML ')\"); title=\"'; 2822 print HTML $errors_number; 2823 print HTML ' error(s)\">', $_, '</a>");' . "\n"; 2824 } else { 2825# print HTML 'document.write("<em style=color:gray>' . $_ . '</em>");'; 2826#### print HTML 'document.write("<em style=color:gray>' . $_ ."href=\'http://$local_host_ip:$html_port/delete=\'$_". '</em>");'; | 2810 print HTML 'document.write(" <tr>");' . "\n"; 2811 print HTML 'document.write(" <td width=*>");' . "\n"; 2812 2813 if (defined $dirs_info_line) { 2814 print HTML 'document.write(" <a id='; 2815 print HTML $_; 2816 print HTML ' href=\"javascript:top.Error(\''; 2817 print HTML $_ , '\', ' ; 2818 print HTML $errors_info_line; 2819 print HTML ','; 2820 print HTML $dirs_info_line; 2821 print HTML ')\"); title=\"'; 2822 print HTML $errors_number; 2823 print HTML ' error(s)\">', $_, '</a>");' . "\n"; 2824 } else { 2825# print HTML 'document.write("<em style=color:gray>' . $_ . '</em>");'; 2826#### print HTML 'document.write("<em style=color:gray>' . $_ ."href=\'http://$local_host_ip:$html_port/delete=\'$_". '</em>");'; |
2827 | 2827 |
2828 print HTML 'document.write(" <a target=\'infoframe\' id='; 2829 print HTML $_; 2830 print HTML ' href=\"javascript:void(0)\"; title=\"Remove module\">' . $_ . '</a>");' . "\n"; 2831 }; 2832 2833 2834 print HTML 'document.write(" </td>");' . "\n"; 2835 print HTML 'document.write(" <td>");' . "\n"; 2836 print HTML 'document.write(" <table width=100% valign=top cellpadding=0 hspace=0 vspace=0 cellspacing=0 border=0>");' . "\n"; 2837 print HTML 'document.write(" <tr>");' . "\n"; 2838 print HTML 'document.write(" <td height=15 width='; | 2828 print HTML 'document.write(" <a target=\'infoframe\' id='; 2829 print HTML $_; 2830 print HTML ' href=\"javascript:void(0)\"; title=\"Remove module\">' . $_ . '</a>");' . "\n"; 2831 }; 2832 2833 2834 print HTML 'document.write(" </td>");' . "\n"; 2835 print HTML 'document.write(" <td>");' . "\n"; 2836 print HTML 'document.write(" <table width=100% valign=top cellpadding=0 hspace=0 vspace=0 cellspacing=0 border=0>");' . "\n"; 2837 print HTML 'document.write(" <tr>");' . "\n"; 2838 print HTML 'document.write(" <td height=15 width='; |
2839 | 2839 |
2840 print HTML $successes_percent + $errors_percent; 2841 if ($errors_number) { 2842 print HTML '% bgcolor=red valign=top></td>");' . "\n"; 2843 } else { 2844 print HTML '% bgcolor=#25A528 valign=top></td>");' . "\n"; 2845 }; 2846 print HTML 'document.write(" <td width='; | 2840 print HTML $successes_percent + $errors_percent; 2841 if ($errors_number) { 2842 print HTML '% bgcolor=red valign=top></td>");' . "\n"; 2843 } else { 2844 print HTML '% bgcolor=#25A528 valign=top></td>");' . "\n"; 2845 }; 2846 print HTML 'document.write(" <td width='; |
2847 | 2847 |
2848 print HTML 100 - ($successes_percent + $errors_percent); 2849 print HTML '% bgcolor=lightgrey valign=top></td>");' . "\n"; 2850 print HTML 'document.write(" </tr>");' . "\n"; 2851 print HTML 'document.write(" </table>");' . "\n"; 2852 print HTML 'document.write(" </td>");' . "\n"; 2853 print HTML 'document.write(" <td align=\"center\">', $time, '</td>");' . "\n"; 2854 print HTML 'document.write(" </tr>");' . "\n"; 2855# </one module> | 2848 print HTML 100 - ($successes_percent + $errors_percent); 2849 print HTML '% bgcolor=lightgrey valign=top></td>");' . "\n"; 2850 print HTML 'document.write(" </tr>");' . "\n"; 2851 print HTML 'document.write(" </table>");' . "\n"; 2852 print HTML 'document.write(" </td>");' . "\n"; 2853 print HTML 'document.write(" <td align=\"center\">', $time, '</td>");' . "\n"; 2854 print HTML 'document.write(" </tr>");' . "\n"; 2855# </one module> |
2856 } | 2856 } |
2857 print HTML 'document.write(" </table>");' . "\n"; 2858 print HTML 'document.write(" </body>");' . "\n"; 2859 print HTML 'document.write("</html>");' . "\n"; 2860 print HTML 'document.close();' . "\n"; 2861 print HTML 'refreshInfoFrames();' . "\n"; 2862 print HTML '}' . "\n"; 2863 2864 --- 74 unchanged lines hidden (view full) --- 2939 print HTML ' document.write("Click on the project of interest");' . "\n"; 2940 print HTML ' document.close();' . "\n"; 2941 print HTML '}' . "\n"; 2942 print HTML 'function loadFrame_2() {' . "\n"; 2943 print HTML ' document.write("<tr bgcolor=lightgrey<td><h3>Errors</h3></pre></td></tr>");' . "\n"; 2944 print HTML ' document.write("Click on the project of interest");' . "\n"; 2945 print HTML ' document.close();' . "\n"; 2946 print HTML '} function getStatusInnerHTML(Status) { var StatusInnerHtml;' . "\n"; | 2857 print HTML 'document.write(" </table>");' . "\n"; 2858 print HTML 'document.write(" </body>");' . "\n"; 2859 print HTML 'document.write("</html>");' . "\n"; 2860 print HTML 'document.close();' . "\n"; 2861 print HTML 'refreshInfoFrames();' . "\n"; 2862 print HTML '}' . "\n"; 2863 2864 --- 74 unchanged lines hidden (view full) --- 2939 print HTML ' document.write("Click on the project of interest");' . "\n"; 2940 print HTML ' document.close();' . "\n"; 2941 print HTML '}' . "\n"; 2942 print HTML 'function loadFrame_2() {' . "\n"; 2943 print HTML ' document.write("<tr bgcolor=lightgrey<td><h3>Errors</h3></pre></td></tr>");' . "\n"; 2944 print HTML ' document.write("Click on the project of interest");' . "\n"; 2945 print HTML ' document.close();' . "\n"; 2946 print HTML '} function getStatusInnerHTML(Status) { var StatusInnerHtml;' . "\n"; |
2947 print HTML ' if (Status == "success") {' . "\n"; | 2947 print HTML ' if (Status == "success") {' . "\n"; |
2948 print HTML ' StatusInnerHtml = "<em style=color:green>";' . "\n"; 2949 print HTML ' } else if (Status == "building") {' . "\n"; 2950 print HTML ' StatusInnerHtml = "<em style=color:blue>";' . "\n"; 2951 print HTML ' } else if (Status == "error") {' . "\n"; 2952 print HTML ' StatusInnerHtml = "<em style=color:red>";' . "\n"; 2953 print HTML ' } else {' . "\n"; 2954 print HTML ' StatusInnerHtml = "<em style=color:gray>";' . "\n"; 2955 print HTML ' };' . "\n"; 2956 print HTML ' StatusInnerHtml += Status + "</em>";' . "\n"; 2957 print HTML ' return StatusInnerHtml;' . "\n"; 2958 print HTML '} ' . "\n"; 2959 print HTML 'function ShowLog(LogFilePath, ModuleJob) {' . "\n"; 2960 print HTML ' top.innerFrame.frames[2].document.write("<h3 id=ModuleErrors name=\"" + null + "\">Log for " + ModuleJob + "</h3>");' . "\n"; 2961 print HTML ' top.innerFrame.frames[2].document.write("<iframe id=LogFile name=Log src="'; 2962 if (defined $html_path) { 2963 print HTML 'file://'; 2964 } | 2948 print HTML ' StatusInnerHtml = "<em style=color:green>";' . "\n"; 2949 print HTML ' } else if (Status == "building") {' . "\n"; 2950 print HTML ' StatusInnerHtml = "<em style=color:blue>";' . "\n"; 2951 print HTML ' } else if (Status == "error") {' . "\n"; 2952 print HTML ' StatusInnerHtml = "<em style=color:red>";' . "\n"; 2953 print HTML ' } else {' . "\n"; 2954 print HTML ' StatusInnerHtml = "<em style=color:gray>";' . "\n"; 2955 print HTML ' };' . "\n"; 2956 print HTML ' StatusInnerHtml += Status + "</em>";' . "\n"; 2957 print HTML ' return StatusInnerHtml;' . "\n"; 2958 print HTML '} ' . "\n"; 2959 print HTML 'function ShowLog(LogFilePath, ModuleJob) {' . "\n"; 2960 print HTML ' top.innerFrame.frames[2].document.write("<h3 id=ModuleErrors name=\"" + null + "\">Log for " + ModuleJob + "</h3>");' . "\n"; 2961 print HTML ' top.innerFrame.frames[2].document.write("<iframe id=LogFile name=Log src="'; 2962 if (defined $html_path) { 2963 print HTML 'file://'; 2964 } |
2965 print HTML '+ LogFilePath + " width=100%></iframe>");' . "\n"; | 2965 print HTML '+ LogFilePath + " width=100%></iframe>");' . "\n"; |
2966 print HTML ' top.innerFrame.frames[2].document.close();' . "\n"; 2967 print HTML '};' . "\n"; 2968 print HTML 'function FillFrame_1(Module, Message1, Message2) {' . "\n"; 2969 print HTML ' var FullUpdate = 1;' . "\n"; 2970 print HTML ' if (top.innerFrame.frames[1].document.getElementById("ModuleJobs") != null) {' . "\n"; 2971 print HTML ' var ModuleName = top.innerFrame.frames[1].document.getElementById("ModuleJobs").getAttribute(\'name\');' . "\n"; 2972 print HTML ' if (Module == ModuleName) FullUpdate = 0;' . "\n"; 2973 print HTML ' }' . "\n"; --- 81 unchanged lines hidden (view full) --- 3055 print HTML ' }' . "\n"; 3056 print HTML ' FillFrame_1(Module, Message1, Message2);' . "\n"; 3057 print HTML ' }' . "\n"; 3058 print HTML '}' . "\n"; 3059 print HTML 'function updateInnerFrame() {' . "\n"; 3060 print HTML ' top.innerFrame.frames[0].document.location.reload();' . "\n"; 3061 print HTML ' refreshInfoFrames();' . "\n"; 3062 print HTML '};' . "\n\n"; | 2966 print HTML ' top.innerFrame.frames[2].document.close();' . "\n"; 2967 print HTML '};' . "\n"; 2968 print HTML 'function FillFrame_1(Module, Message1, Message2) {' . "\n"; 2969 print HTML ' var FullUpdate = 1;' . "\n"; 2970 print HTML ' if (top.innerFrame.frames[1].document.getElementById("ModuleJobs") != null) {' . "\n"; 2971 print HTML ' var ModuleName = top.innerFrame.frames[1].document.getElementById("ModuleJobs").getAttribute(\'name\');' . "\n"; 2972 print HTML ' if (Module == ModuleName) FullUpdate = 0;' . "\n"; 2973 print HTML ' }' . "\n"; --- 81 unchanged lines hidden (view full) --- 3055 print HTML ' }' . "\n"; 3056 print HTML ' FillFrame_1(Module, Message1, Message2);' . "\n"; 3057 print HTML ' }' . "\n"; 3058 print HTML '}' . "\n"; 3059 print HTML 'function updateInnerFrame() {' . "\n"; 3060 print HTML ' top.innerFrame.frames[0].document.location.reload();' . "\n"; 3061 print HTML ' refreshInfoFrames();' . "\n"; 3062 print HTML '};' . "\n\n"; |
3063 | 3063 |
3064 print HTML 'function setRefreshRate() {' . "\n"; 3065 print HTML ' RefreshRate = document.Formular.rate.value;' . "\n"; 3066 print HTML ' if (!isNaN(RefreshRate * 1)) {' . "\n"; 3067 print HTML ' top.frames[0].clearInterval(IntervalID);' . "\n"; 3068 print HTML ' IntervalID = top.frames[0].setInterval("updateInnerFrame()", RefreshRate * 1000);' . "\n"; 3069 print HTML ' };' . "\n"; 3070 print HTML '};' . "\n"; 3071 --- 126 unchanged lines hidden (view full) --- 3198 if ($errorful_number) { 3199 $errors_info_line .= $_ . '<br>' foreach (@$dirs); 3200 } else { 3201 $errors_info_line .= 'No errors'; 3202 }; 3203 $errors_info_line .= '\''; 3204# if (defined $full_info) { 3205 my $time_line = get_time_line($$module_info_hash{BUILD_TIME}); | 3064 print HTML 'function setRefreshRate() {' . "\n"; 3065 print HTML ' RefreshRate = document.Formular.rate.value;' . "\n"; 3066 print HTML ' if (!isNaN(RefreshRate * 1)) {' . "\n"; 3067 print HTML ' top.frames[0].clearInterval(IntervalID);' . "\n"; 3068 print HTML ' IntervalID = top.frames[0].setInterval("updateInnerFrame()", RefreshRate * 1000);' . "\n"; 3069 print HTML ' };' . "\n"; 3070 print HTML '};' . "\n"; 3071 --- 126 unchanged lines hidden (view full) --- 3198 if ($errorful_number) { 3199 $errors_info_line .= $_ . '<br>' foreach (@$dirs); 3200 } else { 3201 $errors_info_line .= 'No errors'; 3202 }; 3203 $errors_info_line .= '\''; 3204# if (defined $full_info) { 3205 my $time_line = get_time_line($$module_info_hash{BUILD_TIME}); |
3206 my ($successes_percent, $errors_percent) = get_progress_percentage($dirs_number - 1, $successful_number - 1, $errorful_number); | 3206 my ($successes_percent, $errors_percent) = get_progress_percentage($dirs_number - 1, $successful_number - 1, $errorful_number); |
3207 return($errors_info_line, $dirs_info_line, $errorful_number, $successes_percent, $errors_percent, $time_line); 3208# } else { 3209# return($errors_info_line, $dirs_info_line, $errorful_number); 3210# }; 3211}; 3212 3213sub get_time_line { 3214 use integer; --- 94 unchanged lines hidden (view full) --- 3309 }; 3310 } while (!$new_socket_obj); 3311 return $new_socket_obj; 3312}; 3313 3314sub check_client_jobs { 3315 foreach (keys %clients_times) { 3316 if (time - $clients_times{$_} > $client_timeout) { | 3207 return($errors_info_line, $dirs_info_line, $errorful_number, $successes_percent, $errors_percent, $time_line); 3208# } else { 3209# return($errors_info_line, $dirs_info_line, $errorful_number); 3210# }; 3211}; 3212 3213sub get_time_line { 3214 use integer; --- 94 unchanged lines hidden (view full) --- 3309 }; 3310 } while (!$new_socket_obj); 3311 return $new_socket_obj; 3312}; 3313 3314sub check_client_jobs { 3315 foreach (keys %clients_times) { 3316 if (time - $clients_times{$_} > $client_timeout) { |
3317 print "Client's $_ Job: \"$clients_jobs{$_}\" apparently got lost...\n"; | 3317 print "Client's $_ Job: \"$clients_jobs{$_}\" apparently got lost...\n"; |
3318 print "Scheduling for rebuild...\n"; 3319 print "You might need to check the $_\n"; 3320 $lost_client_jobs{$clients_jobs{$_}}++; 3321 delete $processes_hash{$_}; 3322 delete $clients_jobs{$_}; 3323 delete $clients_times{$_}; 3324# } else { 3325# print time - $clients_times{$_} . "\n"; --- 69 unchanged lines hidden (view full) --- 3395 $clients_times{$pid} = time; 3396 next; 3397 }; 3398 }; 3399 delete $clients_times{$pid}; 3400 clear_from_child($pid); 3401 delete $clients_jobs{$pid}; 3402 $verbose_mode && print 'Running processes: ', children_number(), "\n"; | 3318 print "Scheduling for rebuild...\n"; 3319 print "You might need to check the $_\n"; 3320 $lost_client_jobs{$clients_jobs{$_}}++; 3321 delete $processes_hash{$_}; 3322 delete $clients_jobs{$_}; 3323 delete $clients_times{$_}; 3324# } else { 3325# print time - $clients_times{$_} . "\n"; --- 69 unchanged lines hidden (view full) --- 3395 $clients_times{$pid} = time; 3396 next; 3397 }; 3398 }; 3399 delete $clients_times{$pid}; 3400 clear_from_child($pid); 3401 delete $clients_jobs{$pid}; 3402 $verbose_mode && print 'Running processes: ', children_number(), "\n"; |
3403 # Actually, next 3 strings are only for even distribution | 3403 # Actually, next 3 strings are only for even distribution |
3404 # of clients if there are more than one build server running 3405 print $new_socket_obj 'No job'; 3406 close($new_socket_obj); 3407 next; 3408 }; 3409 my $job_string; 3410 my @lost_jobs = keys %lost_client_jobs; 3411 if (scalar @lost_jobs) { --- 139 unchanged lines hidden (view full) --- 3551 my $module = shift; 3552 my $bridgemakefile = $source_config->get_module_path($module) . "/prj/makefile.mk"; 3553 return (-e $bridgemakefile); 3554} 3555 3556sub check_partial_gnumake_build { 3557 # Do not disable the build command for a single module just for education. 3558 return; | 3404 # of clients if there are more than one build server running 3405 print $new_socket_obj 'No job'; 3406 close($new_socket_obj); 3407 next; 3408 }; 3409 my $job_string; 3410 my @lost_jobs = keys %lost_client_jobs; 3411 if (scalar @lost_jobs) { --- 139 unchanged lines hidden (view full) --- 3551 my $module = shift; 3552 my $bridgemakefile = $source_config->get_module_path($module) . "/prj/makefile.mk"; 3553 return (-e $bridgemakefile); 3554} 3555 3556sub check_partial_gnumake_build { 3557 # Do not disable the build command for a single module just for education. 3558 return; |
3559 | 3559 |
3560 if(!$build_all_parents && is_gnumake_module(shift)) { 3561 print "This module has been migrated to GNU make.\n"; 3562 print "You can only use build --all/--since here with build.pl.\n"; 3563 print "To do the equivalent of 'build && deliver' call:\n"; 3564 print "\tmake -sr\n"; 3565 print "in the module root (This will modify the solver).\n"; 3566 exit 1; 3567 } 3568} | 3560 if(!$build_all_parents && is_gnumake_module(shift)) { 3561 print "This module has been migrated to GNU make.\n"; 3562 print "You can only use build --all/--since here with build.pl.\n"; 3563 print "To do the equivalent of 'build && deliver' call:\n"; 3564 print "\tmake -sr\n"; 3565 print "in the module root (This will modify the solver).\n"; 3566 exit 1; 3567 } 3568} |