From: Łukasz Stelmach Date: Fri, 6 May 2022 11:36:31 +0000 (+0200) Subject: Print dependency expansion debug messages to STDERR X-Git-Tag: submit/trunk/20230104.135030^2~5^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F08%2F284608%2F2;p=tools%2Fbuild.git Print dependency expansion debug messages to STDERR Change-Id: Ib46da61c550b3a5b82612d79ccdcd5561d7c9ee3 Signed-off-by: Łukasz Stelmach --- 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;