#1241 PR merged: Use SUSE_LINUX as OS_VENDOR on all SUSE systems.

Labels: enhancement, cleanup, fixed / solved / done

jsmeix opened issue at 2017-03-14 13:52:

Clean up the SetOSVendorAndVersion function a bit.

In particular set SUSE_LINUX as OS_VENDOR
on all SUSE systems but do not set OS_MASTER_VENDOR
same as OS_VENDOR because then scripts in
a .../$OS_VENDOR/... or .../$OS_MASTER_VENDOR/...
sub-directory would get sourced twice by
the (buggy?) SourceStage function.

This pull request is triggered by
and it is also related to

jsmeix commented at 2017-03-15 09:48:

I like to merge it soon because I think it is a good first step
in the right direction and if somthing fails I will fix it.

gdha commented at 2017-03-15 10:24:

Ok go ahead with the pull request

Verstuurd vanaf mijn iPhone

Op 15 mrt. 2017 om 10:48 heeft Johannes Meixner notifications@github.com het volgende geschreven:

I like to merge it soon because I think it is a good first step
into the right direction and if somthing fails I will fix it.

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

jsmeix commented at 2017-03-15 12:00:

Tested on SLES12 SP2 where it works for me.
If accidentally something fails on other systems I will fix it.

schlomo commented at 2017-04-19 13:36:

Triggered by #1311 I looked again at this and realized what (IMHO) happened here: OS_VENDOR and OS_MASTER_VENDOR should indeed never be the same. Apparently on some SUSE distros this happened, setting both to SUSE_LINUX.

While the current fix in this PR works it actually goes against the original concept of the *_MASTER_* variables. The original concept was to have all vendor-generic code under the *_MASTER_* name and extend this with derivate-specific code only where needed.

Maybe with Fedora/RHEL/CentOS this works better because they are more consistent in the output of lsb_release?

jsmeix commented at 2017-04-19 14:37:

The code of SetOSVendorAndVersion() somehow
works "backwards" because it first sets OS_VENDOR
and from that value it derives a value that is set for
OS_MASTER_VENDOR for several Linux distributions.

I implemented that behaviour now also for SUSE.
Now OS_MASTER_VENDOR="SUSE" for SUSE distributions.
I think before OS_MASTER_VENDOR was not set for SUSE.

As a second step all SUSE_LINUX directories could now be
renamed into SUSE but I don't like that because it works as is.

It never happened in real usage that OS_VENDOR and
OS_MASTER_VENDOR were same for SUSE.
What happened was that I had set both same during my tests
but then I noticed that scripts get run twice because of this.

indeed never be the same, a test is missing in ReaR that
errors out when both are the same.
Way too often ReaR does not verify conditions
but blindly proceeds "bona fide".

According to the code of SetOSVendorAndVersion()

    case "$OS_VENDOR_VERSION" in

I don't think Fedora/RHEL/CentOS are consistent
in the output of lsb_release.
Each one has its own name in the output of lsb_release
(which is expected) but SetOSVendorAndVersion()
maps them to a consistent OS_MASTER_VENDOR.

schlomo commented at 2017-04-19 15:04:

+1 for adding a test to prevent running with OS_VENDOR and OS_MASTER_VENDOR set to the same.

Fedora-based distros so far (as I have seen) are much more consistent with regard to their lsb_release -i output compared to SUSE, where different SLES versions yield different results.

And yes, I would strongly suggest to actually use OS_MASTER_VENDOR for SUSE and set OS_VENDOR to something that differentiates between the different SUSE flavors.

[Export of Github issue for rear/rear.]