Page MenuHomeFreeBSD

param.h: Document __FreeBSD_version better
ClosedPublic

Authored by imp on Apr 19 2021, 9:57 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
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

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

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

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

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
60

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
79

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.