diff options
author | Jeremy Katz <katzj@redhat.com> | 2006-07-24 20:47:55 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2006-07-24 20:47:55 +0000 |
commit | c2e807d64b907102d8580a01a704613ff45c0742 (patch) | |
tree | ade8260786aacc38c1b01cab0e1a611b6b783aed /iutil.py | |
parent | 981992dbe7e043dd312e7a7e25345a704b7b7bd2 (diff) | |
download | anaconda-c2e807d64b907102d8580a01a704613ff45c0742.tar.gz anaconda-c2e807d64b907102d8580a01a704613ff45c0742.tar.xz anaconda-c2e807d64b907102d8580a01a704613ff45c0742.zip |
2006-07-24 Jeremy Katz <katzj@redhat.com>
* iutil.py (isMactel): Make this persist so we don't run dmidecode
a bazillion times
Diffstat (limited to 'iutil.py')
-rw-r--r-- | iutil.py | 24 |
1 files changed, 16 insertions, 8 deletions
@@ -345,17 +345,25 @@ def getPPCMacBook(): return 1 return 0 +mactel = None # return True if this is one of the Intel-based Apple Macs def isMactel(): + global mactel + if mactel is not None: + return mactel + if rhpl.getArch() not in ("x86_64", "i386"): - return False - if not os.path.exists("/usr/sbin/dmidecode"): - return False - buf = execWithCapture("/usr/sbin/dmidecode", - ["dmidecode", "-s", "system-manufacturer"]) - if buf.lower().find("apple") != -1: - return True - return False + mactel = False + elif not os.path.exists("/usr/sbin/dmidecode"): + mactel = False + else: + buf = execWithCapture("/usr/sbin/dmidecode", + ["dmidecode", "-s", "system-manufacturer"]) + if buf.lower().find("apple") != -1: + mactel = True + else: + mactel = False + return mactel def hasNX(): """Convenience function to see if a machine supports the nx bit. We want |