[zfs-discuss] Re: update-manager: zfs-dkms (0.6.0.54-1ubuntu1~oneiric1) ... failures

Richard Laager rlaager at wiktel.com
Mon Apr 2 20:39:33 EDT 2012


On Mon, 2012-04-02 at 18:29 -0500, Darik Horn wrote:
> That won't work as intended because the these scripts are invoked with
> the -e switch.  Using `|| true` instead might get the desired result.
> 
> But that would mask the actual problem:  Why is`[ -x ... ]`
> misbehaving on some minimal Ubuntu installations?

It's not misbehaving. Your postinst script is doing:

[ -x foo ] && foo

When foo isn't executable, this is equivalent to:

false && irrelevant

which evaluates to:

false

With -e, the script exits with a failure status.


You want this instead:

if [ -x foo ] ; then
    foo
fi

OR

[ -x foo ] && foo || true

The latter is used by dbus.postinst. Everything else* on my system uses
the former approach, which I think is clearer.

* That's not strictly true. network-manager.postinst has the same,
broken, code as zfs-dkms. I just filed a bug report for that.

-- 
Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://list.zfsonlinux.org/pipermail/zfs-discuss/attachments/20120402/1b3d4872/attachment.sig>


More information about the zfs-discuss mailing list