X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=bup.git;a=blobdiff_plain;f=format-subst.pl;h=8a331bff2942008869476064f603feac82fbcbe1;hp=8b834c42ea6127432caf9374a42affdba440612f;hb=refs%2Fheads%2Funused-variable-do_bloom;hpb=4c560aa94b7cbeabb3c6d10df2a5db30e22fe84f diff --git a/format-subst.pl b/format-subst.pl index 8b834c4..8a331bf 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 --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; }