Fix a typo in xas.1 (thanks to Marcell)
[amule.git] / src / utils / scripts / wikify_latest_changelog
blob65d9ebd99e1262ec542a8ab188db0965b33601ad
1 #!/bin/bash
2 ## This file is part of the aMule Project
3 ##
4 ## Copyright (c) 2004-2011 Angel Vidal ( kry@amule.org )
5 ## Copyright (c) 2003-2011 aMule Team ( admin@amule.org / http://www.amule.org )
6 ##
7 ## This program is free software; you can redistribute it and/or
8 ## modify it under the terms of the GNU General Public License
9 ## as published by the Free Software Foundation; either
10 ## version 2 of the License, or (at your option) any later version.
12 ## This program is distributed in the hope that it will be useful,
13 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ## GNU General Public License for more details.
17 ## You should have received a copy of the GNU General Public License
18 ## along with this program; if not, write to the Free Software
19 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 # Wikifies lastest changelog entry. No sanity checking. Must be run from sources root folder.
22 if test x"`ls docs/Changelog`" = x""; then
23 echo "This script must be run on aMule base directory."
24 else
25 CHANGELOG="Changelog-`grep -h -E 'Version [0-9]\.[0-9]+\.[0-9]+.*' docs/Changelog | head -n 1 | cut -d ' ' -f 2`"
26 head -n `grep -hn -E '(\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-)+' docs/Changelog | cut -d ':' -f 1 | head -1` docs/Changelog > $CHANGELOG
27 sed -i -r "s/\t([A-Z,a-z].+):$/'''\1:'''/g" $CHANGELOG
28 sed -i -r "s/^(Version .+)$/=== \1 ===/g" $CHANGELOG
29 sed -i -r "s/^-----------*$//g" $CHANGELOG
30 sed -i -r "s/^([0-9][0-9][0-9][0-9]-[0-9][0-9]?-[0-9][0-9]?)$/''\1''/g" $CHANGELOG
31 sed -i -r "s/\t+(\*? .+)$/\1/g" $CHANGELOG
32 sed -i -r ":0;N;s/\n\s+/ /;t0;P;D" $CHANGELOG
33 echo "$CHANGELOG created."