Fix test for directory
[git-tools-moved-to-github.git] / id-deb-build / id-mk-deb-changelog.sh
1 #!/bin/sh
2 if test ! -f debian/control; then
3     echo "No debian/control"
4     exit 1
5 fi
6 if test ! -f IDMETA; then
7     echo "No IDMETA"
8     exit 1
9 fi
10 . ./IDMETA
11 DNAME=`awk '/Source:/ {print $2}' debian/control`
12 if test "$NAME" -a "$NAME" != "$DNAME"; then
13     echo "NAME in IDMETA ($NAME) does not match debian/control ($DNAME)"
14     exit 1
15 fi
16
17 DCH=debian/changelog
18 if ! git ls-files $DCH --error-unmatch >/dev/null 2>&1; then
19     rm -f $DCH
20     echo "${DNAME} (${VERSION}-1.indexdata) unstable; urgency=medium" >$DCH
21     echo '' >>$DCH
22     echo '  * Upstream.' >>$DCH
23     echo '' >>$DCH
24     echo " -- `git config --get user.name` <`git config --get user.email`>  `date -R`" >>$DCH
25     echo '' >>$DCH
26 fi