Bug#721663: libconfig-model-dpkg-perl: Add support for XS-Testsuite in dpkg-control

Dominique Dumont dod at debian.org
Thu Sep 5 19:04:04 UTC 2013


On Monday 02 September 2013 23:07:41 Stig Sandbeck Mathisen wrote:
> The only supported value for the moment is "autopkgtest".  I chose "uniline"
> with a "fix if not correct" check.  (Possibly, "enum" is better, but I
> could not figure out how to automatically correct wrong values. There is a
> _slight_ learning curve here

I cannot think of a better option.

Using enum would lead to an error if the value is not correct. In this case, 
cme will refuse to load the control file without -force option. With this 
option wrong values are dropped.

That said, it's possible to specify a replace hash [1] to replace bad values 
with correct value. Something like :

  replace => { '.*' => 'autopkgtest' }

But I'm not fond of this solution because 'XS-Testsuite: no' would be silently 
replaced by 'XS-Testsuite: autopkgtest'. Using a warning like you suggested is 
better because it will educate the user about the correct value.

For the moment, using a leaf of type uniline is indeed the better option. The 
doc you mention hint that, in the future, XS-Testsuite may be a list of 
different values. Then changing the element type to be a list of enum will 
probably be better. But there's no need to go that way right now.

We may also want to create a model for debian/tests/control so that people 
could edit this file with 'cme edit dpkg-test-control' or 'cme edit dpkg'. But 
I don't have much available time right now. 

Thanks a bunch for the patch. This will be part of next version of libconfig-
model-dpkg-perl.

All the best

[1] http://search.cpan.org/dist/Config-Model/lib/Config/Model/Value.pm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20130905/34ca0b3e/attachment-0001.sig>


More information about the pkg-perl-maintainers mailing list