martin f. krafft: add version stamps to bugscript and mkconf scripts

Martin F. Krafft madduck at alioth.debian.org
Tue Jul 21 11:55:44 UTC 2009


Module: mdadm
Branch: build
Commit: 8a9bd0303b42b69e112cb3f12b2deba5a46bc02b
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=8a9bd0303b42b69e112cb3f12b2deba5a46bc02b

Author: martin f. krafft <madduck at debian.org>
Date:   Tue Jul 21 11:02:01 2009 +0200

add version stamps to bugscript and mkconf scripts

Signed-off-by: martin f. krafft <madduck at debian.org>

---

 debian/.gitignore                  |    2 ++
 debian/{bugscript => bugscript.in} |    5 +++++
 debian/changelog                   |    7 +++++++
 debian/{mkconf => mkconf.in}       |   10 +++++++---
 debian/rules                       |    9 ++++++++-
 5 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/debian/.gitignore b/debian/.gitignore
index fa4d2db..bb62f98 100644
--- a/debian/.gitignore
+++ b/debian/.gitignore
@@ -6,3 +6,5 @@
 /mdadm-udeb
 /*.debhelper
 /*.log
+/mkconf
+/bugscript
diff --git a/debian/bugscript b/debian/bugscript.in
similarity index 97%
rename from debian/bugscript
rename to debian/bugscript.in
index dcc5cc3..50d19e8 100755
--- a/debian/bugscript
+++ b/debian/bugscript.in
@@ -13,6 +13,8 @@
 # maximise information output even in the case of errors
 set +eu
 
+VERSION=%VERSION%
+
 if ! command -v yesno >/dev/null; then
   if [ -r /usr/share/reportbug/handle_bugscript ]; then
     exec /usr/share/reportbug/handle_bugscript ". $0" /dev/stdout
@@ -187,3 +189,6 @@ echo >&3
 echo "--- /dev:" >&3
 ls -l /dev/md* /dev/disk/by-* >&3
 echo >&3
+
+echo "Auto-generated on $(date -R)" >&3
+echo "by mdadm bugscript $VERSION" >&3
diff --git a/debian/changelog b/debian/changelog
index 1f0b91b..b243d4f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+mdadm (3.0-2) unstable; urgency=low
+
+  * Add version stamps to bugscript and mkconf scripts to facilitate
+    debugging.
+
+ -- martin f. krafft <madduck at debian.org>  Tue, 21 Jul 2009 10:33:30 +0200
+
 mdadm (3.0-1) unstable; urgency=low
 
   * New stable upstream release.
diff --git a/debian/mkconf b/debian/mkconf.in
similarity index 92%
rename from debian/mkconf
rename to debian/mkconf.in
index 26c8b98..313bb89 100644
--- a/debian/mkconf
+++ b/debian/mkconf.in
@@ -8,6 +8,7 @@
 set -eu
 
 ME="${0##*/}"
+VERSION=%VERSION%
 MDADM=/sbin/mdadm
 DEBIANCONFIG=/etc/default/mdadm
 CONFIG=/etc/mdadm/mdadm.conf
@@ -95,10 +96,13 @@ else
 fi
 
 if [ $generate -eq 1 ]; then
-  cat <<_eof
-# This file was auto-generated on $(date -R) by mkconf
-_eof
+  echo "# This file was auto-generated on $(date -R)"
+else
+  echo "# This configuration was auto-generated on $(date -R)"
+fi
+echo "# by mkconf $VERSION"
 
+if [ $generate -eq 1 ]; then
   mkdir -p /var/lib/mdadm
   md5sum $CONFIG > /var/lib/mdadm/mdadm.conf-generated
 fi
diff --git a/debian/rules b/debian/rules
index b77224d..603b9ab 100755
--- a/debian/rules
+++ b/debian/rules
@@ -48,18 +48,25 @@ mdadm: configure
 	$(MAKE) $(FLAGS) all
 .PHONY: mdadm
 
+INTERPOLATED_FILES = debian/bugscript debian/mkconf
+
 clean: unpatch
 	dh_testdir
 	dh_testroot
+	rm -f $(INTERPOLATED_FILES)
 	rm -f build-stamp
 	[ ! -f Makefile ] || $(MAKE) clean
 	rm -f mdadm.udeb mdadm
 	dh_clean
 	debconf-updatepo
 
+debian/%: VERSION=$(shell dpkg-parsechangelog | sed -ne 's,^Version: ,,p')
+debian/%: debian/%.in
+	sed -re 's,%VERSION%,$(VERSION),g' < $< > $@
+
 install: DESTDIR=$(CURDIR)/debian/mdadm
 install: DESTDIR_UDEB=$(DESTDIR)-udeb
-install: build
+install: build $(INTERPOLATED_FILES)
 	dh_testdir
 	dh_clean -k
 	dh_installdirs




More information about the pkg-mdadm-commits mailing list