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

Bug#998282: Please make Section a required field for the source paragraph in d/control



Hi!

On Tue, 2022-09-20 at 19:36:36 -0700, Russ Allbery wrote:
> Felix Lechner <felix.lechner@lease-up.com> writes:
> > The installable stanzas in d/control (called "binary package paragraphs"
> > in policy) inherit the Section field from the source paragraph. There is
> > no reason to provide inheritance the other way around.
> 
> Huh, this pointed out to me that I don't know what the current behavior
> is.  I think I've always put a Section field in the first stanza and then
> overridden it as necessary, or at least I don't remember thinking about
> this before.

If you omit the field in the source stanza, then both dpkg-genchanges
and lintian will complain about it with a warning.

> The current Policy description of the Section field is rather cryptic:
> 
>     This field specifies an application area into which the package has
>     been classified. See Sections.
> 
>     When it appears in the debian/control file, it gives the value for the
>     subfield of the same name in the Files field of the .changes file. It
>     also gives the default for the same field in the binary packages.
> 
> I understand what it's trying to say, but that's a very mechanical
> definition that isn't clear about the relationship between the Section
> field in the source stanza and the Section field in the binary stanzas.
> (It also claims Section is about an "application area," a term that I
> don't think we use anywhere else in Policy.)
> 
> So, what happens today if you put Section in a binary stanza but not in
> the source stanza?  Is it inherited from the binary stanza by the source
> stanza (I agree that seems weird)?  If so, from which binary stanza is it
> inherited, if there are several?  The definition of the Files field
> implies that the section may just be - in some cases.

Some of the fields found in the debian/control binary stanzas inherit
their values (if omitted) from the source stanza, otherwise they get
overridden.

The binary packages use a combination of information from
debian/changelog, the source stanza and their own binary stanza.

For non-binary packages (sources) or artifacts (say .buildinfo, or
byhand objects) there are no binary stanzas, so no information is
taken from them.

If you specify a Section field for every binary stanza, and omit it
from the source stanza, then dpkg-genchanges will have to fill it with
«-» when generating the .changes file.

If you omit the Section field from both the source stanza and one of
the binary stanzas, then that binary package will contain no Section
field, dpkg-genchanges will warn about both missing fields, and it
will fill the section value as «-» for that binary package on the
.changes file.

Thanks,
Guillem


Reply to: