File: format-subst.pl

package info (click to toggle)
bup 0.17b-2squeeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,416 kB
  • ctags: 1,420
  • sloc: python: 18,377; ansic: 311; sh: 284; perl: 160; makefile: 129
file content (25 lines) | stat: -rwxr-xr-x 330 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env perl
use warnings;
use strict;

sub fix($) {
    my $s = shift;
    chomp $s;
    return $s;
}

while (<>) {
    s{
	\$Format:\%d\$
    }{
	my $tag = fix(`git describe --match="bup-*"`);
	"(tag: $tag)"
    }ex;
    
    s{ 
	\$Format:([^\$].*)\$
    }{
	fix(`git log -1 --pretty=format:"$1"`)
    }ex;
    print;
}