[Lldb-commits] [lldb] r222136 - Fix Darwin and FreeBSD OS type detection
Ed Maste
emaste at freebsd.org
Mon Nov 17 07:40:18 PST 2014
Author: emaste
Date: Mon Nov 17 09:40:18 2014
New Revision: 222136
URL: http://llvm.org/viewvc/llvm-project?rev=222136&view=rev
Log:
Fix Darwin and FreeBSD OS type detection
Obtained in part from http://reviews.llvm.org/D6290
Modified:
lldb/trunk/scripts/utilsOsType.py
Modified: lldb/trunk/scripts/utilsOsType.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/utilsOsType.py?rev=222136&r1=222135&r2=222136&view=diff
==============================================================================
--- lldb/trunk/scripts/utilsOsType.py (original)
+++ lldb/trunk/scripts/utilsOsType.py Mon Nov 17 09:40:18 2014
@@ -28,9 +28,10 @@ import sys # Provide system informa
#--
class EnumOsType( object ):
values = [ "Unknown",
- "Windows",
+ "Darwin",
+ "FreeBSD",
"Linux",
- "Darwin" ]; # OSX
+ "Windows" ]
class __metaclass__( type ):
#++---------------------------------------------------------------------------
# Details: Fn acts as an enumeration.
@@ -64,11 +65,13 @@ def determine_os_type():
eOSType = EnumOsType.Unknown;
strOS = sys.platform
- if strOS == "win32":
- eOSType = EnumOsType.Windows;
- elif (strOS == "linux") or (strOS == "linux2"):
- eOSType = EnumOsType.Linux;
- elif strOS == "darwin":
- eOSType == EnumOsType.Darwin;
+ if strOS == "darwin":
+ eOSType = EnumOsType.Darwin
+ elif (strOS.startswith("freebsd")):
+ eOSType = EnumOsType.FreeBSD
+ elif (strOS.startswith("linux")):
+ eOSType = EnumOsType.Linux
+ elif strOS == "win32":
+ eOSType = EnumOsType.Windows
return eOSType;
More information about the lldb-commits
mailing list