Permalink
Browse files

better 32/64 detection for BSD

  • Loading branch information...
1 parent 1648d4e commit 00760804290206efefe4f725e507fd5dd50b705d @barbie committed Jul 15, 2010
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/Devel/Platform/Info/BSD.pm
@@ -43,8 +43,12 @@ sub get_info {
$self->{info}{oslabel} = $self->{info}{kname};
$self->{info}{osvers} = $self->{info}{kvers};
$self->{info}{osvers} =~ s/-release.*//;
- $self->{info}{is32bit} = $self->{info}{kname} !~ /64/ ? 1 : 0;
- $self->{info}{is64bit} = $self->{info}{kname} =~ /64/ ? 1 : 0;
+ $self->{info}{is32bit} = $self->{info}{archname} !~ /(64|alpha)/ ? 1 : 0;
+ $self->{info}{is64bit} = $self->{info}{archname} =~ /(64|alpha)/ ? 1 : 0;
+
+ # NOTE: 'sparc64' (64bit) and 'sparc' (32bit) both look like they identify
+ # themselves as archname = 'sparc'. If true, is there any other way to
+ # easily distinguish the difference?
$self->{info}{source}{$commands{$_}} = $self->{cmds}{$_} for(keys %commands);
return $self->{info};

0 comments on commit 0076080

Please sign in to comment.