freebsd-update not updating reported patchlevel
Daniel Staal
DStaal at usa.net
Fri May 4 16:50:43 UTC 2012
On 2012-05-04 10:45, Polytropon wrote:
> Allow me to extent the approach: For -STABLE versions (e. g. if
> updated per CVS), those files could contain the "build number"
> and the date of the currently installed -STABLE "snapshot".
>
> A separation of a "kernel version file" and a "world version
> file" is useful in cases the kernel won't be touched, so no
> need to update its version file (as well as the kernel itself)
> by a binary update.
>
> The files should be easily parsable. They could even contain
> an assignment in sh syntax, as well as comments (for BSDL and
> $FreeBSD$ information). Their templates could be stored in
> the /usr/src subtree for the etc/ structure, so programs like
> "make" and "mergemaster" could access them from there.
>
> Maybe a binary command could be added to the base system to
> query this information (maybe "getent" could do that?).
>
> Here are some suggestions:
>
> /etc/kernversion
> VERSION="8.2"
> BRANCH="STABLE"
> BUILD="12345"
> DATE="2011-08-01 12:34:56"
>
> or
>
> /etc/kernversion
> VERSION="8.4"
> BRANCH="RELEASE"
> PATCH="2"
> DATE="2012-02-02 02:02:02"
>
> /etc/sysversion
> VERSION="8.4"
> BRANCH="RELEASE"
> PATCH="4"
> DATE="2012-04-04 04:04:04"
>
> This shows: Kernel has last been updated to patchlevel 2 (to
> check with "uname -r" will show that version), but the system
> has been updated two more times to patchlevel 4.
>
> The notation could be X.Y-pZ or X.Y.Z for -RELEASE installations,
> and X.Y-B for -STABLE installations. However, it's not hard to
> write any custom "parser and composer" if urgently needed.
>
> Maybe things also present in "uname -a" output (such as architecture
> and OS name) could be included, but I think that's not required
> because it's mostly obvious. :-)
I think you could still get a machine-parseable version on one line,
that's also a bit nicer for human reading. Perhaps something like this?
(Partly inspired by RedHat's /etc/redhat-release)
/etc/sysversion
FreeBSD RELEASE 8.4-p4: 2012-04-04 04:04:04
You should be able to parse that with a few lines of C or shell, and it
looks like something set up to be read by humans. You just need to
define - and stick to - which pieces of information will be in there in
what order. (For instance, I'd prefer '9.0-p0' to '9.0'
Daniel T. Staal
---------------------------------------------------------------
This email copyright the author. Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes. This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------
More information about the freebsd-questions
mailing list