Page MenuHomeFreeBSD

param.h: Document __FreeBSD_version better

Authored by imp on Apr 19 2021, 9:57 PM.
Referenced Files
Unknown Object (File)
Tue, Nov 28, 9:14 PM
Unknown Object (File)
Tue, Nov 28, 9:13 PM
Unknown Object (File)
Tue, Nov 28, 9:13 PM
Unknown Object (File)
Mon, Nov 13, 7:58 PM
Unknown Object (File)
Fri, Nov 10, 12:11 PM
Unknown Object (File)
Oct 6 2023, 11:05 AM
Unknown Object (File)
Oct 3 2023, 7:47 AM
Unknown Object (File)
Sep 5 2023, 9:56 AM



Document what __FreeBSD_version means a bit better. It's scheme is
documented, but why you'd want to use it is not.

Sponsored by: Netflix

Diff Detail

rS FreeBSD src repository - subversion
Lint Passed
No Test Coverage
Build Status
Buildable 38704
Build 35593: arc lint + arc unit

Event Timeline

imp requested review of this revision.Apr 19 2021, 9:57 PM
imp created this revision. added inline comments.

the "propagated to newvers" is now dropped, but perhaps that could use some explanation, too

rgrimes added inline comments.

This "short hand:" is very poorly associated with the "scheme is:" by its lack of indent. Also it does not in any way associate MM with <major>, mm with <two digit minor>, or Rxx with XXX. It also implies a 2 digit limit on major which the scheme does not seem to say. The white space following this line almost dis-associates the scheme is: with the FreeBSD_version below it.

This is already a good improvement and acceptable as is with Greg's corrections.


Ignore my last comment on dis-assocites, I was trying to get full file context to find the start of the block comment and that caused phabricators display to be seriously corrupt and I pretty much had to save and refresh. The block comment addresses my concern on that extra blank line, and the line infact helps to associate the shorthand with the scheme, though I still think the shorthand should be indented to make it clearer.

This revision is now accepted and ready to land.Apr 20 2021, 6:31 AM

RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' ${PARAMFILE:-${SYSDIR}/sys/param.h})

and there's a few others in the tree that parse this:

Makefile.inc1:OSRELDATE!=	awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
Makefile.inc1:SRCRELDATE!=	awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
Makefile.inc1:    awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
sys/conf/$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' ${PARAMFILE:-${SYSDIR}/sys/param.h})
sys/conf/!=	awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \

At one point in the past, I went through all other places that use it. At the very least, will need to be updated.

This revision now requires review to proceed.Apr 20 2021, 4:27 PM
This revision is now accepted and ready to land.Apr 20 2021, 4:48 PM

upon reflection, a little more was needed.

This revision now requires review to proceed.Apr 22 2021, 5:02 PM
imp marked 5 inline comments as done.Apr 22 2021, 5:03 PM

Tweak to match past advice / tribal knowledge.

This revision is now accepted and ready to land.Apr 23 2021, 12:15 PM
This revision was automatically updated to reflect the committed changes.