[Libreoffice-commits] .: solenv/bin

Michael Meeks mmeeks at kemper.freedesktop.org
Thu Oct 14 11:02:32 PDT 2010


 solenv/bin/build.pl |   97 ++++++++++++++++++++++++++--------------------------
 1 file changed, 49 insertions(+), 48 deletions(-)

New commits:
commit a78cd38db4303d38832899d19003bdae348778f7
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Thu Oct 14 19:01:32 2010 +0100

    add warning about occasional need to remove outpath

diff --git a/solenv/bin/build.pl b/solenv/bin/build.pl
index 25677f5..fdb63f1 100755
--- a/solenv/bin/build.pl
+++ b/solenv/bin/build.pl
@@ -68,7 +68,7 @@
         $enable_multiprocessing = 0 if ($@);
         eval { require Win32::Pipe; import Win32::Pipe; };
     };
-    
+
     ### for XML file format
     eval { require XMLBuildListParser; import XMLBuildListParser; };
     if (!$@) {
@@ -211,7 +211,7 @@
 ### main ###
 
     get_options();
-    
+
 #    my $temp_html_file = CorrectPath($tmp_dir. '/' . $ENV{INPATH}. '.build.html');
     get_build_modes();
     %deliver_env = ();
@@ -229,7 +229,7 @@
     };
     $StandDir = get_stand_dir();   # This also sets $initial_module
     $source_config = SourceConfig -> new($StandDir);
-    
+
     if ($html) {
         if (defined $html_path) {
             $html_file = CorrectPath($html_path . '/' . $ENV{INPATH}. '.build.html');
@@ -284,7 +284,7 @@
     print $new_line;
     get_server_ports();
     start_interactive() if ($interactive);
-    
+
     if ($checkparents) {
         get_parent_deps( $initial_module, \%global_deps_hash );
     } else {
@@ -346,7 +346,7 @@ sub print_warnings {
 
 sub rename_file {
     my ($old_file_name, $new_file_name, $throw_error) = @_;
-    
+
     if(-e $old_file_name) {
         rename($old_file_name, $new_file_name) or system("mv", $old_file_name, $new_file_name);
         if (-e $old_file_name) {
@@ -409,9 +409,9 @@ sub start_html_listener {
 
 sub start_html_message_trigger {
     my $child_id=fork(); ### VG: for windows there is a "simulation of the "fork"", no new procs... One can use Win32::Process::Create
-    
+
     if ($child_id) {
-        # parent 
+        # parent
 #	    print "started listener trigger\n";
     } else {
         my $buffer_size = 1024;
@@ -440,7 +440,7 @@ sub start_html_message_trigger {
 
 sub get_html_orders {
 #    print "Parent gonna read\n";
-    return if (!$interactive);    
+    return if (!$interactive);
     my $buffer_size = 1024;
     my $buffer;
     my $rv;
@@ -538,8 +538,7 @@ sub schedule_rebuild {
         };
     };
 };
-    
-    
+
 #
 # procedure retrieves build list path
 # (all possibilities are taken into account)
@@ -566,7 +565,7 @@ sub get_build_list_path {
     $build_list_paths{$module} = CorrectPath(retrieve_build_list($module)) if (!defined $build_list_paths{$module});
     return $build_list_paths{$module};
 };
-    
+
 #
 # Get dependencies hash of the current and all parent projects
 #
@@ -702,7 +701,7 @@ sub build_all {
             run_server();
         };
         while ($Prj = pick_prj_to_build(\%global_deps_hash)) {
-            if (!defined $dead_parents{$Prj}) {              
+            if (!defined $dead_parents{$Prj}) {
                 if (scalar keys %broken_build) {
                     print $echo . "Skipping project $Prj because of error(s)\n";
                     remove_from_dependencies($Prj, \%global_deps_hash);
@@ -718,7 +717,7 @@ sub build_all {
                 build_dependent(\%local_deps_hash);
                 print $check_error_string;
             };
-            
+
             remove_from_dependencies($Prj, \%global_deps_hash);
             $build_is_finished{$Prj}++;
         };
@@ -751,12 +750,12 @@ sub initialize_html_info {
     return if (defined $dead_parents{$module});
     $html_info{$module} = { 'DIRS' => [],
                             'ERRORFUL' => [],
-                            'SUCCESSFUL' => [], 
+                            'SUCCESSFUL' => [],
                             'BUILD_TIME' => 0};
 }
 
 #
-# Do job 
+# Do job
 #
 sub dmake_dir {
     my ($new_job_name, $error_code);
@@ -848,7 +847,7 @@ sub get_parents_array {
     my $module = shift;
     store_build_list_content($module);
     my $build_list_ref = $build_lists_hash{$module};
-    
+
     if (ref($build_list_ref) eq 'XMLBuildListParser') {
         return $build_list_ref->getModuleDependencies(\@modes_array);
     };
@@ -902,7 +901,7 @@ sub get_deps_from_object {
         $PathHash{$dir} = $module_paths{$module};
         $PathHash{$dir} .= $dir if ($dir ne '/');
         my %deps_hash = ();
-        
+
         foreach my $dep ($build_list_object->getJobDependencies($dir, "make", $ENV{GUI})) {
             $deps_hash{$dep}++;
         };
@@ -1126,9 +1125,9 @@ sub get_commands {
             $check_error_string = "if \"\%?\" != \"0\" quit\n";
         };
     };
-    
+
     $dmake_args = join(' ', 'dmake', @dmake_args);
-    
+
     while ($arg = pop(@dmake_args)) {
         $dmake .= ' '.$arg;
     };
@@ -1154,7 +1153,7 @@ sub get_stand_dir {
         $initial_module = $`;
     };
     $module_paths{$initial_module} = $StandDir . "/$initial_module";
-#    $build_list_paths{$initial_module} =$StandDir . '/prj/'.$_; 
+#    $build_list_paths{$initial_module} =$StandDir . '/prj/'.$_;
 #    if ( defined $ENV{PWD} ) {
 #	    $StandDir = $ENV{PWD};
 #	} elsif (defined $ENV{_cwd}) {
@@ -1167,7 +1166,7 @@ sub get_stand_dir {
 #        foreach (@possible_build_lists) {# ('build.lst', 'build.xlist');
 #            if (-e $StandDir . '/prj/'.$_) {
 #                $initial_module = File::Basename::basename($StandDir);
-#                $build_list_paths{$initial_module} =$StandDir . '/prj/'.$_; 
+#                $build_list_paths{$initial_module} =$StandDir . '/prj/'.$_;
 #                $StandDir = File::Basename::dirname($StandDir);
 #                $module_paths{$initial_module} = $StandDir . "/$initial_module";
                 return $StandDir;
@@ -1591,7 +1590,7 @@ sub get_options {
         $cmd_file = '';
     };
     print_error('Switches --job and --deliver collision') if ($custom_job && $deliver);
-    $custom_job = 'deliver' if $deliver; 
+    $custom_job = 'deliver' if $deliver;
     $post_job = 'deliver' if (!$custom_job);
     $incompatible = scalar keys %incompatibles;
     if ($prepare) {
@@ -1664,7 +1663,7 @@ sub get_module_and_buildlist_paths {
 
 sub get_dmake_args {
     my $arg;
-    my @job_args = (); 
+    my @job_args = ();
     while ($arg = shift @ARGV) {
         next if ($arg =~ /^--$/);
         push (@job_args, $arg);
@@ -1732,12 +1731,14 @@ sub cancel_build {
     }
     print "-----------------------------------------------------------------------\n";
     print "\n";
+    print "" . $ENV{'OOO_SHELL'} . "\n";
     print "cd " . $ENV{'SRC_ROOT'} . "\n";
     print "source ./" . $ENV{'ENV_SCRIPT'} . ".sh\n";
     print "cd $module\n";
     print "build\n";
     print "\n";
-    print "when you have isolated and fixed the problem re-run 'make' from the top-level\n";
+    print "when the problem is isolated and fixed exit and re-run 'make' from the top-level\n";
+    print "sometimes (sadly) it is necessary to rm -Rf " . $ENV{INPATH} . " in a module.\n";
 
     do_exit(1);
 };
@@ -1759,7 +1760,7 @@ sub store_error {
     $broken_build{$child_nick} = $error_code;
     if ($stop_build_on_error) {
         clear_from_child($pid);
-        # Let all children finish their work 
+        # Let all children finish their work
         while (children_number()) {
             handle_dead_children(1);
         };
@@ -1816,7 +1817,7 @@ sub handle_dead_children {
 
 sub give_second_chance {
     my $pid = shift;
-    # A malicious hack for misterious windows problems - try 2 times 
+    # A malicious hack for misterious windows problems - try 2 times
     # to run dmake in the same directory if errors occurs
     my $child_nick = $processes_hash{$pid};
     $running_children{$folders_hashes{$child_nick}}--;
@@ -1971,7 +1972,7 @@ sub build_multiprocessing {
 #        print "#### 1988: Starting waiting for dead child\n";
         handle_dead_children(1);
     };
-    # Let all children finish their work 
+    # Let all children finish their work
     while (children_number()) {
         handle_dead_children(1);
     };
@@ -1994,10 +1995,10 @@ sub mp_success_exit {
 #
 sub build_actual_queue {
     my $build_queue = shift;
-    my $finished_projects = 0; 
+    my $finished_projects = 0;
     do {
         my @sorted_queue = sort {(scalar keys %{$projects_deps_hash{$a}}) <=> (scalar keys %{$projects_deps_hash{$b}})} keys %$build_queue;
-        my $started_children = 0; 
+        my $started_children = 0;
 #        foreach $Prj (@sorted_queue) {
         foreach $Prj (keys %$build_queue) {
             get_html_orders();
@@ -2049,7 +2050,7 @@ sub run_job {
     $registered_name = $path if (!defined $registered_name);
     chdir $path;
     getcwd();
-    
+
     if ($html) {
         my $log_file = $jobs_hash{$registered_name}->{LONG_LOG_PATH};
         my $log_dir = File::Basename::dirname($log_file);
@@ -2080,7 +2081,7 @@ sub do_custom_job {
     } else {
         $error_code = run_job($job, $module_paths{$module}, $module_job);
         if ($error_code) {
-            # give windows one more chance 
+            # give windows one more chance
             if ($ENV{GUI} eq 'WNT') {
                 $error_code = run_job($job, $module_paths{$module}, $module_job);
             };
@@ -2214,7 +2215,7 @@ sub ensure_clear_module {
     if ($modules_types{$module} eq 'lnk' && (File::Basename::basename($module_paths{$module}) ne $module)) {
         if(rename($module_paths{$module}, File::Basename::dirname($module_paths{$module}) ."/$module")) {
             $module_paths{$module} = File::Basename::dirname($module_paths{$module}) ."/$module";
-            clear_module($module); 
+            clear_module($module);
         } else {
             print_error("Cannot rename link to $module. Please rename it manually");
         };
@@ -2288,7 +2289,7 @@ sub get_tmp_dir {
 sub retrieve_build_list {
     my $module = shift;
     my $old_fh = select(STDOUT);
-    
+
     # Try to get global depencies from solver's build.lst if such exists
     my $solver_inc_dir = "$ENV{SOLARVER}/common";
     $solver_inc_dir .= $ENV{PROEXT} if (defined $ENV{PROEXT});
@@ -2542,10 +2543,10 @@ sub get_platforms {
             get_workspace_platforms(\%platforms);
         };
     };
-    
+
     if (!scalar keys %platforms) {
         # An Auses wish - fallback to INPATH for new platforms
-        if (defined $ENV{INPATH}) { 
+        if (defined $ENV{INPATH}) {
             $$platforms_ref{$ENV{INPATH}}++;
         } else {
             print_error("There is no platform found!!") ;
@@ -2567,7 +2568,7 @@ sub clear_delivered {
         $only_common = '';
     };
     print "$message\n";
-    
+
     foreach my $platform (keys %platforms) {
         print "\nRemoving files delivered for $platform\n";
         my %solar_vars = ();
@@ -2619,12 +2620,12 @@ sub read_ssolar_vars {
         $pro = "-pro";
         $platform = $`;
     };
-    
+
     my ($verswitch, $source_root, $cwsname);
     $verswitch = "-ver $ENV{UPDMINOR}" if (defined $ENV{UPDMINOR});
     $source_root = '-sourceroot' if (defined $ENV{SOURCE_ROOT_USED});
     $cws_name = "-cwsname $ENV{CWS_WORK_STAMP}" if (defined $ENV{CWS_WORK_STAMP});
-    
+
     my $param = "-$ENV{WORK_STAMP} $verswitch $source_root $cws_name $pro $platform";
     my $ss_command = "$perl $setsolar -file $tmp_file $param $nul";
     if (system($ss_command)) {
@@ -2753,7 +2754,7 @@ sub sort_modules_appearance {
     foreach (keys %build_is_finished) {
         delete $build_in_progress{$_} if (defined $build_in_progress{$_});
         delete $build_in_progress_shown{$_} if (defined $build_in_progress_shown{$_});
-    }; 
+    };
     @modules_order = sort keys %modules_with_errors;
     foreach (keys %modules_with_errors) {
         delete $build_in_progress{$_} if (defined $build_in_progress{$_});
@@ -2844,7 +2845,7 @@ sub generate_html_file {
         next if ($modules_types{$_} eq 'lnk');
         next if (!defined $active_modules{$_});
         my ($errors_info_line, $dirs_info_line, $errors_number, $successes_percent, $errors_percent, $time) = get_html_info($_);
-#<one module> 
+#<one module>
         print HTML 'document.write("    <tr>");' . "\n";
         print HTML 'document.write("        <td width=*>");' . "\n";
 
@@ -2862,7 +2863,7 @@ sub generate_html_file {
         } else {
 #            print HTML 'document.write("<em style=color:gray>' . $_ . '</em>");';
 ####            print HTML 'document.write("<em style=color:gray>' . $_ ."href=\'http://$local_host_ip:$html_port/delete=\'$_". '</em>");';
-            
+
             print HTML 'document.write("            <a target=\'infoframe\' id=';
             print HTML $_;
             print HTML ' href=\"javascript:void(0)\"; title=\"Remove module\">' . $_ . '</a>");' . "\n";
@@ -2874,7 +2875,7 @@ sub generate_html_file {
         print HTML 'document.write("            <table width=100% valign=top cellpadding=0 hspace=0 vspace=0 cellspacing=0 border=0>");' . "\n";
         print HTML 'document.write("                <tr>");' . "\n";
         print HTML 'document.write("                    <td height=15* width=';
-                
+
         print HTML $successes_percent + $errors_percent;
         if ($errors_number) {
             print HTML '% bgcolor=red valign=top></td>");' . "\n";
@@ -2882,7 +2883,7 @@ sub generate_html_file {
             print HTML '% bgcolor=#25A528 valign=top></td>");' . "\n";
         };
         print HTML 'document.write("                    <td width=';
-                
+
         print HTML 100 - ($successes_percent + $errors_percent);
         print HTML '% bgcolor=lightgrey valign=top></td>");' . "\n";
         print HTML 'document.write("                </tr>");' . "\n";
@@ -2891,7 +2892,7 @@ sub generate_html_file {
         print HTML 'document.write("        <td align=\"center\">', $time, '</td>");' . "\n";
         print HTML 'document.write("    </tr>");' . "\n";
 # </one module>
-    } 
+    }
     print HTML 'document.write("        </table>");' . "\n";
     print HTML 'document.write("    </body>");' . "\n";
     print HTML 'document.write("</html>");' . "\n";
@@ -2982,7 +2983,7 @@ sub generate_html_file {
     print HTML '    document.write("Click on the project of interest");' . "\n";
     print HTML '    document.close();' . "\n";
     print HTML '}    function getStatusInnerHTML(Status) {        var StatusInnerHtml;' . "\n";
-    print HTML '    if (Status == "success") {' . "\n";            
+    print HTML '    if (Status == "success") {' . "\n";
     print HTML '        StatusInnerHtml = "<em style=color:green>";' . "\n";
     print HTML '    } else if (Status == "building") {' . "\n";
     print HTML '        StatusInnerHtml = "<em style=color:blue>";' . "\n";
@@ -3000,7 +3001,7 @@ sub generate_html_file {
     if (defined $html_path) {
         print HTML 'file://';
     }
-    print HTML '+ LogFilePath + " width=100%></iframe>");' . "\n"; 
+    print HTML '+ LogFilePath + " width=100%></iframe>");' . "\n";
     print HTML '    top.innerFrame.frames[2].document.close();' . "\n";
     print HTML '};' . "\n";
     print HTML 'function FillFrame_1(Module, Message1, Message2) {' . "\n";
@@ -3092,7 +3093,7 @@ sub generate_html_file {
     print HTML '     top.innerFrame.frames[0].document.location.reload();' . "\n";
     print HTML '     refreshInfoFrames();' . "\n";
     print HTML '};' . "\n\n";
-    
+
     print HTML 'function setRefreshRate() {' . "\n";
     print HTML '    RefreshRate = document.Formular.rate.value;' . "\n";
     print HTML '    if (!isNaN(RefreshRate * 1)) {' . "\n";
@@ -3435,7 +3436,7 @@ sub run_server {
             clear_from_child($pid);
             delete $clients_jobs{$pid};
             $verbose_mode && print 'Running processes: ', children_number(), "\n";
-            # Actually, next 3 strings are only for even distribution 
+            # Actually, next 3 strings are only for even distribution
             # of clients if there are more than one build server running
             print $new_socket_obj 'No job';
             close($new_socket_obj);


More information about the Libreoffice-commits mailing list