diff options
| author | Shaun Jackman | 2013-03-10 17:33:06 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2013-03-11 18:26:25 +0000 |
| commit | 258d70028f359e88b3300fdd1b8442428ef75826 (patch) | |
| tree | e7a7d6dfc36cc5088fe53bfaadff5d40e3b89ec8 /Library/Homebrew/os/linux | |
| parent | 98352b3b4117a7c8ee6b9a540706cd2ac2960b6b (diff) | |
| download | brew-258d70028f359e88b3300fdd1b8442428ef75826.tar.bz2 | |
Portability fixes to run Homebrew on Linux systems
Closes Homebrew/homebrew#16344.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew/os/linux')
| -rw-r--r-- | Library/Homebrew/os/linux/hardware.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Library/Homebrew/os/linux/hardware.rb b/Library/Homebrew/os/linux/hardware.rb new file mode 100644 index 000000000..8fd4b09b9 --- /dev/null +++ b/Library/Homebrew/os/linux/hardware.rb @@ -0,0 +1,25 @@ +module LinuxHardware + def cpu_type + @@cpu_type ||= case `uname -m` + when /x86_64/ + :intel + when /i386/ + :intel + else + :dunno + end + end + + def intel_family + :dunno + end + + def processor_count + `grep -c ^processor /proc/cpuinfo`.to_i + end + + def is_64_bit? + return @@is_64_bit if defined? @@is_64_bit + @@is_64_bit = /64/ === `uname -m` + end +end |
