[Libosinfo] [osinfo-db PATCH 2/7] ubuntu: Include <codename> in <name>

Andrea Bolognani abologna at redhat.com
Wed Apr 17 17:23:40 UTC 2019


On Wed, 2019-04-17 at 17:58 +0100, Daniel P. Berrangé wrote:
> On Wed, Apr 17, 2019 at 06:38:55PM +0200, Andrea Bolognani wrote:
> > Actually, the above is not quite correct: even if an application
> > wanted to build the display string from scratch, they would not be
> > able to do so because there is no field anywhere containing the
> > strings "MacOS X", "Debian" or "Ubuntu".
> 
> That's by design, because the product name is not a simple
> concatenation of a base name + version number. It is essentially
> an opaque string in its own right, arbitrarily decided by the
> vendor.

You could argue that the vendor-chosen for the latest Debian release
is "Debian 9 (stretch)" based on

  https://www.debian.org/releases/

and similarly for Ubuntu, but it's definitely not as clear-cut as
it might be with the likes of Windows and macOS :)

> > There's one more detail to consider: even if the application was
> > willing to construct the display string itself, how would it know
> > that it's "Ubuntu Server 18.04 LTS" but "Fedora 29 Workstation"?
> > They'd have to write code for it, and end up not handling all cases
> > correctly... If we just provide the information is osinfo-db, on
> > the other hand, it's just a quick API call away.
> 
> The application can just display <name> field as is,
> either the top level name from the OS, or the variant
> name if they have identified a specific varaint.
> 
> They can optionally append a codename string to that
> when displaying it.

That would result both in "Debian 9 (stretch)" (good) and "macOS
Mojave (Mojave)" (bad), though. So we should probably not recommend
applications do that.

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the Libosinfo mailing list