Page MenuHomeFreeBSD

param.h: Document __FreeBSD_version better
ClosedPublic

Authored by imp on Apr 19 2021, 9:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 7, 11:35 PM
Unknown Object (File)
Feb 23 2024, 5:50 PM
Unknown Object (File)
Feb 8 2024, 10:48 AM
Unknown Object (File)
Jan 31 2024, 12:53 AM
Unknown Object (File)
Jan 31 2024, 12:53 AM
Unknown Object (File)
Jan 31 2024, 12:53 AM
Unknown Object (File)
Jan 16 2024, 6:52 PM
Unknown Object (File)
Jan 9 2024, 2:06 AM

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 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.
freebsd_igalic.co added inline comments.
sys/sys/param.h
70

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
70

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.