source: scripts/changelog.sh @ 1332

Last change on this file since 1332 was 1332, checked in by Александър Шопов, 15 years ago

Служебен скрипт, който ще ползвам да подготвям ChangeLog?-овете, че ми писна. Скриптът изисква bash.

  • Property svn:executable set to *
File size: 975 bytes
Line 
1#!/bin/bash
2
3if [ "x$1" == "x" ]; then
4   echo 'First argument should be translator alias' >&2
5   exit 1
6fi
7PERSON=$( sed -n "/^$1|/s/^$1|//p" << EOF
8ash|Alexander Shopov <ash@contact.bg>
9ilia|Ilia Penev <picholicho@gmail.com>
10vic|Victor Dachev <vdachev@gmail.com>
11vlad|Vladimir Petkov <kaladan@gmail.com>
12ya|Yavor Doganov <yavor@gnu.org>
13ys|Yassen Pramatarov <yassen@lindeas.com>
14EOF
15)
16
17if [ "x$PERSON" == "x" ] 
18 then
19   echo 'Unknown translator' >&2
20   exit 2
21fi
22
23DATE=$(date +%Y-%m-%d)
24
25if [ ! -f ChangeLog ]; then
26    echo  'No ChangeLog file' >&2
27    exit 3
28fi
29
30svn revert ChangeLog
31svn up ChangeLog
32
33TMPFILE=$( mktemp -t ChangeLog.XXXXXXXXXX )
34
35if [ $? -ne 0 ]; then
36   echo 'Unable to make temp file' >&2
37   exit 4
38fi
39
40cat << EOF >>$TMPFILE
41$DATE  Alexander Shopov  <ash@contact.bg>
42
43        * bg.po: Updated Bulgarian translation by
44        $PERSON
45
46EOF
47
48cat ChangeLog >> $TMPFILE
49
50mv $TMPFILE ChangeLog
51
52if [ $? -ne 0 ]; then
53   echo 'Unable to move temp file' >&2
54   exit 5
55fi
56
Note: See TracBrowser for help on using the repository browser.