Re: Config-Model-Dpkg: support build profiles
On Friday 27 June 2014 15:41:57 Peter Pentchev wrote:
> > What do you think about the attached patch that adds support for the
> > build profile annotations in the debian/control file?
I'm impressed, the patch is quite fine as is. You can commit it to
pkg=perl repo but don't release the package yet.
I'd like some details to be checked first:
- what kind of error message is shown to user when the build restriction
specified between '<' and '>' is wrong (Parse::RecDescent is quite
powerful to write a grammar, but error handling is more challenging [1])
- May be 'Build-Profiles' should be a list of leaf. But it would then be
written back as a multi-lines fields. The wiki [2] does not forbid
multi-lines, but the tools might not support this. Then a fine grained
check of the content would be easier to write. Frankly, I do not
know which option is the best. I'll let you decide on that.
(note that it can also be changed later)
> > Right now the patch does not try to check that the <profile.*>
> > restrictions may only be present in B-D and B-D-I, and not in any other
> > places that Dpkg::Dependency is used (Build-Conflicts for the source
> > package, Depends and friends for the binary ones). If you wish, I'll
> > try to implement that, too.
The simplest solution is to:
- pass the element name (e.g 'Build-Depends' or something else) to the call to
the dependency parser: dep_parser->dependency($value,1, $self->element_name)
- add an action to profile_restriction rule to check that the element name passed
to the grammar is valid and call $add_error otherwise
Last but not least, you probably have read a lot of doc to write this patch.
Please get back to me if some parts are difficulty to understand or
need some rework.
Thanks for the patch
All the best
[1] http://ddumont.wordpress.com/2013/06/12/improving-error-messages-of-dpkg-dependency-parser/
[2] https://wiki.debian.org/BuildProfileSpec
--
https://github.com/dod38fr/ -o- http://search.cpan.org/~ddumont/
http://ddumont.wordpress.com/ -o- irc: dod at irc.debian.org
Reply to: