-
Notifications
You must be signed in to change notification settings - Fork 75
/
.changelog
executable file
·63 lines (59 loc) · 1.64 KB
/
.changelog
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/perl
my $ignore = 0;
my $indent_l1 = " ";
my $indent_l2 = $indent_l1.$indent_l1;
my $indent;
$ENV{LC_ALL} = "C";
while (my $line = <>) {
if ($ignore < 2) {
$ignore = 0;
}
if ($line =~ /^commit/) {
$ignore = 1;
}
if ($line =~ /^Merge|Conflicts/) {
$ignore = 2;
}
if (($ignore < 2) && ($line =~ /^Author: .*<(.*)@(.*)>/)) {
$name = $1;
$add = $2;
if ($name eq 'ms') {
# for ms as contributor use suse.de domain in any case
# prevents incompatible changes to the changelog already
# published
$add = 'suse.de'
}
$ignore = 1;
}
next if ($ignore);
if ($line =~ /^Date: (.*) [\+-].*/) {
if (@out) {
my $outstr = join (" ",@out);
if ($outstr !~ /added changelog|Merge branch|git-svn-id:/i) {
print @out;
}
undef @out;
}
my $date = qx /date --date="$1"/; chomp $date;
push @out, "------------------------------------------------------------------\n";
push @out, "$date - $name\@$add\n";
undef $date;
$ignore = 0;
$count = 0;
} else {
$line =~ s/^ +//;
if ($line =~ /^-/) {
push @out, $line;
$indent = $indent_l1;
} elsif (($line =~ /^[a-zA-Z]/) && ($count == 1)) {
push @out, "- ".$line;
$indent = $indent_l1;
} elsif ($line =~ /^[\*,\+]/) {
push @out, $indent_l1.$line;
$indent = $indent_l2;
} else {
push @out, $indent.$line;
}
$count++;
}
}