X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=format-subst.pl;h=42b255dc278984395ac674027ac3a611cfda94e9;hb=76d21773149cda0b7f2e29e10f7bfbc2c317bcbf;hp=e04e1238965d67c98b901d4f6de8eea3018866f0;hpb=7949755a2e9fc27ddcc9239efa6cd4c0f47f4d11;p=bup.git diff --git a/format-subst.pl b/format-subst.pl index e04e123..42b255d 100755 --- a/format-subst.pl +++ b/format-subst.pl @@ -8,18 +8,25 @@ sub fix($) { return $s; } +sub ex +{ + my ($cmd) = @_; + my $result = `$cmd` or die 'FAILED: ' . $cmd; + return $result; +} + while (<>) { s{ \$Format:\%d\$ }{ - my $tag = fix(`git describe --match="bup-*"`); - "(tag: $tag)" + my $tag = fix(ex('git describe --always --match="[0-9]*"')); + "(tag: bup-$tag)" }ex; s{ \$Format:([^\$].*)\$ }{ - fix(`git log -1 --format="$1"`) + fix(ex("git log -1 --pretty=format:'$1'")) }ex; print; }