Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 470094 - parent files should support comments/blank lines
Summary: parent files should support comments/blank lines
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PMS/EAPI
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-16 17:59 UTC by Tom Wijsman (TomWij) (RETIRED)
Modified: 2023-04-14 16:35 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-05-16 17:59:02 UTC
See URL field, section "5.2.1 The parent file" mentions that the parent file must not contain comments.

The file ${PORTDIR}/profiles/arch/amd64/x32/parent voids this specification.

This could break package managers who follow 5.2.1 strictly and decide to ignore the parent file instead of ignoring the comment; or, they may be unable to parse the syntax since they don't expect comments and bail out. Portage silently ignores them, not a good thing but it's probably to avoid an error towards users; but any other current or future package manager may behave quite different.

Sorry for filing this, but I think it is worth pointing out for the sake of QA.

If I assigned this bug wrong, feel free to reassign.
Comment 1 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2014-01-07 12:19:10 UTC
 +  07 Jan 2014; Tom Wijsman <TomWij@gentoo.org> x32/parent:
 +  [QA] Removed comment from x32/parent per PMS for bug #470094.

Changed this bug such that it can track the comment instead:

    # Need to clobber amd64 pulling in lib32 on us.
Comment 2 SpanKY gentoo-dev 2014-01-07 18:45:27 UTC
is there actually a PM that fails on this ?  if not, then it seems a lot saner to update PMS to reflect reality instead of pointlessly deleting useful documentation.
Comment 3 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2014-01-07 19:04:37 UTC
Is there an actual use case for documentation other than hiding away bugs in it?
Comment 4 SpanKY gentoo-dev 2014-05-04 15:32:43 UTC
(In reply to Tom Wijsman (TomWij) from comment #3)

yes, documentation in parent files are useful.  no, it isn't restricted to "hiding bugs" which this certainly is not doing.

let's redirect this bug like it should have been originally.
Comment 5 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2014-05-04 15:37:41 UTC
A comment hidden away in a file is a bug that isn't tracked, and thus is hidden.
Comment 6 Ulrich Müller gentoo-dev 2014-05-04 16:19:33 UTC
Any reason why we can't have _all_ files in profiles (with the obvious exception of the eapi file) support comments and line continuation?

I'd rather have uniform rules, instead of another special case.
Comment 7 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2014-05-04 16:35:22 UTC
(In reply to Ulrich Müller from comment #6)
> Any reason why we can't have _all_ files in profiles (with the obvious
> exception of the eapi file) support comments and line continuation?
> 
> I'd rather have uniform rules, instead of another special case.

I'll answer with a question: Why is /eapi an exception and the /parent not one?
Comment 8 Ciaran McCreesh 2014-05-04 16:40:29 UTC
Hysterical raisins...
Comment 9 Ulrich Müller gentoo-dev 2014-05-04 16:57:19 UTC
(In reply to Tom Wijsman (TomWij) from comment #7)
> I'll answer with a question: Why is /eapi an exception and the /parent not
> one?

Because the eapi file itself cannot have an EAPI dependent syntax.
Comment 10 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2014-05-04 17:09:54 UTC
(In reply to Ciaran McCreesh from comment #8)
> Hysterical raisins...

Well, historically, /parent is an exception too; so, that's not a reason.

What if we want a comment in /eapi? Because setting a specific /eapi file to another EAPI than 5 must have been with a good reason for a comment; so, there is not really a difference between /eapi and /parent if you know what I mean.

Historically, there isn't a difference; they both don't allow comments, so, the question here should therefore be if we should support comments in both.

That is, if we really don't want another special case; all or nothing works better, unless we want this bug to repeat for /eapi in the future.

If we change something, please consider the most consistent approach; comments everywhere, as there is no reason for exceptions. (I'm not for or against this)

(In reply to Ulrich Müller from comment #9)
> Because the eapi file itself cannot have an EAPI dependent syntax.

Given that this is defined in the PMS, you can change this in the next PMS version; then towards the future, it should be easy to deprecate this.
Comment 11 Ulrich Müller gentoo-dev 2023-03-01 09:28:45 UTC
This almost looks like an oversight to me. When the spec was updated to allow multiple parents (bug 174956), the sentence about blank lines and comments should have been removed:
https://gitweb.gentoo.org/proj/pms.git/commit/?id=192cf7ce0df36c9253ef026a4bc80b24dddd42a

Portage uses grabfile and Pkgcore uses load_property to read the parent files, which both ignore comment lines.

So unless we have any other tools relying on the current format, I tend to update the spec without an EAPI bump.
Comment 12 Larry the Git Cow gentoo-dev 2023-04-14 16:34:42 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/pms.git/commit/?id=97a6391f49d9a9ba297da349c021fb00c3067762

commit 97a6391f49d9a9ba297da349c021fb00c3067762
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2022-02-21 18:30:11 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2023-04-14 15:53:25 +0000

    profiles.tex: The parent file can contain comments
    
    Closes: https://bugs.gentoo.org/470094
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 profiles.tex | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)