forked from TEIC/Roma-Antiqua
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mydch
executable file
·30 lines (30 loc) · 1.07 KB
/
mydch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
NEWVERSION=`cat VERSION`
DATE=`date "+%a, %d %b %Y %H:%M:%S %z"`
if [ ! -f $1 ]
then
DIR=`dirname $1`
PACKAGE=`(cd $DIR; grep Source: control | awk '{print $2}')`
echo "$PACKAGE ($NEWVERSION) debian; urgency=low" > $1
echo "" >> $1
echo ' * release generated from TEI source. We do not maintain a history here of releases' >> $1
echo "" >> $1
echo " -- TEI <[email protected]> $DATE" >> $1
else
OLDVERSION=`head -1 $1 | awk '{print $2}' | tr -d '/\(\)/'`
PACKAGE=`head -1 $1 | awk '{print $1}' `
NAME=`grep -- "^ --" $1| head -1 | sed 's/ -- \(.*\)<.*/\1/'`
EMAIL=`grep -- "^ --" $1 | head -1 | sed 's/.*<\(.*\)>.*/\1/'`
if [ ! $OLDVERSION = $NEWVERSION ]
then
echo update debian changelog with $NEWVERSION
echo "$PACKAGE ($NEWVERSION) natty; urgency=low" > /tmp/changelog
echo "" >> /tmp/changelog
echo " * new release from upstream" >> /tmp/changelog
echo "" >> /tmp/changelog
echo " -- $NAME <$EMAIL> $DATE" >> /tmp/changelog
echo "" >> /tmp/changelog
cat $1 >> /tmp/changelog
mv /tmp/changelog $1
fi
fi