Bug#563121: dh_installdefoma leads to buggy maintainer scripts

2009-12-31 Thread Cyril Brulebois
Keith Packard kei...@keithp.com (30/12/2009):
  I'm about to QA-upload defoma with this change in the various
  debhelper-files/* files, but I wanted to open this bugreport for
  reference.

Fortunately, I didn't do so, that wouldn't have helped (yay for
sleeping before uploading :)).

 Here's a patch which I've used to build new fontconfig packages
 which should survive the absence of defoma.

I don't think it would help.

 -  test -x `which defoma-app`  defoma-app update #PACKAGE#
 +  which defoma-app /dev/null  defoma-app update #PACKAGE#

$ which doesnotexist /dev/null  echo be happy
$ echo $?
1

So the maintainer script bits generated by dh_installdefoma would
still lead to non-0 exits.

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).

Mraw,
KiBi.


signature.asc
Description: Digital signature


Bug#563121: dh_installdefoma leads to buggy maintainer scripts

2009-12-31 Thread Cyril Brulebois
Cyril Brulebois k...@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 k...@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 k...@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 k...@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
--- 

Bug#563121: dh_installdefoma leads to buggy maintainer scripts

2009-12-31 Thread Keith Packard
On Thu, 31 Dec 2009 09:03:59 +0100, Cyril Brulebois k...@debian.org wrote:
 Keith Packard kei...@keithp.com (30/12/2009):
   I'm about to QA-upload defoma with this change in the various
   debhelper-files/* files, but I wanted to open this bugreport for
   reference.
 
 Fortunately, I didn't do so, that wouldn't have helped (yay for
 sleeping before uploading :)).
 
  Here's a patch which I've used to build new fontconfig packages
  which should survive the absence of defoma.
 
 I don't think it would help.
 
  -  test -x `which defoma-app`  defoma-app update #PACKAGE#
  +  which defoma-app /dev/null  defoma-app update #PACKAGE#
 
 $ which doesnotexist /dev/null  echo be happy
 $ echo $?
 1
 
 So the maintainer script bits generated by dh_installdefoma would
 still lead to non-0 exits.

Check out the 'bash' manual -- set -e explicitly excludes precisely this
case from causing early termination of the script:

  The shell does not exit if the command that fails is part of the command  
list  immedi‐
  ately  following  a  while  or until keyword, part of the test following 
the if or elif
  reserved words, part of any command executed in a  or ⎪⎪ list except 
the command fol‐
  lowing  the final  or ⎪⎪, any command in a pipeline but the last, or if 
the command's
  return value is being inverted with !.

 Current/common practice within debhelper seems to be:
 | if [ -x `which foo 2/dev/null` ]; then…

That also seems fine, if a bit longer.

 I think I'm going to upload with such a change once I'm up (for real,
 not vaguely opening eyes).

cool! I'd prefer to build fontconfig with your desired change; the set
+e change will hold until then. I'll change the one other case to match
whatever you choose to use.

-- 
keith.pack...@intel.com


pgprfFohmahds.pgp
Description: PGP signature


Bug#563121: dh_installdefoma leads to buggy maintainer scripts

2009-12-31 Thread Cyril Brulebois
Keith Packard kei...@keithp.com (31/12/2009):
 Check out the 'bash' manual -- set -e explicitly excludes precisely
 this case from causing early termination of the script:
 […]

Alrighty. I must confess I'm not really keen on checking what happens
in the various shells, but that seems to be true under dash as well,
so that might be OK.

  Current/common practice within debhelper seems to be:
  | if [ -x `which foo 2/dev/null` ]; then…

^^^ (debhelper-like syntax) ^^^

 That also seems fine, if a bit longer.
 
  I think I'm going to upload with such a change once I'm up (for real,
  not vaguely opening eyes).
 
 cool! I'd prefer to build fontconfig with your desired change; the
 set +e change will hold until then. I'll change the one other case
 to match whatever you choose to use.

In the meanwhile, defoma was uploaded with the debhelper-like syntax
(as quoted above). In my previous mail[1], you can scratch “until new
defoma is installed on all architectures” since it's arch: all. ;)

 1. http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=35;bug=563121

Mraw,
KiBi.


signature.asc
Description: Digital signature


Bug#563121: dh_installdefoma leads to buggy maintainer scripts

2009-12-31 Thread Keith Packard
On Thu, 31 Dec 2009 18:44:18 +0100, Cyril Brulebois k...@debian.org wrote:

 In the meanwhile, defoma was uploaded with the debhelper-like syntax
 (as quoted above). In my previous mail[1], you can scratch “until new
 defoma is installed on all architectures” since it's arch: all. ;)

Ok, I've adopted the same syntax in fontconfig 2.8.0-2 and uploaded that
(after testing in a chroot). Please let me know asap if anything breaks
with this version.

-- 
keith.pack...@intel.com


pgpGaC60XabMO.pgp
Description: PGP signature


Bug#563121: dh_installdefoma leads to buggy maintainer scripts

2009-12-30 Thread Cyril Brulebois
Package: defoma
Version: 0.11.10-3
Severity: grave
Justification: Fucks up fontconfig (at least), then buildds.

Hi,

dh_installdefoma leads to this kind of code in maintainer scripts:
  test -x `which foo`  foo bar baz

The trick being that if foo isn't found by which, “foo bar baz” gets
executed, leading to broken packages (see fontconfig's #559136 and
#560252 for examples).

A pair of quotes would fix this:
| k...@finzi:~$ test -x `which foo`  foo bar baz
| -bash: foo: command not found
| k...@finzi:~$ test -x `which foo`  foo bar baz
| k...@finzi:~$ 

I'm about to QA-upload defoma with this change in the various
debhelper-files/* files, but I wanted to open this bugreport for
reference.

Cc'ing defoma folks and buildd folks, since they might be interested in
knowing about this.

Mraw,
KiBi.



-- 
To UNSUBSCRIBE, email to debian-qa-packages-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org