Re: Python modules not installed correctly with pycentral
Christopher Schmidt <crschmidt@metacarta.com> writes:
> Since it appears you have a *different* postinst, it's possible that
> you need something like a "#DEBHELPER#" snippet in your existing
> postinst to allow debhelper to actually put the files in the right
> place: when I was missing this in the past, I got similar behavior
> (where the postinst in my package was run, but the python-support
> postinst wasn't).
The postinst is created automatically by debhelper programs:
===== /var/lib/dpkg/info/gracie.postinst
#!/bin/sh
set -e
# Automatically added by dh_installinit
if [ -x "/etc/init.d/gracie" ]; then
update-rc.d gracie defaults >/dev/null
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
invoke-rc.d gracie start || exit $?
else
/etc/init.d/gracie start || exit $?
fi
fi
# End automatically added section
# Automatically added by dh_pycentral
if which pycentral >/dev/null 2>&1; then
pycentral pkginstall gracie
fi
# End automatically added section
=====
Thanks for pointing me to this file. It explains why the 'gracied'
invocation fails during installation: the postinst is trying to start
the program *before* running pycentral to install the modules. That
fails, so the postinst can't continue.
So, with that knowledge, I can look at the 'debian/rules' to see why
it's going in the wrong order. The comments in the postinst are
helpful for this.
The current 'debian/rules' invokes them in this order:
===== debian/rules
# ...
.PHONY: install
install: build
dh_testdir
dh_testroot
dh_installdirs
dh_installinit
dh_installpam
python${PYVER} #...
.PHONY: binary-arch
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installexamples
dh_installman
dh_pycentral
dh_link
# ...
=====
With those dependencies, the 'dh_installinit' will run before
'dh_pycentral'.
The only way I can see to fix this is to move one of those commands so
the corrent ordering is achieved in the postinst. Where should I be
moving the rules around to? Should 'dh_installinit' move to the
'binary-arch' rule?
The ordering of commands in that 'debian/rules' is largely unchanged
from what 'dh_make' set up. Should the default placement of
'dh_pycentral' be changed so that 'pycentral' is run early enough for
programs in the package that depend on the installed modules?
--
\ "Anyone who believes exponential growth can go on forever in a |
`\ finite world is either a madman or an economist." -- Kenneth |
_o__) Boulding |
Ben Finney
Reply to: