Reduce differences with root_skels in contrib.
[dragonfly.git] / contrib / bsdinstaller-1.1.6 / scripts / report / gen_rel_notes.lua
blob582e16d9945f12a993160a397fbb9832e2f6955a
1 -- $Id: gen_rel_notes.lua,v 1.1 2005/03/03 20:29:03 cpressey Exp $
2 -- Lua script to generate release notes.
3 -- Usage: lua gen_rel_notes.lua prev_release_tag this_release_tag
4 -- e.g.: lua gen_rel_notes.lua RELENG_1_1_4 RELENG_1_1_5
6 local cvsdir = "/home/catseye/projects/installer"
7 local tmpdir = "/tmp"
8 local tmpfn = tmpdir .. "/gen_rel_notes.txt"
9 local old_tag, new_tag = arg[1], arg[2]
10 local cmd = "cd " .. cvsdir .. " && cvs log -r" .. old_tag .. ":" .. new_tag ..
11 " >" .. tmpfn .. " 2>&1"
12 os.execute(cmd)
13 local file = io.open(tmpfn)
15 local line
16 local lines, logs
18 logs = {}
19 while true do
20 lines = {}
21 line = file:read("*l")
22 if not line then break end
23 while not string.find(line, "^===================") do
24 line = file:read("*l")
25 if not line then break end
26 table.insert(lines, line)
27 end
28 if not line then break end
29 table.insert(logs, lines)
30 end
31 file:close()
33 for logno, logtab in logs do
34 local found, len, cap
35 local old_rev, new_rev
36 if string.find(logtab[1], "^cvs log: warning: no revision") then
37 logs[logno] = nil
38 else
39 for k, v in logtab do
40 found, len, cap = string.find(logtab[k], "^\t" .. old_tag .. ": (.+)$")
41 if found then old_rev = cap end
42 found, len, cap = string.find(logtab[k], "^\t" .. new_tag .. ": (.+)$")
43 if found then new_rev = cap end
44 end
45 if new_rev == old_rev then
46 logs[logno] = nil
47 end
48 end
49 end
51 for logno, logtab in logs do
52 for k, v in logtab do
53 print(logno, v)
54 end
55 print("")
56 end