Bug 238953

Summary: sysutils/etc_os-release: version number becomes obsolete after system updates
Product: Ports & Packages Reporter: Ting-Wei Lan <lantw44>
Component: Individual Port(s)Assignee: Tobias C. Berner <tcberner>
Status: New ---    
Severity: Affects Only Me CC: alien.xupypr, ilaurie
Priority: --- Flags: tcberner: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   

Description Ting-Wei Lan 2019-07-03 07:51:50 UTC
Since this port records the version number of the system during the build, there is no way to update the version number stored in /usr/local/etc/os-release without rebuilding or updating the port. Therefore, the version number stored in the file becomes wrong as soon as the user updates the system with freebsd-update. Is it considered a problem, or it is just ignored?

I don't know what is the expected way to use the port, but it will be confusing to users if data stored in /usr/local/etc/os-release is used to show the version of the system. For example, gnome-control-center uses /etc/os-release to show OS version in its about page, and it is likely for a user to find the version number showed there is different from what freebsd-version command reports.
Comment 1 Tobias C. Berner freebsd_committer 2019-07-07 09:04:00 UTC
Hit there

Yeah, that is not great. But as long as that is not part of the base system there is no easy fix for this, other than following the rule to upgrade ports after a system upgrade.

As that file is only needed to display some Operating System information in Qt and Gtk applications, a slight mismatch won't likely cause any problems other than confusion :)

mfg Tobias
Comment 2 Ting-Wei Lan 2019-07-07 17:39:02 UTC
(In reply to Tobias C. Berner from comment #1)
Instead of shipping an os-release file directly in the package, do you think it will be better if it ships a script which can be used to update the os-release file? It can also include necessary files to update it during boot in a way similar to motd or drop a file into /usr/local/etc/cron.d to check and update it every hour.
Comment 3 Tobias C. Berner freebsd_committer 2019-07-07 17:49:23 UTC
(In reply to Ting-Wei Lan from comment #2)
That sounds like a bit of overkill for what we use it for at the moment. 
If stuff some day really requires it to be accurate, I think it should be shipped as part of the base system, and thereby be up to date through system upgrades.
Comment 4 nixuser 2019-09-01 09:35:21 UTC
Since the /usr/local/etc/os-release file is provided by the package etc_os-release can't the package version number simply be bumped, with the corrected text, so that it updates with a "pkg update && pkg upgrade" like other packages?  

This has caused me a lot of grief because although I could confirm my kernel upgraded correctly, I thought there was a userland upgrade issue because this file didn't upgrade with the userland programs.  I've been trying to hunt down what went wrong.  I think this issue is rather serious.

Is there a way to force the 11.3 version of etc_os-release package to replace the 11.2 version I have?