[buildd-tools-devel] Bug#763635: Bug#763635: sbuild: sbuild-update writes a stray line to stderr

Adam Borowski kilobyte at angband.pl
Wed Oct 1 19:45:22 UTC 2014


On Wed, Oct 01, 2014 at 07:32:26PM +0100, Wookey wrote:
> The issue is this line in lib/Sbuild/ResolverBase.pm:
>  $self->log("Initial foreign arches: '@existing_foreign_arches'\n");
> 
> Which is a boring $self->log function like many many others. The only
> unusual thing is the use of an array var. I don't know why passing the
> array in string context to the log function is making this line come
> out on the wrong file handle.
> 
> I thought the below would fix it, but it doesn't:
> -    $self->log("Initial foreign arches: '@existing_foreign_arches'\n");
> +    $self->log('Initial foreign arches: ' . join (' ', @existing_foreign_arches) . "\n");
> 
> Running sbuild alone almost everything ends up in the log file as
> expected, there are a few lines on stdout, and the offending line is
> not on stderr, so why the different behaviour in sbuild-update?

The log() function doesn't come from Perl but from sbuild.  It does:

# sub log {
#     my $self = shift;
# 
#     my $logfile = $self->get('Log Stream');
#     if (defined($logfile)) {
#         print $logfile @_;  
#     } else {
#         debug("E: Attempt to log to nonexistent log stream\n")
#             if (!defined($self->get('Log Stream Error')) ||   
#                 !$self->get('Log Stream Error'));
#         print STDERR @_;
#         $self->set('Log Stream Error', 1)
#     }
# }

Running with $debug set to 1 confirms that indeed $logfile is not set up
yet.  So it appears you're calling log() too early.

-- 
// If you believe in so-called "intellectual property", please immediately
// cease using counterfeit alphabets.  Instead, contact the nearest temple
// of Amon, whose priests will provide you with scribal services for all
// your writing needs, for Reasonable and Non-Discriminatory prices.



More information about the Buildd-tools-devel mailing list