Bug 265789 - freebsd-version -rku prints versions not in sequence with cli flags
Summary: freebsd-version -rku prints versions not in sequence with cli flags
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 13.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL: https://man.freebsd.org/cgi/man.cgi?q...
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2022-08-12 11:26 UTC by Kurt Jaeger
Modified: 2023-10-01 15:28 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kurt Jaeger freebsd_committer freebsd_triage 2022-08-12 11:26:39 UTC
Example:

# freebsd-version -rku
12.2-RELEASE-p14
12.2-RELEASE-p7
12.2-RELEASE-p15
# freebsd-version -kru
12.2-RELEASE-p14
12.2-RELEASE-p7
12.2-RELEASE-p15

So how do I know whether the running kernel is p7 or p14 ?

(tested on 12.2, because it's difficult to test if all three versions
are the same)
Comment 1 Vinícius Zavam freebsd_committer freebsd_triage 2022-08-12 12:29:41 UTC
hello there! we are discussing an improvement about freebsd-version(1) here: https://reviews.freebsd.org/D27318

would that be relevant to add into those changes? maybe we add the prefix to tell which line output is related to -r, -k or -u.
Comment 2 Graham Perrin freebsd_committer freebsd_triage 2022-08-13 06:24:05 UTC
(In reply to Kurt Jaeger from comment #0)

From <https://www.freebsd.org/cgi/man.cgi?query=freebsd-version&sektion=1&manpath=FreeBSD#DESCRIPTION>: 

> If several of the above options are specified, freebsd-version will print 
> the installed kernel version first, then the running kernel version, 
> next the userland version, and finally the userland version of the 
> specified jails, on separate lines.
Comment 3 Kurt Jaeger freebsd_committer freebsd_triage 2022-08-23 18:51:58 UTC
(In reply to Graham Perrin from comment #2)

Thanks for the pointer to the man page. The behaviour is still surprising
and my impression that it violates POLA.
Comment 4 Graham Perrin 2023-10-01 15:28:39 UTC
^Triage: this report should probably be closed, works as intended. 

I'd like someone from the Project to make a decision.