[debian] Add util/genchangelog.

This commit is contained in:
Kris Maglione 2010-07-06 21:23:15 -04:00
parent f7972993f3
commit c738bfc8e7
3 changed files with 32 additions and 5 deletions

View File

@ -20,10 +20,7 @@ deb-dep:
DISTRO = unstable
deb:
if [ -d .hg ]; \
then hg tip --template 'wmii-hg ($(VERSION)) $(DISTRO); urgency=low\n\n * {desc}\n\n -- {author} {date|rfc822date}\n'; \
else awk 'BEGIN{"date"|getline; print "wmii-hg ($(VERSION)) $(DISTRO); urgency=low\n\n * Upstream build\n\n -- Kris Maglione <jg@suckless.org> "$$0"\n"}'; \
fi >debian/changelog || true
$(ROOT)/util/genchangelog wmii-hg $(VERSION) $(DISTRO)
dpkg-buildpackage -rfakeroot -b -nc
[ -d .hg ] && hg revert debian/changelog || true

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
wmii-hg (hg2728) unstable; urgency=low
wmii-hg (2728) unstable; urgency=low
* Remove long deprecated special treatment of the '!' tag.

30
util/genchangelog Executable file
View File

@ -0,0 +1,30 @@
#!/bin/sh
set -ef
ifs="$(echo)"
name=$1
vers=$2
dist=$3
desc="Upstream build"
auth="Kris Maglione <kris@suckless.org>"
date=$(date +'%a, %d %b %Y %T %z')
if hg root >/dev/null 2>&1; then
t() { hg log -r . --template "{$@}"; }
vers=$(t rev)
desc=$(t desc)
auth=$(t author)
date=$(t 'date|rfc822date')
fi
cat >debian/changelog.new <<!
$name ($vers) $dist; urgency=low
* $desc
-- $auth $date
$(cat debian/changelog)
!
mv debian/changelog.new debian/changelog