summaryrefslogtreecommitdiffstats
path: root/scripts/changelog2news.sh
blob: 2f5ab6eac38aac6a1789fe7719ef31c573e2f808 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
#
# Script to convert old-style ChangeLog files into new-style NEWS files.
#
# Copyright (C) 2014  Patrick "P. J." McDermott
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.  This file is offered as-is,
# without any warranty.

script='s/^\(.*\) (\(.*\))$/opkhelper version \1\n\n'
script="${script}"'Released: \2\n\nChanges in this release:/'

sed "${script}" "${1}" | \
	sed -n '/^opkhelper /{p; s/./-/gp; n;}; /^opkhelper /!p' | \
	grep -v '^  \['