From e4829654fc8979bc379a3f7acd33de86da792983 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 22 Jun 2015 15:09:13 +0200 Subject: [PATCH] Add new utility id-mk-deb-changelog.sh for generating debian/changelog from IDMETA and debian/control --- id-deb-build/id-mk-deb-changelog.sh | 26 ++++++++++++++++++++++++++ id-deb-build/id-pbuild.sh | 11 ++--------- 2 files changed, 28 insertions(+), 9 deletions(-) create mode 100755 id-deb-build/id-mk-deb-changelog.sh diff --git a/id-deb-build/id-mk-deb-changelog.sh b/id-deb-build/id-mk-deb-changelog.sh new file mode 100755 index 0000000..6b16884 --- /dev/null +++ b/id-deb-build/id-mk-deb-changelog.sh @@ -0,0 +1,26 @@ +#!/bin/sh +if test ! -f debian/control; then + echo "No debian/control" + exit 1 +fi +if test ! -f IDMETA; then + echo "No IDMETA" + exit 1 +fi +. ./IDMETA +DNAME=`awk '/Source:/ {print $2}' debian/control` +if test "$NAME" -a "$NAME" != "$DNAME"; then + echo "NAME in IDMETA ($NAME) does not match debian/control ($DNAME)" + exit 1 +fi + +DCH=debian/changelog +if ! git ls-files $DCH --error-unmatch >/dev/null 2>&1; then + rm -f $DCH + echo "${DNAME} (${VERSION}-1.indexdata) unstable; urgency=medium" >$DCH + echo '' >>$DCH + echo ' * Upstream.' >>$DCH + echo '' >>$DCH + echo " -- `git config --get user.name` <`git config --get user.email`> `date -R`" >>$DCH + echo '' >>$DCH +fi diff --git a/id-deb-build/id-pbuild.sh b/id-deb-build/id-pbuild.sh index 75916cd..e53268e 100755 --- a/id-deb-build/id-pbuild.sh +++ b/id-deb-build/id-pbuild.sh @@ -100,15 +100,8 @@ if $debian; then echo "$MKDEBSRC not found" exit 1 fi - DCH=debian/changelog - if ! git ls-files $DCH --error-unmatch >/dev/null 2>&1; then - rm -f $DCH - echo "${DNAME} (${VERSION}-1.indexdata) unstable; urgency=medium" >$DCH - echo '' >>$DCH - echo ' * Upstream.' >>$DCH - echo '' >>$DCH - echo " -- `git config --get user.name` <`git config --get user.email`> `date -R`" >>$DCH - echo '' >>$DCH + if ! ${ID_DEB_BUILD}/id-mk-deb-changelog.sh; then + echo "id-mk-deb-changelog.sh failed" fi if test "${SUDO_USER}"; then if test ! -d deb-src; then -- 1.7.10.4