From 8761d67e2303552f6dcfc75a39e07f0db42816d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Stelmach?= Date: Fri, 6 May 2022 13:36:31 +0200 Subject: [PATCH] Print dependency expansion debug messages to STDERR MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: Ib46da61c550b3a5b82612d79ccdcd5561d7c9ee3 Signed-off-by: Łukasz Stelmach --- Build.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Build.pm b/Build.pm index dd06de3..437fea3 100644 --- a/Build.pm +++ b/Build.pm @@ -26,7 +26,7 @@ use Build::Rpm; use Data::Dumper; use POSIX qw(strftime); -our $expand_dbg; +our $expand_dbg = $ENV{BUILD_EXPAND_DEBUG} || undef; our $do_rpm; our $do_deb; @@ -1040,7 +1040,7 @@ sub expand { } next if $p{$q[0]}; return (undef, "$q[0] $aconflicts{$q[0]}") if $aconflicts{$q[0]}; - print "added $q[0] because of $p (direct dep)\n" if $expand_dbg; + print STDERR "added $q[0] because of $p (direct dep)\n" if $expand_dbg; push @p, $q[0]; $p{$q[0]} = 1; $aconflicts{$_} = "conflict from project config with $q[0]" for @{$conflicts->{$q[0]} || []}; @@ -1097,7 +1097,7 @@ sub expand { } if (@q > 1 && !$doamb) { push @pamb, $p unless @pamb && $pamb[-1] eq $p; - print "undecided about $p:$r: @q\n" if $expand_dbg; + print STDERR "undecided about $p:$r: @q\n" if $expand_dbg; next; } if (@q > 1) { @@ -1125,7 +1125,7 @@ sub expand { if ($doamb == 2) { todo2recommended($config, \%recommended, \@rec_todo) if @rec_todo; my @pq = grep {$recommended{$_}} @q; - print "recommended [@pq] among [@q]\n" if $expand_dbg; + print STDERR "recommended [@pq] among [@q]\n" if $expand_dbg; @q = @pq if @pq; } if (@q > 1) { @@ -1138,7 +1138,7 @@ sub expand { next; } push @p, $q[0]; - print "added $q[0] because of $p:$r\n" if $expand_dbg; + print STDERR "added $q[0] because of $p:$r\n" if $expand_dbg; $p{$q[0]} = 1; $aconflicts{$_} = "conflict from project config with $q[0]" for @{$conflicts->{$q[0]} || []}; if (!$ignoreconflicts) { @@ -1163,7 +1163,7 @@ sub expand { @pamb = (); todo2recommended($config, \%recommended, \@rec_todo) if @rec_todo; $doamb = %recommended ? 2 : 3; - print "now doing undecided dependencies, $doamb = $doamb\n" if $expand_dbg; + print STDERR "now doing undecided dependencies, $doamb = $doamb\n" if $expand_dbg; next; } return undef, @error if @error; -- 2.34.1