[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#563121: dh_installdefoma leads to buggy maintainer scripts



Cyril Brulebois <kibi@debian.org> (31/12/2009):
> Current/common practice within debhelper seems to be:
> | if [ -x "`which foo 2>/dev/null`" ]; then…
> 
> I think I'm going to upload with such a change once I'm up (for
> real, not vaguely opening eyes).

Hi again,

I've just checked that fontconfig 2.8.0-1 built against the new defoma
was installable and removable with and without defoma installed. It
seems to be OK. So I guess you should be able to e.g. bump the
versioned BD on defoma to >= 0.11.10-4 and reupload without the
bandaid; or wait until new defoma is installed on all architectures.

I hope I didn't miss anything.

I'm attaching the patches I used for further reference:
 - dh_installdefoma fixes.
 - lintian warning about ${misc:Depends} (trivial fix).
 - changelog.

Some trivial lintian warnings/errors could have been fixed, but I feel
like I already spent too much time on defoma.

Mraw,
KiBi.
From f20657a059d3414427d9c08dec15da25c974a0df Mon Sep 17 00:00:00 2001
From: Cyril Brulebois <kibi@debian.org>
Date: Thu, 31 Dec 2009 12:52:42 +0100
Subject: [PATCH 1/3] Switch to if [ -x "`which foo 2>/dev/null`" ].

---
 debhelper-files/postinst-defoma       |    6 +++---
 debhelper-files/postinst-defoma-hints |    4 +++-
 debhelper-files/prerm-defoma          |    7 ++++---
 debhelper-files/prerm-defoma-hints    |    4 +++-
 4 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/debhelper-files/postinst-defoma b/debhelper-files/postinst-defoma
index 8819ce4..eeed4c7 100644
--- a/debhelper-files/postinst-defoma
+++ b/debhelper-files/postinst-defoma
@@ -1,5 +1,5 @@
 if [ "$1" = "configure" ]; then
-
-  test -x `which defoma-app` && defoma-app update #PACKAGE#
-
+	if [ -x "`which defoma-app 2>/dev/null`" ]; then
+		defoma-app update #PACKAGE#
+	fi
 fi
diff --git a/debhelper-files/postinst-defoma-hints b/debhelper-files/postinst-defoma-hints
index 83e1e8b..ae69812 100644
--- a/debhelper-files/postinst-defoma-hints
+++ b/debhelper-files/postinst-defoma-hints
@@ -1,4 +1,6 @@
 FILE='/etc/defoma/hints/#PACKAGE#.hints'
 if [ "$1" = configure ]; then
-	test -x `which defoma-font` && defoma-font reregister-all $FILE
+	if [ -x "`which defoma-font 2>/dev/null`" ]; then
+		defoma-font reregister-all $FILE
+	fi
 fi
diff --git a/debhelper-files/prerm-defoma b/debhelper-files/prerm-defoma
index fc05dcc..d4a41e9 100644
--- a/debhelper-files/prerm-defoma
+++ b/debhelper-files/prerm-defoma
@@ -1,10 +1,11 @@
 case "$1" in
 	upgrade)
-		test -x `which defoma-app` && \
+		if [ -x "`which defoma-app 2>/dev/null`" ]; then
 			defoma-app clean #PACKAGE#
+		fi
 		;;
 	remove)
-		test -x `which defoma-app` && \
+		if [ -x "`which defoma-app 2>/dev/null`" ]; then
 			defoma-app purge #PACKAGE#
-		;;
+		fi
 esac
diff --git a/debhelper-files/prerm-defoma-hints b/debhelper-files/prerm-defoma-hints
index 1fdef0f..df40f96 100644
--- a/debhelper-files/prerm-defoma-hints
+++ b/debhelper-files/prerm-defoma-hints
@@ -1,4 +1,6 @@
 FILE='/etc/defoma/hints/#PACKAGE#.hints'
 if [ "$1" = remove ]; then
-	test -x `which defoma-font` && defoma-font purge-all $FILE
+	if [ -x "`which defoma-font 2>/dev/null`" ]; then
+		defoma-font purge-all $FILE
+	fi
 fi
-- 
1.6.5.7

From 9ce8c31833f91bd24128339810f8d60fbdeafebc Mon Sep 17 00:00:00 2001
From: Cyril Brulebois <kibi@debian.org>
Date: Thu, 31 Dec 2009 13:19:32 +0100
Subject: [PATCH 2/3] Add ${misc:Depends} to all binaries.

---
 debian/control |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/debian/control b/debian/control
index 5a73bd1..af57269 100644
--- a/debian/control
+++ b/debian/control
@@ -8,7 +8,7 @@ Standards-Version: 3.6.2.0
 
 Package: defoma
 Architecture: all
-Depends: whiptail | dialog, file, ${perl:Depends}
+Depends: whiptail | dialog, file, ${perl:Depends}, ${misc:Depends}
 Enhances: debhelper
 Suggests: defoma-doc, psfontmgr, x-ttcidfont-conf, dfontmgr
 Recommends: libfont-freetype-perl
@@ -26,6 +26,7 @@ Description: Debian Font Manager -- automatic font configuration framework
 
 Package: defoma-doc
 Architecture: all
+Depends: ${misc:Depends}
 Section: doc
 Description: Debian Font Manager documentation
  Defoma, which stands for DEbian FOnt MAnager, provides a framework
@@ -36,7 +37,7 @@ Description: Debian Font Manager documentation
 
 Package: psfontmgr
 Architecture: all
-Depends: defoma (>= 0.9.1), whiptail | dialog, ${perl:Depends}
+Depends: defoma (>= 0.9.1), whiptail | dialog, ${perl:Depends}, ${misc:Depends}
 Conflicts: defoma-ps, scigraphica-common (<= 0.7.1-3)
 Description: PostScript font manager -- part of Defoma, Debian Font Manager
  psfontmgr manages PostScript fonts through the Defoma framework. It
-- 
1.6.5.7

From 28019d205ce672ebd2849bb504c228ebede8ff6f Mon Sep 17 00:00:00 2001
From: Cyril Brulebois <kibi@debian.org>
Date: Thu, 31 Dec 2009 13:19:43 +0100
Subject: [PATCH 3/3] Start changelog.

---
 debian/changelog |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 1758b4b..183fee3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+defoma (0.11.10-4) unstable; urgency=high
+
+  * QA upload.
+  * Fix dh_installdefoma: Use “if [ -x "`which foo 2>/dev/null`" ]”
+    instead of test -x `which foo` since test -x without parameter
+    succeeds, leading to the execution of the next command, breaking
+    maintainer scripts (Closes: #563121).
+  * Set urgency to “high” accordingly.
+  * Introduce ${misc:Depends} for all binary packages.
+
+ -- Cyril Brulebois <kibi@debian.org>  Thu, 31 Dec 2009 13:16:08 +0100
+
 defoma (0.11.10-3) unstable; urgency=low
 
   * QA upload to fix errors in previous QA upload
-- 
1.6.5.7

Attachment: signature.asc
Description: Digital signature


Reply to: