chiark / gitweb /
include git revision in usvg note
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 2 Oct 2020 22:01:27 +0000 (23:01 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 2 Oct 2020 22:02:52 +0000 (23:02 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
usvg-processor

index 9985a274d607684e6103e281fcba43d08b2ef0e9..c043cd2a5a5a4c0a52efc023d2dc5e461dd2c161 100755 (executable)
@@ -9,10 +9,15 @@ open STDOUT, '>', "$out.tmp" or die $!;
 open L, '<', $lic or die $!;
 open STDIN, "<", $in or die $!;
 
+$!=0; my $git = `git rev-parse HEAD`;       die "$? $!" if $! || $?;
+$!=0; my $plus = `git status --porcelain`;  die "$? $!" if $! || $?;
+chomp $git; chomp $plus;
+$git .= "+" if length $plus;
+
 sub add_lic () {
   while (<L>) {
     next unless m{^\s*SPDX-License-Identifier:\s+(\S.*?)\s*$};
-    print "<!-- otter $out $1, see $lic -->\n" or die $!;
+    print "<!-- otter.git#$git $out $1, see $lic -->\n" or die $!;
     return;
   }
   die "no spdx in $lic ?";