From 446f3b110733b8a824955f1887bfdd31d23dcc05 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 31 Oct 2010 21:01:45 +0000 Subject: [PATCH] support adding .git-revid output to various things, notably layout --- iwjpictest/insn-aliases.inc-gen | 5 +++-- layout/layout | 5 ++++- layout/slopecalc | 5 ++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/iwjpictest/insn-aliases.inc-gen b/iwjpictest/insn-aliases.inc-gen index 67abc70..1acd6b3 100755 --- a/iwjpictest/insn-aliases.inc-gen +++ b/iwjpictest/insn-aliases.inc-gen @@ -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 diff --git a/layout/layout b/layout/layout index 626993f..9fc7ea9 100755 --- a/layout/layout +++ b/layout/layout @@ -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". diff --git a/layout/slopecalc b/layout/slopecalc index 4fb1145..a89dd5e 100755 --- a/layout/slopecalc +++ b/layout/slopecalc @@ -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 \$" ); -- 2.30.2