From: Ian Jackson Date: Sat, 31 Oct 2009 16:08:30 +0000 (+0000) Subject: commodity ordering: more comprehensive output X-Git-Tag: 6.0~25 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=commitdiff_plain;h=3f93cfabd49eeaaca06358f87d9324a5b2e6c211 commodity ordering: more comprehensive output --- diff --git a/yarrg/commod-results-processor b/yarrg/commod-results-processor index de65f1b..9525330 100755 --- a/yarrg/commod-results-processor +++ b/yarrg/commod-results-processor @@ -227,15 +227,24 @@ sub main__tsv () { write_tsv(\*STDOUT); } +sub undef_printable { my ($ov)= @_; defined $ov ? $ov : '?'; }; + +sub commodsinorder_print1 ($$) { + my ($keyword,$commod) = @_; + printf("%s\t%-40s %10s %s", + $keyword, + $commod, + undef_printable($commods{$commod}{Ordval}), + undef_printable($commods{$commod}{Class})) + or die $!; +} + sub main__commodsinorder () { parse_info_serverside(); my $last_ov; foreach my $commod (@commods_inorder) { my $ov= $commods{$commod}{Ordval}; - printf("found\t%-40s %10s", - $commod, - defined $ov ? $ov : '?') - or die $!; + commodsinorder_print1('found',$commod); if (defined $ov) { if (defined $last_ov && $ov <= $last_ov) { print " out-of-order" or die $!; @@ -244,9 +253,13 @@ sub main__commodsinorder () { } print "\n" or die $!; } - foreach my $commod (sort keys %commods) { + foreach my $commod (sort { + undef_printable($commods{$a}{Ordval}) cmp + undef_printable($commods{$b}{Ordval}) + } keys %commods) { next if exists $commod{$commod}; - printf "missing\t%s\n", $commod or die $!; + commodsinorder_print1('none',$commod); + print "\n" or die $!; } }