Hello,
I've recently run into problems because of the way the hook scripts
define functions and evaluates expressions.
By default on Ubuntu Edgy, dash is installed, and /bin/sh is a symlink
to dash. The xen-tools hook scripts use the keyword "function" for
function definitions, and [[ ]] for expression evaluation. These are
*not* supported by dash. This makes the hook scripts fail with errors
like this:
Running hook 99-clean-image
['/usr/lib/xen-tools/dapper.d/99-clean-image /tmp/NWz3ScGIho']
--
/usr/lib/xen-tools/common.sh: 19: function: not found
/tmp/NWz3ScGIho
/usr/lib/xen-tools/common.sh: 51: function: not found
/usr/lib/xen-tools/common.sh: 77: logMessage: not found
assert failed: /usr/lib/xen-tools/dapper.d/99-clean-image: []
The attached patch fixes the problem by not using the "function"
keyword for function definition and by using [ expression ] instead of
[[ expression ]] for expression evaluation in the hook shell scripts.
In this way the hook shell scripts work whether /bin/sh is a symlink
to /bin/bash or to /bin/dash.
Patch applies to current CVS.
Thanks,
--
Eric
- application/octet-stream attachment: patch
Received on Thu Oct 19 2006 - 16:20:46 BST