Commit ab30d925 authored by Michael Pyne's avatar Michael Pyne
Browse files

Recognize the --no-rebuild-on-fail command line option, mere months after it

was documented as existing. :(

Fix color output nag.

kdesvn-build will now create a symlink to the log file describing the error if
a module fails to build.  What this means is that if e.g. kdebase failed to
build, you could open ~/kdesvn/log/latest/kdebase/error.log to find out why
instead of using Tab-completion to find
~/kdesvn/log/latest/kdebase/build-3.log (or svn-co.log, or configure.log, etc).

svn path=/trunk/KDE/kdesdk/scripts/kdesvn-build; revision=437469
parent 5a460867
......@@ -918,9 +918,10 @@ sub log_command
# If the module fails building, set an internal flag in the module
# options with the name of the log file containing the error message.
$package_opts{$module}{'#error-log-file'} = "$logdir/$filename.log" if $?;
my $result = $?;
set_error_logfile($module, "$filename.log") if $result;
return $?;
return $result;
}
else
{
......@@ -965,6 +966,31 @@ sub log_command
}
}
# Subroutine to mark a file as being the error log for a module. This also
# creates a symlink in the module log directory for easy viewing.
# First parameter is the module in question.
# Second parameter is the filename in the log directory of the error log.
sub set_error_logfile
{
my ($module, $logfile) = @_;
my $logdir = get_log_dir($module);
set_option($module, '#error-log-file', "$logdir/$logfile");
# Setup symlink in the module log directory pointing to the appropriate
# file. Make sure to remove it first if it already exists.
unlink("$logdir/error.log") if -l "$logdir/error.log";
if(-e "$logdir/error.log")
{
# Maybe it was a regular file?
print clr "rb[ * Unable to create symlink to error log file, error.log already exists].\n";
return 0;
}
system('ln', '-s', "$logdir/$logfile", "$logdir/error.log");
}
# Subroutine to run make/unsermake with redirected STDOUT and STDERR,
# and to process the percentage in unsermake (-p). First parameter
# is name of the log file (relative to the log directory), and the
......@@ -1020,9 +1046,10 @@ sub run_make_command
# If the module fails building, set an internal flag in the module
# options with the name of the log file containing the error message.
$package_opts{$module}{'#error-log-file'} = "$logdir/$filename.log" if $?;
my $result = $?;
set_error_logfile($module, "$filename.log") if $result;
return $?;
return $result;
}
else
{
......@@ -1850,6 +1877,11 @@ DONE
last SWITCH;
};
/^--no-rebuild-on-fail$/ && do {
set_option('global', '#no-rebuild-on-fail', 1);
last SWITCH;
};
/^--nice(=.*)?$/ && do {
my $niceness = extract_option_value($_, @ARGV);
......@@ -3295,7 +3327,7 @@ EOF
# Don't remove the old modules, but re-run make -f
# Makefile.cvs and configure.
print "\n\tStill couldn't build, recreating build system (builddir is safe).\n";
print "\tTook $elapsed of time.\n";
print clr "\tTook g[$elapsed] of time.\n";
$package_opts{$module}->{'#cancel-clean'} = 1;
$package_opts{$module}->{'refresh-build'} = 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment