NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/60810: /usr/src/sys/conf/osrelease.h -s behavior does not match description



The following reply was made to PR kern/60810; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/60810: /usr/src/sys/conf/osrelease.h -s behavior does not match description
Date: Mon, 28 Sep 2026 04:11:25 +0700

     Date:        Sun, 27 Sep 2026 02:55:00 +0000 (UTC)
     From:        "rwhitlock22%gmail.com@localhost via gnats" <gnats-admin%NetBSD.org@localhost>
     Message-ID:  <20260927025500.E901A1A923E%mollari.NetBSD.org@localhost>
 
 
   | thinkpad# sh osrelease.sh -s
   | 11998
   | thinkpad# 
   |
   | but it should have output
   |
   | 119908
 
 If this were to change, it should be to 1199008 .. we have had instances
 before (well, one instance) where the "pp" part went above 99.  It could
 actually use 4 digits I believe, but it is hard to imagine that ever
 happening.
 
 But I'm not sure this is really needed, none of the XX symbols for the
 various forms are intended to imply that 2 characters will appear.
 
 For example, the comments say
 
 # default: return MM.mm.pp 
 # -m: return MM, representing only the major number; however, for -current,
 #     return the next major number (e.g. for 5.99.nn, return 6)
 
 That is, in that case "MM" is 6 (not 2 digits).   The same is true of
 mm, for 11.1 that will be "1" I expect, or for 10.3 it would be "3".
 "pp" is no different.
 
 I would also advise against simply comparing any of these as numbers
 in the form osrelease.sh generates them - if one wants to compare
 numeric kernel versions, simply compare the numeric value from
 __NetBSD_Version__ rather than extracting bits of it and comparing that.
 
 I don't see anything (not the script code, nor its comments) that needs
 fixing here for this issue (the sh code however could do with some work).
 
 kre
 
 



Home | Main Index | Thread Index | Old Index