Page MenuHomeFreeBSD

param.h: Document __FreeBSD_version better
ClosedPublic

Authored by imp on Apr 19 2021, 9:57 PM.
Tags
None
Referenced Files
F104730055: D29850.diff
Mon, Dec 9, 4:33 AM
F104697293: D29850.diff
Sun, Dec 8, 9:40 PM
Unknown Object (File)
Fri, Nov 22, 11:36 AM
Unknown Object (File)
Thu, Nov 14, 2:05 PM
Unknown Object (File)
Wed, Nov 13, 10:20 PM
Unknown Object (File)
Nov 3 2024, 12:28 PM
Unknown Object (File)
Nov 3 2024, 12:28 PM
Unknown Object (File)
Nov 3 2024, 12:28 PM

Details

Summary

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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 38733
Build 35622: arc lint + arc unit

Event Timeline

imp requested review of this revision.Apr 19 2021, 9:57 PM
imp created this revision.
freebsd_igalic.co added inline comments.
sys/sys/param.h
71

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

rgrimes added inline comments.
sys/sys/param.h
61

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.

sys/sys/param.h
61

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
sys/sys/param.h
71

newvers.sh:

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/newvers.sh:RELDATE=$(awk '/__FreeBSD_version.*propagated to newvers/ {print $3}' ${PARAMFILE:-${SYSDIR}/sys/param.h})
sys/conf/kern.post.mk:OSRELDATE!=	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, newvers.sh 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.