On 2006–05–13, at 17:44, Abe Timmerman wrote:

Op een mooie lentedag (Thursday 11 May 2006 23:09),schreef H.Merijn Brand:
If you can tweak it, have a look in Test/SysInfo.pm

-------------------------------------------------------------------- ----
        From:     [EMAIL PROTECTED]
        Subject:        Smoke [5.9.4] 28148 PASS darwin 8.6.0 (macppc/1 cpu)
        Date:   10 May 2006 17:19:00.000
        To:       domo

Automated smoke report for 5.9.4 patch 28148
Tullamore.local: PowerMac8,1 (1600 MHz) (macppc/1 cpu)

If you know of a way to translate that "PowerMacX,Y" to something like G[345]
(without hardcoding it), that would be nice.

OK. I've done some tweaking:

       Darwin( )

If the system_profiler program is accessible (meaning that this is Mac
       OS X), use it to find information; otherwise treat as "BSD".

Which gives this on G3, G4 and G5 mono-processors

[EMAIL PROTECTED]:smoke$ perl -I. -MTest::Smoke::SysInfoNew -lwe 'print "$_: ", Test::Smoke::SysInfo->new->$_ foreach qw(cpu_type cpu ncpu host os)'
cpu_type: ppc750
cpu: iMac (400 MHz)
ncpu: 1
host: Daventry.local
os: darwin - 8.6.0 (Mac OS X)

[EMAIL PROTECTED]:smoke$ perl -I. -MTest::Smoke::SysInfoNew -lwe 'print "$_: ", Test::Smoke::SysInfo->new->$_ foreach qw(cpu_type cpu ncpu host os)'
cpu_type: ppcG4
cpu: PowerBook G4 12" (867 MHz)
ncpu: 1
host: Junglinster.local
os: darwin - 8.6.0 (Mac OS X)

[EMAIL PROTECTED]:smoke$ perl -I. -MTest::Smoke::SysInfoNew -lwe 'print "$_: ", Test::Smoke::SysInfo->new->$_ foreach qw(cpu_type cpu ncpu host os)'
cpu_type: ppcG5
cpu: iMac G5 1600 MHz
ncpu: 1
host: Tullamore.local
os: darwin - 8.6.0 (Mac OS X)

Will that do?

Not having an Intel-based Mac to hand, I've not attempted to prettify whatever it is that system_profiler delivers on that platform -- see the example here: <http://appleintelfaq.com/imac/ system_profiler.html>. In particular, T::S::SysInfo currently has nothing to say about the number of cores, as opposed to the number of processors.


Reply via email to