[openssl-commits] [tools] master update

Rich Salz rsalz at openssl.org
Thu Nov 9 16:45:34 UTC 2017


The branch master has been updated
       via  9a7c7931d7d8d1b26955026acdd32a1fa447cc95 (commit)
      from  4541a9148f4228ab41b2098a1f1920cd62373d06 (commit)


- Log -----------------------------------------------------------------
commit 9a7c7931d7d8d1b26955026acdd32a1fa447cc95
Author: Rich Salz <rsalz at openssl.org>
Date:   Thu Nov 9 11:44:41 2017 -0500

    Tweak output format, add warning

-----------------------------------------------------------------------

Summary of changes:
 license/add-counts | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/license/add-counts b/license/add-counts
index e842fc4..4a796fe 100755
--- a/license/add-counts
+++ b/license/add-counts
@@ -4,6 +4,8 @@
 use strict;
 use warnings;
 
+die "Feed this the output of 'get-followups -d'\n" if -t 0;
+
 while ( <> ) {
     unless ( /([0-da-f]{8}) .*/ ) {
 	print;
@@ -11,6 +13,7 @@ while ( <> ) {
     }
     my $cid = $1;
     my $line = $_;
+    $line =~ s/^\s*//;
     if ( $cid eq 'd02b48c6' ) {
 	print "931 +17534 -0 ", $_;
 	next;
@@ -19,14 +22,20 @@ while ( <> ) {
     my $files = 0;
     my $adds = 0;
     my $dels = 0;
+    my $name = '';
     open my $F, "git diff --numstat $pattern|"
 	|| die "Can't open git diff, $!\n";
     while ( <$F> ) {
 	$files++;
-	next unless /(\d+)\s+(\d+)/;
+	next unless /(\d+)\s+(\d+)\s+(.*)/;
 	$adds += int($1);
 	$dels += int($2);
+	$name = $3 if $name eq '';
     }
     close $F || die "Can't close git diff, $!\n";
-    print "$files +$adds -$dels $line";
+    if ( $files == 1 ) {
+	print "$name +$adds -$dels $line";
+    } else {
+	print "$files +$adds -$dels $line";
+    }
 }


More information about the openssl-commits mailing list