X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=format-subst.pl;h=42b255dc278984395ac674027ac3a611cfda94e9;hb=53504a83b7b373281a4a39e32a26b4997aaf0f60;hp=e91c3b8ad7f8cf23c5ca660ba1ca13db2e3ce3b2;hpb=67a38a4671e1b81ffd96b4109395a51cc2f4bbcb;p=bup.git diff --git a/format-subst.pl b/format-subst.pl index e91c3b8..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="[0-9]*"`); + my $tag = fix(ex('git describe --always --match="[0-9]*"')); "(tag: bup-$tag)" }ex; s{ \$Format:([^\$].*)\$ }{ - fix(`git log -1 --pretty=format:"$1"`) + fix(ex("git log -1 --pretty=format:'$1'")) }ex; print; }