chiark / gitweb /
support adding .git-revid output to various things, notably layout
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 31 Oct 2010 21:01:45 +0000 (21:01 +0000)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sun, 31 Oct 2010 21:01:45 +0000 (21:01 +0000)
iwjpictest/insn-aliases.inc-gen
layout/layout
layout/slopecalc

index 67abc706ef7482b5bae61247576d0265d78b835f..1acd6b3be26bb95e6f82e593a73407d8184ace23 100755 (executable)
@@ -47,8 +47,9 @@ flags xorlw   ZN
 if [ x$cohere != x ]; then
        sed <$0 -e '1,/^#'$cohere'--/d; /^#--0--/,$d'
        "$0" --descs | sort -t % -k 1.$sortkey
-       test "${PIPESTATUS[*]}" = "0 0"
-       sed <$0 -e '1,/^#--3--/d; /^#--0--/,$d'
+       trains_revid=`${0%/*}/../.git-revid`; export trains_revid
+       sed <$0 -e '1,/^#--3--/d; /^#--0--/,$d' |
+               perl -pe 's/\$Id\$/\$Id: $ENV{trains_revid} \$/'
        exit 0
 fi     
 
index 626993f45d133a23bf4d74dc8778097ad0973958..9fc7ea9e909cdcb27eedcfae0f12165e22fbee94 100755 (executable)
@@ -1873,7 +1873,10 @@ ol("grestore\n");
 
 if (@ident_strings && !($subsegcmapreq || %subsegcmap)) {
     my ($is);
-    $is= join('; ', @ident_strings);
+    my $dir= $0; $dir =~ s,/.*?$,,;
+    my $gitid= `$dir/../.git-revid`; $? and die $?; chomp $gitid;
+    unshift @ident_strings, $gitid;
+    $is= join('; ', grep { m/\S/ } @ident_strings);
     $is =~ s/[()\\]/\\$&/g;
     ol("25 50 moveto".
        "/Courier-New findfont 6 scalefont setfont\n".
index 4fb11455f6d5ad038f559fdc6b4fb139a12448be..a89dd5e173e7208dc717136d06803dd5cd5c01b2 100755 (executable)
@@ -238,7 +238,10 @@ lprintf("");
 lprintf("table of heights:");
 dump_schedule(1);
 
+my $dir= $0; $dir =~ s,/.*?$,,;
+my $gitid= `$dir/../.git-revid`; $? and die $?; chomp $gitid;
+
 lprintf("");
 lprintf("%s",
-       '$Id$'
+       "\$Id: $gitid \$"
     );