#157 Unsupported + defined(%hash) is deprecated OS Mac OSX 10.5-7

open
nobody
TestAPI (4)
5
2011-11-09
2011-11-09
Anonymous
No

$ perl -version

This is perl 5, version 12, subversion 3 (v5.12.3) built for darwin-multi-2level

Copyright 1987-2010, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

defined(%hash) is deprecated at /usr/lib/Bastille/HP_API.pm line 100
100 if(! defined %GLOBAL_SWLIST) {
defined(%hash) is deprecated at /usr/lib/Bastille/API.pm line 1276
1276 if ( defined %GLOBAL_SUM ) {

A quick search of CPAN turned up Class::PseudoHash which explains:

Due to its impact on overall performance of ordinary hashes, pseudo-hashes are deprecated in perl v5.8, and will cease to exist in perl v5.10. By then, the fields pragma is supposed to change to use a different implementation.

Class::PseudoHash transparently supports PseudoHashes by simply adding two lines to your program.

$ sudo bastille --report
/usr/sbin/bastille: line 171: [: too many arguments
defined(%hash) is deprecated at /usr/lib/Bastille/HP_API.pm line 100.
(Maybe you should just omit the defined()?)
defined(%hash) is deprecated at /usr/lib/Bastille/API.pm line 1276.
(Maybe you should just omit the defined()?)
ERROR: 'unknown' is not a supported operating system.
Valid operating system versions are as follows:
OSX:
'OSX10.2' 'OSX10.3' 'OSX10.4'
>> 'OSX10.5' 'OSX10.6' 'OSX10.7'
HP-UX:
'HP-UX11.00' 'HP-UX11.11' 'HP-UX11.22' 'HP-UX11.23' 'HP-UX11.31'

LINUX:
'DB2.2' 'DB3.0' 'RH6.0' 'RH6.1' 'RH6.2'
'RH7.0' 'RH7.1' 'RH7.2' 'RH7.3' 'RH8.0'
'RH9' 'RHEL4AS' 'RHEL4ES' 'RHEL4WS' 'RHEL3AS'
'RHEL3ES' 'RHEL3WS' 'RHEL2AS' 'RHEL2ES' 'RHEL2WS'
'RHFC1' 'RHFC2' 'RHFC3' 'RHFC4' 'RHFC5'
'MN6.0' 'MN6.1 ' 'MN7.0' 'MN7.1' 'MN7.2'
'MN8.0' 'MN8.1' 'MN8.2' 'MN9.2' 'MN10.0'
'MN10.1' 'MN2006.0' 'SE7.2' 'SE7.3' 'SE8.0'
'SE8.1' 'SE9.0' 'SE9.1' 'SE9.2' 'SE9.3'
'SE10.0' 'SESLES8' 'SESLES9' 'TB7.0'

Invalid argument list:
Usage: bastille [ -b | -c | -r | -x [ --os version ] ]
-b : use a saved config file to apply changes
directly to system
-c : use the Curses (non-X11) TUI
-r : revert all Bastille changes to-date
-x : use the Perl/Tk (X11) GUI
--os version : ask all questions for the given operating system
version. e.g. --os RH6.0

475 # Figure out what kind of system we're on.
476 if ($release ne "") {
477 if ($release =~ /^Darwin\s+(\d+)\.(\d+)/) {
478 if ($1 == 6 ) {
479 $distro = "OSX10.2";
480 }
481 elsif ($1 == 7) {
482 $distro = "OSX10.3";
483 }
484 elsif ($1 == 8) {
485 $distro = "OSX10.4";
486 }
487 else {
488 $distro = "unknown";
489 }
490 }
491 elsif ( $release =~ /(^HP-UX)\s*B\.(\d+\.\d+)/ ) {
492 $distro="$1$2";
493 }
494 else {
495 print STDERR "$err Could not determine operating system version!\n";
496 $distro="unknown";
497 }

elsif ($1 == 9) {
$distro = "OSX10.5";
}
elsif ($1 == 10) {
$distro = "OSX10.6";
}
elsif ($1 == 11) {
$distro = "OSX10.7";
}

892 if (! &is_OS_supported($distro)) {
893 print STDERR "$err '$distro' is not a supported operating system.\n";
894 }

Proposed update:
465 # We're either on Mac OS X, HP-UX or an unsupported O/S.
466 if ( -x '/usr/bin/uname') {
467 # uname is in /usr/bin on Mac OS X and HP-UX
468 $release=`/usr/bin/uname -sr`;
>> $release=`sw_vers -productVersion` #10.7.2
469 }

476 if ($release ne "") {
477 if ($release =~ /^Darwin\s+(\d+)\.(\d+)/) {
>> if ($release =~ /^(\d+)\.(\d+)/) {

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks