summaryrefslogtreecommitdiffstats
path: root/gitmirror/robotfmt.pl
blob: 0eeefed289d3527b88b78bbafe0241b21bd7351d (plain)
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
26
27
#!/usr/bin/perl

($mailto) = @ARGV;

$hdr = 1;
while (defined($line = <STDIN>)) {
    chomp $line;
    if ($hdr) {
	next if ($line =~ /^From /); # Skip line
	if ($line =~ /^Date:/) {
	    $date = $line;
	    next;
	}
	if ($line eq '') {
	    $hdr = 0;
	    print "To: $mailto\n";
	    print "X-Mailer: NASM-git-log-daemon\n";
	    print "\n";
	    print $date, "\n";
	    print "\n";
	    next;
	}
    }
    print $line, "\n";
}

exit 0;