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"
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"
13 local file
= io
.open(tmpfn
)
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
)
28 if not line
then break end
29 table.insert(logs
, lines
)
33 for logno
, logtab
in logs
do
35 local old_rev
, new_rev
36 if string.find(logtab
[1], "^cvs log: warning: no revision") then
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
45 if new_rev
== old_rev
then
51 for logno
, logtab
in logs
do