[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dh_config_model_upgrade: package upgrade with Config::Model



On Wed, 16 Dec 2009 16:25:35 +0100
Dominique Dumont <domi.dumont@free.fr> wrote:

> Le lundi 7 décembre 2009 04:19:34, Paul Wise a écrit :
> > It would still be nice if the postinst snippets didn't have to be
> > patched for EmDebian. I imagine this would simply mean checking for
> > perl in the postinst and only performing configuration upgrades when
> > it is available.
> 
> Paul, during package build, removing the call to
> dh_config_model_upgrade from rules will remove dependencies on
> libconfig-model-perl and the config-model snippet from postinst.
> 
> Is this enough for EmDebian ?

No. The package should simply exit cleanly with a successful return
value if perl does not exist, letting everything else proceed as before.
The postinst itself needs to check - that way, Emdebian doesn't have to
patch every package using dh_config_model.

Patching debian/rules is problematic because you cannot use
debian/rules to operate the patch mechanism. It is always better to
have a conditional either in debian/rules or in the maintainer
scripts, just as is used in the standard makefile snippets that
determine if it is a cross-build or not. [0]

An alternative is to make dh_config_model* into a no-op if a build
environment variable is set. DEB_BUILD_OPTIONS="noconfigmodel" or
something. With this set, it has to be entirely equivalent to
dh_config_model not appearing in debian/rules at all. It's not ideal
because it is yet another hack when it would be better to assume that
perl just might not be there. However, it also has the advantage that
the build option can be set even if perl does exist but the maintainer
wants to test something within the package without config_model getting
in the way. For this to work, dh_config_model must do absolutely
nothing at all if the build option is set, neither should any other
part of the build use the presence of dh_config_model in debian/rules
(e.g. by testing with grep) to make or prevent any action that would
not occur if dh_config_model was not present in debian/rules.

It would be so much better if this whole implementation was in C - as
long as nothing in the config model tried to execute the cross-built
executable on the build system. Then the ability to disable it via a
build option would be truly orthogonal to the actual issue of whether
perl exists.

[0] 
DEB_HOST_GNU_TYPE=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
else
CROSS= --build $(DEB_BUILD_GNU_TYPE)
endif


-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.linux.codehelp.co.uk/
http://e-mail.is-not-s.ms/

Attachment: pgpPFbCGblLou.pgp
Description: PGP signature


Reply to: