[kdesrc-build/make_it_mojo] /: Merge remote-tracking branch 'origin/master' into make_it_mojo

Michael Pyne null at kde.org
Sat Sep 22 02:02:58 BST 2018


Git commit d022bb04297e05d819eedd1d9fca5101c8a960f8 by Michael Pyne.
Committed on 19/08/2018 at 21:49.
Pushed by mpyne into branch 'make_it_mojo'.

Merge remote-tracking branch 'origin/master' into make_it_mojo

Conflicts:
	modules/ksb/BuildSystem.pm

M  +7    -1    CMakeLists.txt
M  +10   -10   doc/index.docbook
M  +26   -19   modules/ksb/BuildContext.pm
M  +36   -18   modules/ksb/BuildSystem.pm
M  +1    -1    modules/ksb/BuildSystem/KDE4.pm
M  +12   -4    modules/ksb/Module.pm

https://commits.kde.org/kdesrc-build/d022bb04297e05d819eedd1d9fca5101c8a960f8

diff --cc modules/ksb/BuildSystem.pm
index e20a47f,87988e8..7c0486c
--- a/modules/ksb/BuildSystem.pm
+++ b/modules/ksb/BuildSystem.pm
@@@ -438,41 -438,63 +441,56 @@@ sub _runBuildComman
      # 2. When we're debugging (we'd interfere with debugging output).
      if (! -t STDERR || debugging())
      {
-         return log_command($module, $filename, $argRef);
 -        note("\t$message");
+         $resultRef->{was_successful} = (0 == log_command($module, $filename, $argRef));
+         return $resultRef;
      }
  
-     # Run for every line of build output to do things like scrape for progress
-     # output.
 -    my $time = time;
 -
 -    my $statusViewer = $ctx->statusViewer();
 -    $statusViewer->setStatus("\t$message");
 -    $statusViewer->update();
 -
+     # TODO More details
+     my $warnings = 0;
+ 
 -    # w00t.  Check out the closure!  Maks would be so proud.
      my $log_command_callback = sub {
 +        state $oldX = -1;
 +        state $oldY = -1;
 +
          my $input = shift;
-         if (not defined $input) {
-             return;
-         }
+         return if not defined $input;
  
 +        my ($x, $y);
          my ($percentage) = ($input =~ /^\[\s*([0-9]+)%]/);
          if ($percentage) {
 -            $statusViewer->setProgressTotal(100);
 -            $statusViewer->setProgress($percentage);
 +            $x = int $percentage; $y = 100;
          }
          else {
 -            my ($x, $y) = ($input =~ /^\[([0-9]+)\/([0-9]+)] /);
 -            if ($x && $y) {
 -                # ninja-syntax
 -                $statusViewer->setProgressTotal($y);
 -                $statusViewer->setProgress($x);
 -            }
 +            # ninja-syntax
 +            my ($newX, $newY) = ($input =~ /^\[([0-9]+)\/([0-9]+)] /);
 +            return unless ($newX && $newY);
 +
 +            ($x, $y) = (int $newX, int $newY);
 +        }
 +
 +        if ($x != $oldX || $y != $oldY) {
 +            ksb::Debug::reportProgressToParent($module, $x, $y);
          }
+ 
+         $warnings++ if ($input =~ /warning: /);
      };
  
-     return log_command($module, $filename, $argRef, {
+     $resultRef->{was_successful} =
+         (0 == log_command($module, $filename, $argRef, {
              callback => $log_command_callback
-         });
+         }));
+     $resultRef->{warnings} = $warnings;
+ 
 -    # Cleanup TTY output.
 -    $time = prettify_seconds(time - $time);
 -    my $status = $resultRef->{was_successful} ? "g[b[succeeded]" : "r[b[failed]";
 -    $statusViewer->releaseTTY("\t$message $status (after $time)\n");
 -
+     if ($warnings) {
+         my $count = ($warnings < 3  ) ? 1 :
+                     ($warnings < 10 ) ? 2 :
+                     ($warnings < 30 ) ? 3 : 4;
+         my $msg = sprintf("%s b[y[$warnings] %s", '-' x $count, '-' x $count);
+         note ("\tNote: $msg compile warnings");
+         $self->{module}->setPersistentOption('last-compile-warnings', $warnings);
+     }
+ 
+     return $resultRef;
  }
  
  1;



More information about the kde-doc-english mailing list