barbie / devel-platform-info

Unified framework for obtaining common platform metadata
http://birmingham.pm.org
Other
10 stars 4 forks source link

showrev no longer a thing on solaris #3

Open plicease opened 10 years ago

plicease commented 10 years ago

I am by no means a solaris expert, but a little googling around seems to suggest that showrev is no longer part of Solaris as of Solaris 2.11 / SunOS 5.11.

This makes Devel::Platform::Info issue an error when doing its thing (see below).

I am actually using OpenIndiana, but I believe Solaris 2.11 works the same.

sun% perl -MDevel::Platform::Info -MYAML -E 'say YAML::Dump(Devel::Platform::Info->new->get_info)'
sh: line 1: showrev: not found
Use of uninitialized value in pattern match (m//) at /home/ollisg/perl5/5.16.2/lib/perl5/Devel/Platform/Info/Solaris.pm line 50.

---
archname: i86pc
is32bit: 0
is64bit: 1
kernel: sunos-5.11
kname: SunOS
kvers: 5.11
osflag: solaris
oslabel: ~
osname: ~
osvers: 5.11
source:
  /usr/bin/isainfo -kv: 64-bit amd64 kernel modules
  cat /etc/release: |-2
                 OpenIndiana Development oi_151.1.5 X86 (powered by illumos)
            Copyright 2011 Oracle and/or its affiliates. All rights reserved.
                            Use is subject to license terms.
                               Assembled 26 June 2012
  showrev -a | grep -v "^Patch": ''
  uname -a: SunOS sun 5.11 oi_151a5 i86pc i386 i86pc
  uname -m: i86pc
  uname -r: 5.11
  uname -s: SunOS
barbie commented 10 years ago

Hi Graham,

Unfortunately I'm not a Solaris user, and only used it briefly when trying to establish the available tools for this distribution. I've found the following link, which lists some alternative commands, so will look to see if they are suitable:

https://community.oracle.com/thread/2164118

Thanks for highlighting the change.

Cheers, Barbie.

plicease commented 10 years ago

I think the main thing is not to spew warnings, either not call showrev on newer solaris, or to capture the stderr so that the user doesn't see it. The way the code is structured it calls a series of commands based on platform. To me getting the information using alternatives is a bonus. If I think of something more useful I will let you know.

jmealo commented 8 years ago

@barbie @plicease Did we get anywhere on this? I may be porting this over to Node shortly.