Package: nbd-client
Version: 1:2.8.7-4
Severity: important

I think I've understood why I hit #415434 : no /etc/nbd-client was
created when I installed the package, whereas the debconf data seems
ok (see below). Digging into the postinst script, which is running in
bash "set -e" mode, I found :
[ -e /etc/nbd-client ] && . /etc/nbd-client && CFTMPL=/etc/nbd-client

Since on first install, /etc/nbd-client does not exist, this command
fails and causes the whole postinst script to abort, thanks to
"set -e", never generating any config file. I have to say I don't
really know anything to maintainer scripts, thus all this might be
totally wrong.

I've then built a package removing the "set -e" and it worked : the
installation process generated a /etc/nbd-client file. Since "set -e"
is a recommended setting in maintainer scripts iirc, I hacked postinst
a bit more to have it work also with "set -e". Here is the interdiff :

--------------------------------------------------------------------------------

diff -u nbd-2.8.7/debian/changelog nbd-2.8.7/debian/changelog
--- nbd-2.8.7/debian/changelog
+++ nbd-2.8.7/debian/changelog
@@ -1,3 +1,11 @@
+nbd (1:2.8.7-4.intri0) unstable; urgency=low
+
+  * NMU
+  * Have nbd-client.postinst generate a /etc/nbd-client file on fresh
+    install. Closes: #nnnnnn.
+
+ -- intrigeri <[EMAIL PROTECTED]>  Tue, 20 Mar 2007 15:13:31 +0100
+
 nbd (1:2.8.7-4) unstable; urgency=low
 
   * Properly quote NBD_SERVER_OPTS array stuff when rewriting nbd-server
diff -u nbd-2.8.7/debian/nbd-client.postinst 
nbd-2.8.7/debian/nbd-client.postinst
--- nbd-2.8.7/debian/nbd-client.postinst
+++ nbd-2.8.7/debian/nbd-client.postinst
@@ -25,7 +25,10 @@
 #     `abort-remove' or `abort-deconfigure'.
 
 CFTMPL=/usr/share/nbd-client/nbd-client.cf
-[ -e /etc/nbd-client ] && . /etc/nbd-client && CFTMPL=/etc/nbd-client
+if [ -e /etc/nbd-client ]
+then
+   . /etc/nbd-client && CFTMPL=/etc/nbd-client
+fi
 
 case "$1" in
     configure)

--------------------------------------------------------------------------------


-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (990, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.19.7-grsec2.1.10-vs2.2.0-rc15
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=UTF-8 (charmap=UTF-8) (ignored: LC_ALL set 
to fr_FR.UTF-8)

Versions of packages nbd-client depends on:
ii  debconf [debconf-2.0]       1.5.11       Debian configuration management sy
ii  libc6                       2.3.6.ds1-13 GNU C Library: Shared libraries

nbd-client recommends no packages.

-- debconf information:
* nbd-client/device: /dev/nbd0
* nbd-client/host: server
* nbd-client/port: 4242
* nbd-client/type: raw
* nbd-client/number: 1
  nbd-client/no-auto-config:

-- 
  intrigeri <[EMAIL PROTECTED]>
  | clé gnupg @ http://intrigeri.boum.org/intrigeri.asc
  | Allez-vous en, ou apprenez qu'un sage, c'est aussi un fou.

Reply via email to