Page MenuHomeFreeBSD

Mk/bsd.options.mk: Update comments.
Needs ReviewPublic

Authored by zirias on Dec 23 2022, 2:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 28 2024, 9:51 AM
Unknown Object (File)
Jan 18 2024, 1:40 PM
Unknown Object (File)
Dec 24 2023, 8:23 PM
Unknown Object (File)
Dec 20 2023, 7:58 AM
Unknown Object (File)
Nov 11 2023, 1:10 PM
Unknown Object (File)
Oct 9 2023, 10:39 AM
Unknown Object (File)
Oct 9 2023, 10:39 AM
Unknown Object (File)
Jun 19 2023, 8:20 PM
Subscribers

Details

Reviewers
tcberner
Group Reviewers
portmgr
Summary

Update the comments documenting OPT_USE and similar to be in line with
porter's handbook. In the handbook, the keys used in these are shown in
lowercase, see for example
https://docs.freebsd.org/en/books/porters-handbook/book/#options-use

The comments showed them in uppercase so far.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 48872
Build 45761: arc lint + arc unit

Event Timeline

It seems the uppercase form is more popular so far:

# git grep -l '_USE=.*xorg=' -- '*/*/Makefile' | wc -l
      55
# git grep -l '_USE=.*XORG=' -- '*/*/Makefile' | wc -l
     182
# git grep -l '_USE=.*qt=' -- '*/*/Makefile' | wc -l
      28
# git grep -l '_USE=.*QT=' -- '*/*/Makefile' | wc -l
     111
# git grep -l '_USE=.*kde=' -- '*/*/Makefile' | wc -l
       5
# git grep -l '_USE=.*KDE=' -- '*/*/Makefile' | wc -l
      18
# git grep -l '_USE=.*gnome=' -- '*/*/Makefile' | wc -l
      66
# git grep -l '_USE=.*GNOME=' -- '*/*/Makefile' | wc -l
     229

So, we could discuss updating the porter's handbook instead. But I personally think lowercase comes more natural for the *content* of a variable, and the conversion to uppercase when applying it is there for a reason.

It seems the uppercase form is more popular so far:

# git grep -l '_USE=.*xorg=' -- '*/*/Makefile' | wc -l
      55
# git grep -l '_USE=.*XORG=' -- '*/*/Makefile' | wc -l
     182
# git grep -l '_USE=.*qt=' -- '*/*/Makefile' | wc -l
      28
# git grep -l '_USE=.*QT=' -- '*/*/Makefile' | wc -l
     111
# git grep -l '_USE=.*kde=' -- '*/*/Makefile' | wc -l
       5
# git grep -l '_USE=.*KDE=' -- '*/*/Makefile' | wc -l
      18
# git grep -l '_USE=.*gnome=' -- '*/*/Makefile' | wc -l
      66
# git grep -l '_USE=.*GNOME=' -- '*/*/Makefile' | wc -l
     229

So, we could discuss updating the porter's handbook instead. But I personally think lowercase comes more natural for the *content* of a variable, and the conversion to uppercase when applying it is there for a reason.

Majority=uppercase, maybe that should be the documented way?

I personally fail to see any benefit from the lower-case notation.

No other opionions?

Well, my interpretation was that UPPERCASE is reserved to variable *names*. Of course that's debatable here, as these variables just "aggregate" other variables ...

Someone added the case conversion when expanding them, so obviously had something in mind ;-) But of course we could also just drop that (simplifying the code) and update the porters' handbook instead.

Mk/bsd.options.mk
146–159

Maybe be explicit in the fact that foo will be uppercased, I know the example says so, but it is probably better to write it down so that nobody can say this was unexpected.

This is probably why I wrote FOO=bar in the first case.

Mk/bsd.options.mk
146–159

Makes sense, *if* uppercasing is actually kept. Could also drop uppercasing, leave these comments as is and update the porters handbook instead. Still unsure which one is the better way, but consistency would be nice.