[CentOS-devel] /etc/redhat-release

Tue Jun 10 19:37:45 UTC 2014
Fred Smith <fredex at fcshome.stoneham.ma.us>

On Tue, Jun 10, 2014 at 10:28:26PM +0300, Manuel Wolfshant wrote:
>    On 06/10/2014 06:28 PM, Daniel Ankers wrote:
> 
>    On 10 June 2014 16:19, Fred
>    Smith <[1]fredex at fcshome.stoneham.ma.us> wrote:
> 
>      Hi all!
>      I think it was on this list, in the last week or so I saw some
>      comment
>      about how some apps may grope the contents of /etc/redhat-release
>      when
>      installing themselves, so as to figure how which OS they're running
>      on,
>      and there was some mention of this not being the best of all
>      possible
>      ideas.
> 
>    Hi Fred,
>    I would have thought that "lsb_release -a" would be far more portable
>    across varying different distributions and versions.
>    Regards,
>    Dan

Dan, this app is installed only on RHEL or Centos systems, so cross-
distribution issues don't come up (if yu try to run the installer on,
say, SUSE, it'll just error out with "unknown/incorrect distribution"
or something similar.)

So the pain comes simply in telling which RHEL or centos it is. While
I'm sure someone smarter could parse /etc/redhat-release in fewer lines
of code than I have, it's still a pain and prone to breakage with each
new version. that's where lsb_release -i -r should make life simpler.

-- 
---- Fred Smith -- fredex at fcshome.stoneham.ma.us -----------------------------
                      The eyes of the Lord are everywhere, 
                    keeping watch on the wicked and the good.
----------------------------- Proverbs 15:3 (niv) -----------------------------