Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-Devel-CheckOS for openSUSE:Factory checked in at 2022-05-12 23:00:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Devel-CheckOS (Old) and /work/SRC/openSUSE:Factory/.perl-Devel-CheckOS.new.1538 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Devel-CheckOS" Thu May 12 23:00:22 2022 rev:12 rq:976455 version:1.93 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Devel-CheckOS/perl-Devel-CheckOS.changes 2021-06-02 22:12:15.268150980 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Devel-CheckOS.new.1538/perl-Devel-CheckOS.changes 2022-05-12 23:00:47.736831866 +0200 @@ -1,0 +2,23 @@ +Tue Apr 26 03:06:24 UTC 2022 - Tina M??ller <timueller+p...@suse.de> + +- updated to 1.93 + see /usr/share/doc/packages/perl-Devel-CheckOS/CHANGELOG + + 1.93 2022-04-25 + - No functional changes, just changes to where dependencies are declared + https://github.com/DrHyde/perl-modules-Devel-CheckOS/issues/27 + 1.92 2022-04-24 + - Fix bugs in new alias and case-insensitivity features which meant everything + broke in taint-mode. The new features now no longer work in taint-mode but + everything else should. + 1.91 2022-04-21 + - Fix tests for platforms where the OS is detected as something that is + a family, but not as anything more specific, such as Fedora Linux + 1.90 2022-04-20 + - Matches are now case-insensitive + - Add support for OS aliases + - Deprecated the list_* functions being context sensitive, they now warn + when called inappropriately. They will stop being context-sensitive some + time after April 2024. + +------------------------------------------------------------------- Old: ---- Devel-CheckOS-1.87.tar.gz New: ---- Devel-CheckOS-1.93.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Devel-CheckOS.spec ++++++ --- /var/tmp/diff_new_pack.CLqTD7/_old 2022-05-12 23:00:48.272832586 +0200 +++ /var/tmp/diff_new_pack.CLqTD7/_new 2022-05-12 23:00:48.276832591 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-Devel-CheckOS # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,23 +18,26 @@ %define cpan_name Devel-CheckOS Name: perl-Devel-CheckOS -Version: 1.87 +Version: 1.93 Release: 0 #Upstream: This software is free-as-in-speech software, and may be used, distributed, and modified under the terms of either the GNU General Public Licence version 2 or the Artistic Licence. It's up to you which one you use. The full text of the licences can be found in the files GPL2.txt and ARTISTIC.txt, respectively. +License: Artistic-1.0 OR GPL-2.0-only Summary: Check what OS we're running on -License: GPL-2.0-only OR Artistic-1.0 URL: https://metacpan.org/release/%{cpan_name} Source0: https://cpan.metacpan.org/authors/id/D/DC/DCANTRELL/%{cpan_name}-%{version}.tar.gz Source1: cpanspec.yml BuildArch: noarch BuildRequires: perl BuildRequires: perl-macros +BuildRequires: perl(ExtUtils::MakeMaker) >= 6.64 BuildRequires: perl(File::Find::Rule) >= 0.28 BuildRequires: perl(File::Temp) >= 0.19 BuildRequires: perl(Test::More) >= 0.88 +BuildRequires: perl(Test::Warnings) Requires: perl(File::Find::Rule) >= 0.28 Requires: perl(File::Temp) >= 0.19 Requires: perl(Test::More) >= 0.88 +Requires: perl(Test::Warnings) %{perl_requires} %description ++++++ Devel-CheckOS-1.87.tar.gz -> Devel-CheckOS-1.93.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/CHANGELOG new/Devel-CheckOS-1.93/CHANGELOG --- old/Devel-CheckOS-1.87/CHANGELOG 2021-05-25 21:44:59.000000000 +0200 +++ new/Devel-CheckOS-1.93/CHANGELOG 2022-04-25 22:22:38.000000000 +0200 @@ -1,3 +1,29 @@ +1.93 2022-04-25 + +- No functional changes, just changes to where dependencies are declared + https://github.com/DrHyde/perl-modules-Devel-CheckOS/issues/27 + +1.92 2022-04-24 + +- Fix bugs in new alias and case-insensitivity features which meant everything + broke in taint-mode. The new features now no longer work in taint-mode but + everything else should. + +1.91 2022-04-21 + +- Fix tests for platforms where the OS is detected as something that is + a family, but not as anything more specific, such as Fedora Linux + +1.90 2022-04-20 + +- Matches are now case-insensitive + +- Add support for OS aliases + +- Deprecated the list_* functions being context sensitive, they now warn + when called inappropriately. They will stop being context-sensitive some + time after April 2024. + 1.87 2021-05-25 - Add support for Devuan Linux diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/MANIFEST new/Devel-CheckOS-1.93/MANIFEST --- old/Devel-CheckOS-1.87/MANIFEST 2021-05-25 21:52:44.000000000 +0200 +++ new/Devel-CheckOS-1.93/MANIFEST 2022-04-25 23:29:12.000000000 +0200 @@ -118,5 +118,8 @@ t/unknown-debian.t lib/Devel/AssertOS/MacOSX/v11.pm lib/Devel/AssertOS/Linux/Devuan.pm +t/case-insensitive.t +lib/Devel/AssertOS/Alias/MacOS.pm +t/alias-macos.t META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/META.json new/Devel-CheckOS-1.93/META.json --- old/Devel-CheckOS-1.87/META.json 2021-05-25 21:52:44.000000000 +0200 +++ new/Devel-CheckOS-1.93/META.json 2022-04-25 23:29:12.000000000 +0200 @@ -28,7 +28,7 @@ }, "configure" : { "requires" : { - "ExtUtils::MakeMaker" : "0" + "ExtUtils::MakeMaker" : "6.64" } }, "runtime" : { @@ -36,8 +36,15 @@ "File::Find::Rule" : "0.28", "File::Temp" : "0.19", "Test::More" : "0.88", + "Test::Warnings" : "0", "perl" : "5.006000" } + }, + "test" : { + "requires" : { + "Test::More" : "0.88", + "Test::Warnings" : "0" + } } }, "release_status" : "stable", @@ -49,6 +56,6 @@ "url" : "https://github.com/DrHyde/perl-modules-Devel-CheckOS" } }, - "version" : "1.87", + "version" : "1.93", "x_serialization_backend" : "JSON::PP version 4.02" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/META.yml new/Devel-CheckOS-1.93/META.yml --- old/Devel-CheckOS-1.87/META.yml 2021-05-25 21:52:44.000000000 +0200 +++ new/Devel-CheckOS-1.93/META.yml 2022-04-25 23:29:12.000000000 +0200 @@ -4,8 +4,10 @@ - unknown build_requires: ExtUtils::MakeMaker: '0' + Test::More: '0.88' + Test::Warnings: '0' configure_requires: - ExtUtils::MakeMaker: '0' + ExtUtils::MakeMaker: '6.64' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.56, CPAN::Meta::Converter version 2.150010' license: unknown @@ -21,9 +23,10 @@ File::Find::Rule: '0.28' File::Temp: '0.19' Test::More: '0.88' + Test::Warnings: '0' perl: '5.006000' resources: bugtracker: https://github.com/DrHyde/perl-modules-Devel-CheckOS/issues repository: https://github.com/DrHyde/perl-modules-Devel-CheckOS -version: '1.87' +version: '1.93' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/Makefile.PL new/Devel-CheckOS-1.93/Makefile.PL --- old/Devel-CheckOS-1.87/Makefile.PL 2020-02-21 22:09:27.000000000 +0100 +++ new/Devel-CheckOS-1.93/Makefile.PL 2022-04-25 20:57:10.000000000 +0200 @@ -1,3 +1,4 @@ +#!perl require 5.006; use ExtUtils::MakeMaker; @@ -11,8 +12,8 @@ # one of these is not like the other # this is really a sanity check that loading bogus modules doesn't Fuck Shit Up use Devel::CheckOS; -Devel::CheckOS::list_family_members('Unix'); -Devel::CheckOS::list_family_members('MicrosoftWindows'); +my @dont_care = Devel::CheckOS::list_family_members('Unix'); + @dont_care = Devel::CheckOS::list_family_members('MicrosoftWindows'); my(@OSes, @notOSes, @extrafiles) = (); if($ENV{AUTOMATED_TESTING}) { @@ -67,13 +68,20 @@ }, }, MIN_PERL_VERSION => "5.6.0", - # FIXME have this look at all the modules, or summat VERSION_FROM => 'lib/Devel/CheckOS.pm', + CONFIGURE_REQUIRES => { + 'ExtUtils::MakeMaker' => 6.64, # TEST_REQUIRES (CONFIGURE_REQUIRES is in 6.52; BUILD_REQUIRES in 6.56) + }, PREREQ_PM => { - 'Test::More' => '0.88', # done_testing 'File::Find::Rule' => 0.28, 'File::Temp' => 0.19, - # 'Exporter' => 0 # core + 'Test::More' => 0.88, # done_testing + 'Test::Warnings' => 0, # listed here as well as in TEST_REQUIRES in case we've got a Ye Olde Toolchaine + # and not even the CONFIGURE_REQUIRES above is understood + }, + TEST_REQUIRES => { + 'Test::More' => 0.88, + 'Test::Warnings' => 0, }, EXE_FILES => [qw( bin/use-devel-assertos diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/bin/use-devel-assertos new/Devel-CheckOS-1.93/bin/use-devel-assertos --- old/Devel-CheckOS-1.87/bin/use-devel-assertos 2020-02-21 11:54:36.000000000 +0100 +++ new/Devel-CheckOS-1.93/bin/use-devel-assertos 2022-04-20 21:46:12.000000000 +0200 @@ -51,7 +51,15 @@ exit(1); } } -my @modulefiles = keys %{{map { $_ => $INC{$_} } grep { /Devel/i && /(Check|Assert)OS/i } keys %INC}}; +my @modulefiles = keys %{{ + map { $_ => $INC{$_} } + grep { + /\bDevel\b/i && + /\b(Check|Assert)OS\b/i && + $_ !~ /\bAlias\b/i + } + keys %INC +}}; mkdir 'inc'; mkdir 'inc/Devel'; @@ -97,7 +105,13 @@ if(open(FILE, $file)) { $contents = <FILE>; close(FILE); } open(FILE, ">$file") || die("Can't write $file\n"); print FILE 'use lib qw(inc); use Devel::AssertOS qw('. - join(' ', @oses). + join(' ', + sort { $a cmp $b } map { + exists($Devel::CheckOS::OS_ALIASES{$_}) + ? $Devel::CheckOS::OS_ALIASES{$_} + : $_ + } @oses + ). ");\n\n"; print FILE $contents; close(FILE); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/lib/Devel/AssertOS/Alias/MacOS.pm new/Devel-CheckOS-1.93/lib/Devel/AssertOS/Alias/MacOS.pm --- old/Devel-CheckOS-1.87/lib/Devel/AssertOS/Alias/MacOS.pm 1970-01-01 01:00:00.000000000 +0100 +++ new/Devel-CheckOS-1.93/lib/Devel/AssertOS/Alias/MacOS.pm 2022-04-20 12:03:09.000000000 +0200 @@ -0,0 +1,20 @@ +package Devel::AssertOS::Alias::MacOS; + +use strict; +use warnings; + +use Devel::CheckOS; + +our $VERSION = '1.0'; + +Devel::CheckOS::register_alias(MacOS => 'MacOSX'); + +=head1 COPYRIGHT and LICENCE + +Copyright 2007 - 2022 David Cantrell + +This software is free-as-in-speech software, and may be used, distributed, and modified under the terms of either the GNU General Public Licence version 2 or the Artistic Licence. It's up to you which one you use. The full text of the licences can be found in the files GPL2.txt and ARTISTIC.txt, respectively. + +=cut + +1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/lib/Devel/AssertOS/Extending.pod new/Devel-CheckOS-1.93/lib/Devel/AssertOS/Extending.pod --- old/Devel-CheckOS-1.87/lib/Devel/AssertOS/Extending.pod 2020-02-21 11:54:36.000000000 +0100 +++ new/Devel-CheckOS-1.93/lib/Devel/AssertOS/Extending.pod 2022-04-20 13:37:23.000000000 +0200 @@ -53,8 +53,6 @@ C<$^O>, instead use C<Devel::CheckOS::os_is> to check that we're running on any of the OSes in your family, like this: -match any of several values of C<$^O> like this: - package Devel::AssertOS::FreeSoftware; use Devel::CheckOS; use strict; @@ -86,6 +84,17 @@ feature is available (eg, whether POSIX shell redirection can be expected to work) then please discuss it with me first. +=head1 ALIASES + +I would like to reserve the namespace C<Devel::AssertOS::Alias::*> for use +by OS aliases. If you want to release a module that provides an alternative +name for an OS please discuss it with me first. + +Alias modules are simpler than normal extensions, they just need to call +C<Devel::CheckOS::register_alias()> when loaded, with the name of the alias +as its first argument and the real name of the OS as the second. See +L<Devel::AssertOS::Alias::MacOS> for an example. + =head1 BUGS and FEEDBACK I welcome feedback about my code, including constructive criticism. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/lib/Devel/CheckOS.pm new/Devel-CheckOS-1.93/lib/Devel/CheckOS.pm --- old/Devel-CheckOS-1.87/lib/Devel/CheckOS.pm 2021-05-25 02:01:07.000000000 +0200 +++ new/Devel-CheckOS-1.93/lib/Devel/CheckOS.pm 2022-04-25 22:22:46.000000000 +0200 @@ -2,20 +2,50 @@ use strict; use warnings; + use Exporter; +# if we're loading this from Makefile.PL, FFR might not yet be installed +eval 'use File::Find::Rule'; +use File::Spec; -use vars qw(@ISA @EXPORT_OK %EXPORT_TAGS); +use vars qw(@ISA @EXPORT_OK %EXPORT_TAGS %OS_ALIASES); -our $VERSION = '1.87'; +our $VERSION = '1.93'; @ISA = qw(Exporter); -@EXPORT_OK = qw(os_is os_isnt die_if_os_is die_if_os_isnt die_unsupported list_platforms list_family_members); +@EXPORT_OK = qw( + os_is os_isnt die_if_os_is die_if_os_isnt die_unsupported + list_platforms list_family_members register_alias +); %EXPORT_TAGS = ( all => \@EXPORT_OK, booleans => [qw(os_is os_isnt die_unsupported)], fatal => [qw(die_if_os_is die_if_os_isnt)] ); +# get a list of the .pm files under a list of dirs, or the empty list +# in taint mode +sub _find_pm_files_in_dirs { + my @files; + eval { @files = File::Find::Rule->file()->name('*.pm')->in(@_) }; + return @files; +} + +if(exists($INC{'File/Find/Rule.pm'})) { + foreach my $alias_module ( + _find_pm_files_in_dirs( + grep { -d } + map { File::Spec->catdir($_, qw(Devel AssertOS Alias)) } + @INC + ) + ) { + my(undef, undef, $file_part) = File::Spec->splitpath($alias_module); + $file_part =~ s/\.pm$//; + eval "use Devel::AssertOS::Alias::$file_part"; + warn("Bad alias module 'Devel::AssertOS::Alias::$file_part' ignored\n") if($@); + } +} + =head1 NAME Devel::CheckOS - check what OS we're running on @@ -50,8 +80,8 @@ =head1 FUNCTIONS Devel::CheckOS implements the following functions, which load subsidiary -OS-specific modules on demand to do the real work. They can be exported -by listing their names after C<use Devel::CheckOS>. You can also export +OS-specific modules on demand to do the real work. They can all be exported +by listing their names after C<use Devel::CheckOS>. You can also export groups of functions thus: use Devel::CheckOS qw(:booleans); # export the boolean functions @@ -59,7 +89,7 @@ use Devel::CheckOS qw(:fatal); # export those that die on no match - use Devel::CheckOS qw(:all); # export everything + use Devel::CheckOS qw(:all); # export everything exportable =head2 Boolean functions @@ -71,12 +101,36 @@ os_is(qw(Unix VMS)); # Unix is a family, VMS is an OS +Matching is case-insensitive provided that Taint-mode is not enabled, so the +above could also be written: + + os_is(qw(unix vms)); + =cut sub os_is { my @targets = @_; my $rval = 0; - foreach my $target (@targets) { + + TARGET: foreach my $target (@targets) { + # resolve aliases + ALIAS: foreach my $alias (keys %OS_ALIASES) { + if($target =~ /^$alias$/i) { + $target = $OS_ALIASES{$alias}; + last ALIAS; + } + } + + # resolve case-insensitive names (no-op in taint-mode as list_platforms + # won't work) + my @available_platforms = list_platforms(); + CANDIDATE: foreach my $candidate (@available_platforms) { + if($target =~ /^\Q$candidate\E$/i) { + $target = $candidate; + last CANDIDATE; + } + } + die("Devel::CheckOS: $target isn't a legal OS name\n") unless($target =~ /^\w+(::\w+)*$/); eval "use Devel::AssertOS::$target"; @@ -90,8 +144,8 @@ =head3 os_isnt -If the current platform matches any of the parameters it returns false, -otherwise it returns true. +If the current platform matches (case-insensitively) any of the parameters it +returns false, otherwise it returns true. =cut @@ -150,47 +204,39 @@ In scalar context, returns a hashref keyed by platform with the filename of the most recent version of the supporting module that is available to you. -This is to make sure that the use-devel-assertos script Does The Right Thing -in the case where you have installed the module in one version of perl, then -upgraded perl, and installed it again in the new version. Sometimes the old -version of perl and all its modules will still be hanging around and perl -"helpfully" includes the old perl's search path in its own. +This behaviour is deprecated. Unfortunately, on some platforms this list may have file case broken. eg, some platforms might return 'freebsd' instead of 'FreeBSD'. This is because they have case-insensitive filesystems so things should Just Work anyway. +This function does not work in taint-mode. + =cut -my ($re_Devel, $re_AssertOS); +my $case_flag = File::Spec->case_tolerant ? '(?i)' : ''; +my $re_Devel = qr/$case_flag ^Devel$/x; +my $re_AssertOS = qr/$case_flag ^AssertOS$/x; +my $re_Alias = qr/$case_flag ^Alias\b/x; sub list_platforms { - # need to lazily load these cos the module gets use()d in Makefile.PL, - # at which point pre-reqs might not be installed. This function isn't - # used in Makefile.PL so we can live without 'em. - eval " # only load these if needed - use File::Find::Rule; - use File::Spec; - "; - die($@) if($@); - - if (!$re_Devel) { - my $case_flag = File::Spec->case_tolerant ? '(?i)' : ''; - $re_Devel = qr/$case_flag ^Devel$/x; - $re_AssertOS = qr/$case_flag ^AssertOS$/x; - } - - # sort by mtime, so oldest last + # sort by mtime, so oldest last. This was necessary so that if a module + # appears twice in @INC we pick the newer one but that functionality is + # no longer needed. We do need to de-dupe the list though my @modules = sort { (stat($a->{file}))[9] <=> (stat($b->{file}))[9] + } grep { + $_->{module} !~ $re_Alias } map { my (undef, $dir_part, $file_part) = File::Spec->splitpath($_); $file_part =~ s/\.pm$//; my (@dirs) = grep {+length} File::Spec->splitdir($dir_part); foreach my $i (reverse 1..$#dirs) { - next unless $dirs[$i] =~ $re_AssertOS - && $dirs[$i - 1] =~ $re_Devel; + next unless( + $dirs[$i] =~ $re_AssertOS && + $dirs[$i - 1] =~ $re_Devel + );; splice @dirs, 0, $i + 1; last; } @@ -198,7 +244,7 @@ module => join('::', @dirs, $file_part), file => File::Spec->canonpath($_) } - } File::Find::Rule->file()->name('*.pm')->in( + } _find_pm_files_in_dirs( grep { -d } map { File::Spec->catdir($_, qw(Devel AssertOS)) } @INC @@ -211,6 +257,7 @@ if(wantarray()) { return sort keys %modules; } else { + warn("Calling list_platforms in scalar context and getting back a reference is deprecated and will go away some time after April 2024. To disable this warning set \$Devel::CheckOS::NoDeprecationWarnings::Context to a true value.\n") unless($Devel::CheckOS::NoDeprecationWarnings::Context); return \%modules; } } @@ -234,9 +281,39 @@ # ... so we can now query it my @members = eval qq{ no strict 'refs'; - &{"Devel::AssertOS::${family}::matches"}() + &{"Devel::AssertOS::${family}::matches"}() }; - return wantarray() ? @members : \@members; + if(wantarray()) { + return @members; + } else { + warn("Calling list_family_members in scalar context and getting back a reference is deprecated and will go away some time after April 2024. To disable this warning set \$Devel::CheckOS::NoDeprecationWarnings::Context to a true value.\n") unless($Devel::CheckOS::NoDeprecationWarnings::Context); + return \@members; + } +} + +=head3 register_alias + +It takes two arguments, the first being an alias name, the second being the +name of an OS. After the alias has been registered, any queries about the +alias will return the appropriate result for the named OS. + +It returns true unless you invoke it incorrectly or you attempt to change +an existing alias. + +Aliases don't work under taint-mode. + +See L<Devel::AssertOS::Extending>. + +=cut + +sub register_alias { + my($alias, $os) = @_; + ($alias && $os) || return 0; + if(!exists($OS_ALIASES{$alias}) || $OS_ALIASES{$alias} eq $os) { + return $OS_ALIASES{$alias} = $os; + } else { + return 0 + } } =head1 PLATFORMS SUPPORTED @@ -245,8 +322,7 @@ perl -MDevel::CheckOS -e 'print join(", ", Devel::CheckOS::list_platforms())' -Note that capitalisation is important. These are the names of the -underlying Devel::AssertOS::* modules +These are the names of the underlying Devel::AssertOS::* modules which do the actual platform detection, so they have to be 'legal' filenames and module names, which unfortunately precludes funny characters, so platforms like OS/2 are mis-spelt deliberately. @@ -273,6 +349,19 @@ open source endeavours by buying me something from my wishlist: L<http://www.cantrell.org.uk/david/wishlist/> +=head1 COMPATIBILITY + +Version 1.90 made all matches case-insensitive. This is a change in behaviour, but +if it breaks your code then your code was already broken, you just didn't know it. + +=head1 DEPRECATIONS + +At some point after April 2024 the C<list_family_members> and C<list_platforms> +functions will stop being sensitive to whether they are called in list context or +not, and will always return a list. From now until then calling them in non-list +context will emit a warning. You can turn that off by setting +C<$Devel::CheckOS::NoDeprecationWarnings::Context> to a true value. + =head1 SEE ALSO $^O in L<perlvar> @@ -325,7 +414,7 @@ =head1 COPYRIGHT and LICENCE -Copyright 2007-2020 David Cantrell +Copyright 2007-2022 David Cantrell This software is free-as-in-speech software, and may be used, distributed, and modified under the terms of either the GNU General Public Licence version 2 or the Artistic Licence. It's up to you which one you use. The full text of the licences can be found in the files GPL2.txt and ARTISTIC.txt, respectively. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/alias-macos.t new/Devel-CheckOS-1.93/t/alias-macos.t --- old/Devel-CheckOS-1.87/t/alias-macos.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Devel-CheckOS-1.93/t/alias-macos.t 2022-04-24 18:39:40.000000000 +0200 @@ -0,0 +1,16 @@ +use strict; +use warnings; + +use Devel::CheckOS qw(os_is os_isnt); + +use Test::More; + +if(os_is('MacOSX')) { + ok(os_is('MacOS'), "the alias works"); + ok(os_is('MACOS'), "... case-insensitively"); +} else { + ok(os_isnt('MacOS'), "the alias doesn't work because you're not on a Mac"); + ok(os_isnt('MACOS'), "... case-insensitively"); +} + +done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/assertos-blah-invalid.t new/Devel-CheckOS-1.93/t/assertos-blah-invalid.t --- old/Devel-CheckOS-1.87/t/assertos-blah-invalid.t 2020-02-21 11:54:36.000000000 +0100 +++ new/Devel-CheckOS-1.93/t/assertos-blah-invalid.t 2022-04-19 22:30:15.000000000 +0200 @@ -5,7 +5,6 @@ use lib File::Spec->catdir(qw(t lib)); use Test::More; -END { done_testing } eval "use Devel::AssertOS"; ok($@ =~ /needs at least one param/i, @@ -13,3 +12,5 @@ eval "use Devel::AssertOS::NotAnOperatingSystem"; ok($@ =~ /OS unsupported/i); + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/assertos-blah-valid.t new/Devel-CheckOS-1.93/t/assertos-blah-valid.t --- old/Devel-CheckOS-1.87/t/assertos-blah-valid.t 2020-02-21 11:54:36.000000000 +0100 +++ new/Devel-CheckOS-1.93/t/assertos-blah-valid.t 2022-04-19 22:30:07.000000000 +0200 @@ -5,6 +5,7 @@ use lib File::Spec->catdir(qw(t lib)); use Test::More; -END { done_testing } use_ok('Devel::AssertOS::AnOperatingSystem'); + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/assertos-do-not-want.t new/Devel-CheckOS-1.93/t/assertos-do-not-want.t --- old/Devel-CheckOS-1.87/t/assertos-do-not-want.t 2020-02-21 11:54:36.000000000 +0100 +++ new/Devel-CheckOS-1.93/t/assertos-do-not-want.t 2022-04-19 22:29:47.000000000 +0200 @@ -5,22 +5,23 @@ use lib File::Spec->catdir(qw(t lib)); use Test::More; -END { done_testing } eval "use Devel::AssertOS qw/ -NotAnOperatingSystem /"; - is $@ => '', "do not want, not our OS, all is good"; -eval "use Devel::AssertOS qw/ -AnOperatingSystem /"; +eval "use Devel::AssertOS qw/ -notanoperatingsystem /"; +is $@ => '', "do not want, not our OS, case-insensitively, all is good"; +eval "use Devel::AssertOS qw/ -AnOperatingSystem /"; like $@ => qr/OS unsupported/, "do not want our OS => dying"; -$@ = undef; +eval "use Devel::AssertOS qw/ -anoperatingsystem /"; +like $@ => qr/OS unsupported/, "do not want our OS case-insensitively => dying"; eval "use Devel::AssertOS qw/ -NotAnOperatingSystem AnOperatingSystem /"; - is $@ => '', 'negative + positive assertions successful'; eval "use Devel::AssertOS qw/ NotAnOperatingSystem -AnOperatingSystem /"; - like $@ => qr/OS unsupported/, 'negative + positive assertions failing'; + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/assertos-multi.t new/Devel-CheckOS-1.93/t/assertos-multi.t --- old/Devel-CheckOS-1.87/t/assertos-multi.t 2020-02-21 11:54:36.000000000 +0100 +++ new/Devel-CheckOS-1.93/t/assertos-multi.t 2022-04-19 22:30:23.000000000 +0200 @@ -5,6 +5,7 @@ use lib File::Spec->catdir(qw(t lib)); use Test::More; -END { done_testing } use_ok('Devel::AssertOS', 'NotAnOperatingSystem', 'AnOperatingSystem'); + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/assertos-single-invalid-OS.t new/Devel-CheckOS-1.93/t/assertos-single-invalid-OS.t --- old/Devel-CheckOS-1.87/t/assertos-single-invalid-OS.t 2020-02-21 11:54:36.000000000 +0100 +++ new/Devel-CheckOS-1.93/t/assertos-single-invalid-OS.t 2022-04-19 22:31:01.000000000 +0200 @@ -5,8 +5,9 @@ use lib File::Spec->catdir(qw(t lib)); use Test::More; -END { done_testing } eval "use Devel::AssertOS 'NotAnOperatingSystem'"; like $@, qr/OS unsupported/i; + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/assertos-single-valid-OS.t new/Devel-CheckOS-1.93/t/assertos-single-valid-OS.t --- old/Devel-CheckOS-1.87/t/assertos-single-valid-OS.t 2020-02-21 11:54:36.000000000 +0100 +++ new/Devel-CheckOS-1.93/t/assertos-single-valid-OS.t 2022-04-19 22:29:17.000000000 +0200 @@ -5,6 +5,7 @@ use lib File::Spec->catdir(qw(t lib)); use Test::More; -END { done_testing } use_ok('Devel::AssertOS', 'AnOperatingSystem'); + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/case-insensitive.t new/Devel-CheckOS-1.93/t/case-insensitive.t --- old/Devel-CheckOS-1.87/t/case-insensitive.t 1970-01-01 01:00:00.000000000 +0100 +++ new/Devel-CheckOS-1.93/t/case-insensitive.t 2022-04-21 19:17:45.000000000 +0200 @@ -0,0 +1,49 @@ +use strict; +use warnings; + +use File::Spec; +use lib; # no import yet! + +use Test::More; + +use Devel::CheckOS qw(list_platforms list_family_members os_is os_isnt); + +my $platform = find_platform(); + +# some platforms have all-upper names, so check the lower-case version as well +ok(os_is(uc($platform)), "os_is('".uc($platform)."')"); +ok(os_is(lc($platform)), "os_is('".lc($platform)."')"); + +lib->import(File::Spec->catdir(qw(t lib))); + +ok( + os_is( + 'anoperatingsystem', + os_is('Linux') ? 'Irix' : 'Linux' + ), + "case-insensitive works for multiple targets" +); +ok( + os_is( + (os_is('Linux') ? 'Irix' : 'Linux'), + 'anoperatingsystem' + ), + "... regardless of order" +); +ok( + !os_isnt( + (os_is('Linux') ? 'Irix' : 'Linux'), + 'anoperatingsystem' + ), + "os_isnt is also case-insensitive" +); + +done_testing; + +sub find_platform { + foreach my $platform (list_platforms()) { + if(os_is($platform)) { + return $platform; + } + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/checkos.t new/Devel-CheckOS-1.93/t/checkos.t --- old/Devel-CheckOS-1.87/t/checkos.t 2020-02-21 11:54:36.000000000 +0100 +++ new/Devel-CheckOS-1.93/t/checkos.t 2022-04-20 12:52:20.000000000 +0200 @@ -2,7 +2,7 @@ $^W = 1; use Test::More; -END { done_testing } +use Test::Warnings qw(warning); BEGIN { use_ok('Devel::CheckOS'); } @@ -38,12 +38,25 @@ (grep { /^NotAnOperatingSystem$/i } Devel::CheckOS::list_platforms()), "list_platforms works"); +ok(!(grep { /^Alias::MacOS$/i } Devel::CheckOS::list_platforms()), + "list_platforms excludes Aliases"); + eval "use lib File::Spec->catdir(qw(t otherlib))"; sleep(2); utime time(), time(), File::Spec->catfile(qw(t otherlib Devel AssertOS AnOperatingSystem.pm)); ok(1 == (grep { /^AnOperatingSystem$/i } Devel::CheckOS::list_platforms()), "A platform is listed only once"); -ok(Devel::CheckOS::list_platforms->{AnOperatingSystem} eq - File::Spec->catfile(qw(t otherlib Devel AssertOS AnOperatingSystem.pm)), - "scalar list_platforms gives the most recent module for an OS"); +{ + local $Devel::CheckOS::NoDeprecationWarnings::Context = 1; + ok(Devel::CheckOS::list_platforms->{AnOperatingSystem} eq + File::Spec->catfile(qw(t otherlib Devel AssertOS AnOperatingSystem.pm)), + "scalar list_platforms gives the most recent module for an OS"); +} + +is + warning { my $foo = Devel::CheckOS::list_platforms() }, + "Calling list_platforms in scalar context and getting back a reference is deprecated and will go away some time after April 2024. To disable this warning set \$Devel::CheckOS::NoDeprecationWarnings::Context to a true value.\n", + "list_platforms in scalar context == warning"; + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/expn.t new/Devel-CheckOS-1.93/t/expn.t --- old/Devel-CheckOS-1.87/t/expn.t 2020-10-05 13:27:42.000000000 +0200 +++ new/Devel-CheckOS-1.93/t/expn.t 2022-04-19 22:29:27.000000000 +0200 @@ -2,7 +2,6 @@ $^W = 1; use Test::More; -END { done_testing } use Devel::CheckOS; @@ -20,3 +19,4 @@ } } +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/failing-mockery.t new/Devel-CheckOS-1.93/t/failing-mockery.t --- old/Devel-CheckOS-1.87/t/failing-mockery.t 2020-10-05 13:31:35.000000000 +0200 +++ new/Devel-CheckOS-1.93/t/failing-mockery.t 2022-04-19 22:30:44.000000000 +0200 @@ -5,7 +5,6 @@ use lib File::Spec->catdir(qw(t lib)); use Test::More; -END { done_testing } use Devel::CheckOS; @@ -67,3 +66,5 @@ # eval "use Devel::AssertOS::$platform"; ok(Devel::CheckOS::os_is($platform) == 0, "unsupported: $platform when \t\$^O = $^O"); } + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/import-all.t new/Devel-CheckOS-1.93/t/import-all.t --- old/Devel-CheckOS-1.87/t/import-all.t 2020-02-21 11:54:36.000000000 +0100 +++ new/Devel-CheckOS-1.93/t/import-all.t 2022-04-19 22:30:34.000000000 +0200 @@ -3,8 +3,6 @@ use Test::More; -END { done_testing(); } - use Devel::CheckOS ':all'; use File::Spec; @@ -23,3 +21,5 @@ ok((grep { /^AnOperatingSystem$/i } list_platforms()), "list_platforms imported"); + +done_testing(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/import-bool.t new/Devel-CheckOS-1.93/t/import-bool.t --- old/Devel-CheckOS-1.87/t/import-bool.t 2020-02-21 11:54:36.000000000 +0100 +++ new/Devel-CheckOS-1.93/t/import-bool.t 2022-04-19 22:28:26.000000000 +0200 @@ -2,7 +2,6 @@ $^W = 1; use Test::More; -END { done_testing } use Devel::CheckOS ':booleans'; @@ -11,3 +10,5 @@ ok(os_is('AnOperatingSystem'), "os_is imported"); ok(os_isnt('NotAnOperatingSystem'), "os_isnt imported"); + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/import-fatal.t new/Devel-CheckOS-1.93/t/import-fatal.t --- old/Devel-CheckOS-1.87/t/import-fatal.t 2020-02-21 11:54:36.000000000 +0100 +++ new/Devel-CheckOS-1.93/t/import-fatal.t 2022-04-19 22:29:35.000000000 +0200 @@ -2,7 +2,6 @@ $^W = 1; use Test::More; -END { done_testing } use Devel::CheckOS ':fatal'; @@ -13,3 +12,5 @@ ok(!$@, "die_if_os_isnt imported"); eval { die_if_os_is('AnOperatingSystem') }; ok($@ =~ /OS unsupported/i, "die_if_os_is imported"); + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/list_family_members.t new/Devel-CheckOS-1.93/t/list_family_members.t --- old/Devel-CheckOS-1.87/t/list_family_members.t 2020-10-05 13:27:10.000000000 +0200 +++ new/Devel-CheckOS-1.93/t/list_family_members.t 2022-04-19 22:29:59.000000000 +0200 @@ -2,7 +2,7 @@ $^W = 1; use Test::More; -END { done_testing } +use Test::Warnings qw(warning); use Devel::CheckOS; @@ -10,7 +10,7 @@ ok($@, 'list_family_members() is fatal'); is_deeply( - scalar(Devel::CheckOS::list_family_members('Cygwin')), [], + [(Devel::CheckOS::list_family_members('Cygwin'))], [], 'list_family_members($not_a_family) gives an empty list' ); @@ -25,13 +25,24 @@ [qw(OSF VMS)], 'array list_family_members works for DEC family' ); -is_deeply( - scalar(Devel::CheckOS::list_family_members('DEC')), - [qw(OSF VMS)], - 'scalar list_family_members works for DEC family' -); -is_deeply( - scalar(Devel::CheckOS::list_family_members('MicrosoftWindows')), - [qw(Cygwin MSWin32 MSYS)], - 'scalar list_family_members works for MicrosoftWindows family' -); + +{ + local $Devel::CheckOS::NoDeprecationWarnings::Context = 1; + is_deeply( + scalar(Devel::CheckOS::list_family_members('DEC')), + [qw(OSF VMS)], + 'scalar list_family_members works for DEC family' + ); + is_deeply( + scalar(Devel::CheckOS::list_family_members('MicrosoftWindows')), + [qw(Cygwin MSWin32 MSYS)], + 'scalar list_family_members works for MicrosoftWindows family' + ); +} + +is + warning { my $foo = Devel::CheckOS::list_family_members('MicrosoftWindows') }, + "Calling list_family_members in scalar context and getting back a reference is deprecated and will go away some time after April 2024. To disable this warning set \$Devel::CheckOS::NoDeprecationWarnings::Context to a true value.\n", + "list_platforms in scalar context == warning"; + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/mockery.t new/Devel-CheckOS-1.93/t/mockery.t --- old/Devel-CheckOS-1.87/t/mockery.t 2020-10-05 13:30:22.000000000 +0200 +++ new/Devel-CheckOS-1.93/t/mockery.t 2022-04-19 22:29:08.000000000 +0200 @@ -6,8 +6,6 @@ use Test::More; -END { done_testing } - my %platforms = ( # $^O => platform name aix => 'AIX', @@ -81,3 +79,5 @@ ok(Devel::CheckOS::os_is('Linux'), "Android is also Linux"); ok(Devel::CheckOS::os_is('Unix'), "Android is also Unix"); } + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/multilevel-names.t new/Devel-CheckOS-1.93/t/multilevel-names.t --- old/Devel-CheckOS-1.87/t/multilevel-names.t 2020-02-21 11:54:36.000000000 +0100 +++ new/Devel-CheckOS-1.93/t/multilevel-names.t 2022-04-19 22:28:15.000000000 +0200 @@ -2,7 +2,6 @@ $^W = 1; use Test::More; -END { done_testing } use Devel::CheckOS ':booleans'; @@ -14,3 +13,5 @@ ok(join(' ', Devel::CheckOS::list_platforms()) =~ /\bLinux::v2_6\b/, "list_platforms supports multi-level names"); + +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Devel-CheckOS-1.87/t/script.t new/Devel-CheckOS-1.93/t/script.t --- old/Devel-CheckOS-1.87/t/script.t 2020-10-05 13:29:11.000000000 +0200 +++ new/Devel-CheckOS-1.93/t/script.t 2022-04-20 21:54:18.000000000 +0200 @@ -7,8 +7,6 @@ use Devel::CheckOS; use Cwd; -END { done_testing(); } - my $cwd = getcwd(); use Config (); @@ -33,7 +31,7 @@ is_deeply( [sort { $a cmp $b } (Devel::CheckOS::list_platforms())], [sort { $a cmp $b } split(/, /, $cmd)], - '-l spews the right stuff' + '-l spews the right stuff' ); chdir($cwd); ok(!-e File::Spec->catfile($projectdir, 'MANIFEST'), @@ -60,20 +58,20 @@ foreach(@modules) { ok(-e File::Spec->catfile( $projectdir, qw(inc Devel AssertOS), split('::', "$_.pm")), - join('/', "inc/Devel/AssertOS", split('::', "$_.pm"))." exists"); + join('/', "inc/Devel/AssertOS", split('::', "$_.pm"))." exists"); } is_deeply( [sort {$a cmp $b} split("\n", _getfile(File::Spec->catfile($projectdir, 'MANIFEST')))], - [sort {$a cmp $b} ( + [sort {$a cmp $b} ( qw( - inc/Devel/CheckOS.pm inc/Devel/AssertOS.pm - MANIFEST Makefile.PL + inc/Devel/CheckOS.pm inc/Devel/AssertOS.pm + MANIFEST Makefile.PL ), (map { join('/', "inc/Devel/AssertOS", split('::', "$_.pm")) } @modules) - )], - '... and update MANIFEST correctly' + )], + '... and update MANIFEST correctly' ); } @@ -85,39 +83,39 @@ print "# use-devel-assertos Linux::v2_6 MicrosoftWindows\n"; ok(-e File::Spec->catfile( $projectdir, qw(inc Devel AssertOS Linux v2_6.pm)), - "inc/Devel/AssertOS/Linux/v2_6.pm exists"); + "inc/Devel/AssertOS/Linux/v2_6.pm exists"); ok(-e File::Spec->catfile( $projectdir, qw(inc Devel AssertOS Linux.pm)), - "inc/Devel/AssertOS/Linux.pm exists"); + "inc/Devel/AssertOS/Linux.pm exists"); ok(-e File::Spec->catfile( $projectdir, qw(inc Devel AssertOS MSWin32.pm)), - "inc/Devel/AssertOS/MSWin32.pm exists"); + "inc/Devel/AssertOS/MSWin32.pm exists"); ok(-e File::Spec->catfile( $projectdir, qw(inc Devel AssertOS Cygwin.pm)), - "inc/Devel/AssertOS/Cygwin.pm exists"); + "inc/Devel/AssertOS/Cygwin.pm exists"); ok(-e File::Spec->catfile( $projectdir, qw(inc Devel AssertOS MicrosoftWindows.pm)), - "inc/Devel/AssertOS/MicrosoftWindows.pm exists"); + "inc/Devel/AssertOS/MicrosoftWindows.pm exists"); ok(-e File::Spec->catfile( $projectdir, qw(inc Devel AssertOS MSYS.pm)), - "inc/Devel/AssertOS/MSYS.pm exists"); + "inc/Devel/AssertOS/MSYS.pm exists"); ok(-e File::Spec->catfile( $projectdir, qw(inc Devel AssertOS.pm)), - "inc/Devel/AssertOS.pm exists"); + "inc/Devel/AssertOS.pm exists"); ok(-e File::Spec->catfile( $projectdir, qw(inc Devel CheckOS.pm)), - "inc/Devel/CheckOS.pm exists"); + "inc/Devel/CheckOS.pm exists"); is_deeply( [sort split("\n", _getfile(File::Spec->catfile($projectdir, 'MANIFEST')))], - [sort qw( inc/Devel/AssertOS/Android.pm - inc/Devel/AssertOS/Linux/v2_6.pm inc/Devel/AssertOS/Linux.pm - inc/Devel/AssertOS/MSWin32.pm inc/Devel/AssertOS/Cygwin.pm - inc/Devel/AssertOS/MicrosoftWindows.pm + [sort qw( inc/Devel/AssertOS/Android.pm + inc/Devel/AssertOS/Linux/v2_6.pm inc/Devel/AssertOS/Linux.pm + inc/Devel/AssertOS/MSWin32.pm inc/Devel/AssertOS/Cygwin.pm + inc/Devel/AssertOS/MicrosoftWindows.pm inc/Devel/AssertOS/MSYS.pm - inc/Devel/CheckOS.pm inc/Devel/AssertOS.pm - MANIFEST Makefile.PL - )], - '... and update MANIFEST correctly' + inc/Devel/CheckOS.pm inc/Devel/AssertOS.pm + MANIFEST Makefile.PL + )], + '... and update MANIFEST correctly' ); } @@ -163,12 +161,12 @@ ); is_deeply( [sort split("\n", _getfile(File::Spec->catfile($projectdir, 'MANIFEST')))], - [sort qw( inc/Devel/AssertOS/Android.pm - inc/Devel/AssertOS/Linux.pm inc/Devel/AssertOS/MSWin32.pm - inc/Devel/CheckOS.pm inc/Devel/AssertOS.pm - HLAGH - )], - '... and update MANIFEST correctly' + [sort qw( inc/Devel/AssertOS/Android.pm + inc/Devel/AssertOS/Linux.pm inc/Devel/AssertOS/MSWin32.pm + inc/Devel/CheckOS.pm inc/Devel/AssertOS.pm + HLAGH + )], + '... and update MANIFEST correctly' ); } @@ -191,35 +189,37 @@ ); is_deeply( [sort split("\n", _getfile(File::Spec->catfile($projectdir, 'MANIFEST')))], - [sort qw( inc/Devel/AssertOS/Android.pm - inc/Devel/AssertOS/Linux.pm inc/Devel/AssertOS/MSWin32.pm - inc/Devel/CheckOS.pm inc/Devel/AssertOS.pm - HLAGH - )], - '... and update MANIFEST correctly' + [sort qw( inc/Devel/AssertOS/Android.pm + inc/Devel/AssertOS/Linux.pm inc/Devel/AssertOS/MSWin32.pm + inc/Devel/CheckOS.pm inc/Devel/AssertOS.pm + HLAGH + )], + '... and update MANIFEST correctly' ); } sub emptydir { my $projectdir = File::Temp->newdir(); - _run_script($projectdir, qw(Linux MSWin32)); + _run_script($projectdir, qw(MacOS Linux MSWin32)); ok(-e File::Spec->catfile($projectdir, 'Makefile.PL'), "create Makefile.PL if there's neither Makefile.PL nor Build.PL"); is_deeply( _getfile(File::Spec->catfile($projectdir, 'Makefile.PL')), - 'use lib qw(inc); use Devel::AssertOS qw(Linux MSWin32); + 'use lib qw(inc); use Devel::AssertOS qw(Linux MSWin32 MacOSX); ', # mmm, significant whitespace '... and created it correctly' ); is_deeply( [sort split("\n", _getfile(File::Spec->catfile($projectdir, 'MANIFEST')))], - [sort qw( inc/Devel/AssertOS/Android.pm - inc/Devel/AssertOS/Linux.pm inc/Devel/AssertOS/MSWin32.pm - inc/Devel/CheckOS.pm inc/Devel/AssertOS.pm - MANIFEST Makefile.PL - )], - '... and MANIFEST created OK where there wasn\'t one' + [sort qw( + inc/Devel/AssertOS/Android.pm + inc/Devel/AssertOS/Linux.pm inc/Devel/AssertOS/MSWin32.pm + inc/Devel/AssertOS/MacOSX.pm + inc/Devel/CheckOS.pm inc/Devel/AssertOS.pm + MANIFEST Makefile.PL + )], + '... and MANIFEST created OK where there wasn\'t one' ); } @@ -232,3 +232,5 @@ system($^X, $cwd.'/bin/use-devel-assertos', '-q', @_); chdir($cwd); } + +done_testing();