forked from atomia/atomiadns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwikify_releasenotes.sh
executable file
·64 lines (51 loc) · 1.35 KB
/
wikify_releasenotes.sh
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
64
#!/bin/sh
program="Atomia DNS"
email="[email protected]"
# Example entry:
#
#atomiadns-masterserver (0.9.5) hardy; urgency=low
#
# * Fix .NET compatibility issues in RestoreZone, GetLabels and GetChangedZones
# * Improve argument parsing in atomiadnsclient
#
# -- Jimmy Bergman <[email protected]> Tue, 19 May 2009 08:27:45 +0200
latest_version="$(gawk '/urgency=/ { print gensub(/^.*\((.*)\).*$/, "\\1", ""); nextfile }' server/debian/changelog)"
gawk -vprogram="$program" '
BEGIN {
latest_version = 1
print "{toc}\n"
}
/urgency=/ {
version = gensub(/^.*\((.*)\).*$/, "\\1", "")
if (latest_version) {
print "h4. Latest version, " program " " version
level = "h5."
} else {
print "h5. " program " " version
level = "h6."
}
do {
getline
} while (match($0, /^[ \t]*$/))
changes = ""
do {
if(!match($0, /^[ \t]*$/)) {
changes = changes gensub(/^[ \t]*(.*)$/, "\\1", "")
}
getline
} while (!match($0, /^[ \t]*$/))
getline
releasedate = gensub(/^.*>[^A-Za-z]*(.*)$/, "\\1", "")
print ""
print level " Changes"
print changes
print ""
print level " Released at"
print "This version was released at " releasedate
print ""
if (latest_version) {
latest_version = 0
print "h4. Previous versions\n"
}
}
' server/debian/changelog | mail -s "$program release notes for $latest_version" "$email"