ui: Slight updates to improve status viewer.

wilder
Michael Pyne 11 years ago
parent ba72f65285
commit f6ea3abf27
  1. 4
      modules/ksb/Application.pm
  2. 2
      modules/ksb/BuildSystem.pm
  3. 5
      modules/ksb/Debug.pm
  4. 6
      modules/ksb/StatusView.pm
  5. 12
      modules/ksb/Util.pm

@ -1371,10 +1371,10 @@ sub _handle_build
$ctx->unsetPersistentOption('global', 'resume-list');
my $outfile = pretending() ? undef
my $outfile = pretending() ? '/dev/null'
: $ctx->getLogDir() . '/build-status';
open (STATUS_FILE, '>', $outfile // '/dev/null') or do {
open (STATUS_FILE, '>', $outfile) or do {
error (<<EOF);
Unable to open output status file r[b[$outfile]
You won't be able to use the g[--resume] switch next run.\n";

@ -435,7 +435,7 @@ sub _runBuildCommand
my $input = shift;
if (not defined $input) {
# End of input, cleanup.
$statusViewer->releaseTTY();
$statusViewer->releaseTTY("\t$message done");
return;
}

@ -1,4 +1,4 @@
package ksb::Debug;
package ksb::Debug 0.20;
# Debugging routines and constants for use with kdesrc-build
@ -6,11 +6,10 @@ use strict;
use warnings;
use 5.014;
our $VERSION = '0.10';
use Exporter qw(import); # Steal Exporter's import method
our @EXPORT = qw(debug pretending debugging whisper
note info warning error pretend);
our @EXPORT_OK = qw(colorize);
# Debugging level constants.
use constant {

@ -10,7 +10,7 @@ use strict;
use warnings;
use 5.014;
use ksb::Debug;
use ksb::Debug 0.20 qw(colorize);
use IO::Handle;
@ -68,7 +68,7 @@ sub update
);
}
else {
$msg = $self->{status} .
$msg = $self->{status} . ' ' .
substr($spinner, $self->{cur_progress} % length($spinner), 1);
}
@ -89,6 +89,8 @@ sub _clearLineAndUpdate
{
my $msg = shift;
$msg = colorize($msg);
# Give escape sequence to return to column 1 and clear the entire line
# Then print message and return to column 1 again in case somewhere else
# uses the tty.

@ -443,6 +443,12 @@ sub log_command
debug ("log_command(): Module $module, Command: ", join(' ', @command));
if (pretending())
{
pretend ("\tWould have run g['" . join ("' '", @command) . "'");
return 0;
}
# Fork a child, with its stdout connected to CHILD.
my $pid = open(CHILD, '-|');
if ($pid)
@ -482,12 +488,6 @@ sub log_command
# Apply altered environment variables.
$module->buildContext()->commitEnvironmentChanges();
if (pretending())
{
pretend ("\tWould have run g['" . join ("' '", @command) . "'");
POSIX::_exit(0);
}
my $logdir = $module->getLogDir();
if (!$logdir || ! -e $logdir)
{

Loading…
Cancel
Save