]> arthur.barton.de Git - bup.git/blob - format-subst.pl
Update version extraction for _version.py to work with the new tag syntax.
[bup.git] / format-subst.pl
1 #!/usr/bin/env perl
2 use warnings;
3 use strict;
4
5 sub fix($) {
6     my $s = shift;
7     chomp $s;
8     return $s;
9 }
10
11 while (<>) {
12     s{
13         \$Format:\%d\$
14     }{
15         my $tag = fix(`git describe --match="[0-9]*"`);
16         "(tag: bup-$tag)"
17     }ex;
18     
19     s{ 
20         \$Format:([^\$].*)\$
21     }{
22         fix(`git log -1 --pretty=format:"$1"`)
23     }ex;
24     print;
25 }