[cfe-dev] CentOS 6 distro detection

Dmitri Shubin sbn at tbricks.com
Wed Jan 15 22:42:28 PST 2014


Hi,

Currently CentOS 6 isn't detected as RHEL6 linux distro.

Fix:

Index: lib/Driver/ToolChains.cpp
===================================================================
--- lib/Driver/ToolChains.cpp   (revision 199352)
+++ lib/Driver/ToolChains.cpp   (working copy)
@@ -2294,7 +2294,8 @@
      StringRef Data = File.get()->getBuffer();
      if (Data.startswith("Fedora release"))
        return Fedora;
-    else if (Data.startswith("Red Hat Enterprise Linux") &&
+    else if ((Data.startswith("Red Hat Enterprise Linux") ||
+              Data.startswith("CentOS")) &&
               Data.find("release 6") != StringRef::npos)
        return RHEL6;
      else if ((Data.startswith("Red Hat Enterprise Linux") ||

Thanks!



More information about the cfe-dev mailing list