On Thu, 17 Dec 2009 14:24:48 +0100 Dominique Dumont <dominique.dum...@hp.com> wrote:
> On Wednesday 16 December 2009 17:40:55 Neil Williams wrote: > > 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. > > Ok. Here's the new postinst snippet injected by > dh_config_model_upgrade: > > # In case of error (error in configuration file or model bug), the > # configuration file is left as is. > > # testing perl is required to avoid problem in embedded environments > if [[ -e /usr/bin/perl ]] > then > echo "config-edit is upgrading %PACKAGE% configuration with model > %MODEL%." > config-edit -model %MODEL% -ui none -save %OPTION% || \ > echo "WARNING: upgrade with config-edit failed: Run > 'config-edit -model %MODEL% -force %OPTION%' and save the > configuration." fi > > Does this fit the bill ? With the later removal of the bashism, yes. Thanks. > > 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. > > On Thursday 17 December 2009 14:24:48 Dominique Dumont wrote: > > Unless somebeody complains, I will add this at the beginning of > > dh_config_model_upgrade: > > > > if ($ENV{DEB_BUILD_OPTIONS} =~ /noconfigmodel/) { > > warn "dh_config_model_upgrade: DEB_BUILD_OPTIONS specifies > > 'noconfigmodel', exiting ...\n"; > > exit; > > } > > > > After reading (again) debhelper(7), I think it's better to exit > silently if DH_NO_ACT is set. DH_NO_ACT still needs debian/rules to be modified or else all debhelper routines would be disabled; we need an option that is specific to dh_config_model without having to edit debian/rules. I think DEB_BUILD_OPTIONS is still useful, whether or not dh_config_model outputs the warning is neither here nor there for my purposes. > > 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. > > Well, a C implementation of the core part of Config::Model is > possible, but it would take a while to create. I don't have the > bandwidth for this. The debconf maintainers aren't the cdebconf maintainers; it's not unusual for someone else to step up as long as the interface in the perl version is suitable for porting to C. So the real issue is that config::model tries hard to make an interface that can be implemented in another language. -- Neil Williams ============= http://www.data-freedom.org/ http://www.linux.codehelp.co.uk/ http://e-mail.is-not-s.ms/
pgpfqmJbHkYCG.pgp
Description: PGP signature