Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 306023 - Improve use of comments in package files
Summary: Improve use of comments in package files
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-20 11:04 UTC by pste
Modified: 2016-10-10 07:20 UTC (History)
0 users

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 pste 2010-02-20 11:04:30 UTC
I like to comment in my package files, especially the keywords one. For instance about why packages are (requires to be) keyworded. Furthermore, there is quite often a couple of dependent packages that need to be keyworded as well. To keep things in good overview I therefore often indent the dependencies - like this:

# I like to have the latest firefox!
www-client/mozilla-firefox
        net-libs/xulrunner

This works alright. That is, portage seems to ignore whitespace before atoms, however the following does not work:

# I like to have the latest firefox!
www-client/mozilla-firefox
        net-libs/xulrunner

        # nss & nspr should be able to be removed (minor downgrade)
        dev-libs/nss
        dev-libs/nspr

It gives an "--- Invalid atom in /etc/portage/package.keywords: #" message. That is, portage does not recognize comments with leading whitespaces. However, I do believe the ability to do the above actually increases readability significantly, which is crucial for the ability to clean out bloated keywords files. My suggestion then is: Since "true" inline or "end-line" comments like this:

# I like to have the latest firefox!
www-client/mozilla-firefox
        net-libs/xulrunner
        dev-libs/nss         # this should be able to be removed
        dev-libs/nspr        # and this too!

seems to be far from ever being implementet (considering all comments about it in portage man page), the implementation of still being restricted to all line comments, but with leading whitespace would be nice. Allowing "end of line" comments as well would of course be even better though :-)

just my two cents...

Reproducible: Always
Comment 1 Zac Medico gentoo-dev 2011-03-02 18:10:24 UTC
Support for inline comments is in git:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3ad5122a80f741119b48cb7f0f5107e64e2e3b11
http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=39a2714f4a745ea3ba8e6c3e3cb0c01847ea413d

I don't see a reason not to go ahead and add support for leading whitespace before comments too. 
Comment 2 pste 2016-10-10 07:20:59 UTC
Ooops, found this old bug still open, appears fixed!
Both inline comments and leading white space seems to be ok now, good!