In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/b84fcea1379635ea045b01844a3500c17ce17b96?hp=a733b0cccc9700063dc0098097b23be2dcbf339d>
- Log ----------------------------------------------------------------- commit b84fcea1379635ea045b01844a3500c17ce17b96 Author: Jan Dubois <[email protected]> Date: Tue Feb 19 13:06:24 2013 -0800 Update Win32 to CPAN version 0.46 [DELTA] 0.46 [2013-02-19] - add Win2012/Win8 detection (thanks to Michiel Beijen) [rt#82572] [perl#116352] ----------------------------------------------------------------------- Summary of changes: Porting/Maintainers.pl | 2 +- cpan/Win32/Changes | 4 ++++ cpan/Win32/Win32.pm | 24 +++++++++++++++++++----- cpan/Win32/t/GetOSName.t | 5 +++-- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 08132fa..0bcda65 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -2075,7 +2075,7 @@ use File::Glob qw(:case); 'Win32' => { 'MAINTAINER' => 'jand', - 'DISTRIBUTION' => "JDB/Win32-0.45.tar.gz", + 'DISTRIBUTION' => "JDB/Win32-0.46.tar.gz", 'FILES' => q[cpan/Win32], 'UPSTREAM' => 'cpan', }, diff --git a/cpan/Win32/Changes b/cpan/Win32/Changes index 900c1e8..d1bdbcc 100644 --- a/cpan/Win32/Changes +++ b/cpan/Win32/Changes @@ -1,5 +1,9 @@ Revision history for the Perl extension Win32. +0.46 [2013-02-19] + - add Win2012/Win8 detection (thanks to Michiel Beijen) [rt#82572] + [perl#116352] + 0.45 [2012-08-07] - add Win32::GetACP(), Win32::GetConsoleCP(), Win32::GetConsoleOutputCP(), Win32::GetOEMCP(), Win32::SetConsoleCP() diff --git a/cpan/Win32/Win32.pm b/cpan/Win32/Win32.pm index deb46be..fc78e6e 100644 --- a/cpan/Win32/Win32.pm +++ b/cpan/Win32/Win32.pm @@ -8,7 +8,7 @@ package Win32; require DynaLoader; @ISA = qw|Exporter DynaLoader|; - $VERSION = '0.45'; + $VERSION = '0.46'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -292,7 +292,7 @@ sub GetOSDisplayName { $desc =~ s/^\s*//; s/(200.)/$name Server $1/; } - s/^Windows (200[38])/Windows Server $1/; + s/^Windows (20(03|08|12))/Windows Server $1/; } } $name .= " $desc" if length $desc; @@ -460,8 +460,16 @@ sub _GetOSName { $desc = "R2"; } } + elsif ($minor == 2) { + if ($producttype == VER_NT_WORKSTATION) { + $os = "8"; + } + else { + $os = "2012"; + } + } - if ($productinfo == PRODUCT_ULTIMATE) { + if ($productinfo == PRODUCT_ULTIMATE) { $desc .= " Ultimate"; } elsif ($productinfo == PRODUCT_HOME_PREMIUM) { @@ -970,6 +978,8 @@ Currently known values for ID MAJOR and MINOR are as follows: Windows Server 2008 2 6 0 Windows 7 2 6 1 Windows Server 2008 R2 2 6 1 + Windows 8 2 6 2 + Windows Server 2012 2 6 2 On Windows NT 4 SP6 and later this function returns the following additional values: SPMAJOR, SPMINOR, SUITEMASK, PRODUCTTYPE. @@ -986,6 +996,10 @@ The version numbers for Windows 7 and Windows Server 2008 R2 are identical; the PRODUCTTYPE field must be used to differentiate between them. +The version numbers for Windows 8 and Windows Server 2012 are +identical; the PRODUCTTYPE field must be used to differentiate between +them. + SPMAJOR and SPMINOR are are the version numbers of the latest installed service pack. @@ -1016,9 +1030,9 @@ constants. PRODUCTTYPE provides additional information about the system. It should be one of the following integer values: - 1 - Workstation (NT 4, 2000 Pro, XP Home, XP Pro, Vista) + 1 - Workstation (NT 4, 2000 Pro, XP Home, XP Pro, Vista, etc) 2 - Domaincontroller - 3 - Server (2000 Server, Server 2003, Server 2008) + 3 - Server (2000 Server, Server 2003, Server 2008, etc) Note that a server that is also a domain controller is reported as PRODUCTTYPE 2 (Domaincontroller) and not PRODUCTTYPE 3 (Server). diff --git a/cpan/Win32/t/GetOSName.t b/cpan/Win32/t/GetOSName.t index 32a43df..07fed88 100644 --- a/cpan/Win32/t/GetOSName.t +++ b/cpan/Win32/t/GetOSName.t @@ -99,8 +99,9 @@ my @dual_tests = ( ["7 [Enterprise]", "7", 2, 6, 1, 0x04 ], ["7 [Ultimate]", "7", 2, 6, 1, 0x01 ], - +["8", "8", 2, 6, 2 ], ["2008 [R2]", "2008", 2, 6, 1, 0x00, 2, 89 ], +["2012", "2012", 2, 6, 2, 0x00, 2, 89 ], ["[Small Business Server] 2008 R2", "2008", 2, 6, 1, 0x09, 2, 89 ], ); @@ -127,7 +128,7 @@ sub check { # and 2003/2008 start with "Windows Server" unless ($pretty eq "Win32s") { my $prefix = "Windows"; - $prefix .= " Server" if $pretty =~ /^200[38]/; + $prefix .= " Server" if $pretty =~ /^20(03|08|12)/; $pretty = "$prefix $pretty"; } -- Perl5 Master Repository
