Subject: | MSWin32 compatibility with Win32::Symlink |
Despite the fact that Perl built under native Win32 environment (like
ActivePerl) doesn't have symlink support, this support is provided by
NT-based operation systems (like Win2k/XP/2003), and Win32::Symlink can
be used as workaround on NTFS filesystem.
Attached patch adds Win32::Symlink usage for PAR::Repository when it
runs on $^O eq 'MSWin32' and has 'cl' as C Compiler in Config.pm (to
avoid using under Cygwin environment, where 'gcc' is used).
Sadly I found no functionality tests included in distributive, so I
cannot be sure about absolutely correct work, but it should.
--
Serguei Trouchelle
Subject: | PAR-Repository-1.14-Win32.patch |
--- S:\prj\CPAN\builds\PAR-Repository-0.14\Makefile.PL Sun Oct 29 14:35:06 2006
+++ S:\prj\CPAN\builds\PAR-Repository-0.14-W32\Makefile.PL Tue Nov 21 19:54:24 2006
@@ -3,6 +3,21 @@
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
+use Config;
+
+my @addprereq;
+
+if ($^O eq 'MSWin32' and $Config{'cc'} eq 'cl') { # Cygwin's gcc should work fine
+ eval { require Win32::Symlink; };
+ if ($@) {
+ warn "Using this module under native MSWin32 environment requires\nWin32::Symlink module.\n\n";
+ } else {
+ use Win32::Symlink;
+ }
+ @addprereq = 'Win32::Symlink' => '0.04';
+}
+
+
if (not $ENV{IGNORE_SYMLINK_WARNINGS} and not eval {symlink("", ""); 1;}) {
warn <<'HERE';
Your system does not support creation of symbolic links.
@@ -35,6 +50,7 @@
'Pod::Text' => '0',
'ExtUtils::Manifest' => '0',
'PAR::Repository::Query' => '0.12',
+ @addprereq,
}, # e.g., Module::Name => 1.1
EXE_FILES => [
'bin/parrepo',
--- S:\prj\CPAN\builds\PAR-Repository-0.14\lib\PAR\Repository.pm Sat Nov 04 23:47:41 2006
+++ S:\prj\CPAN\builds\PAR-Repository-0.14-W32\lib\PAR\Repository.pm Tue Nov 21 20:05:26 2006
@@ -14,6 +14,11 @@
use Archive::Zip qw//;
use File::Temp qw//;
use version qw//;
+use Config;
+
+if ($^O eq 'MSWin32' and $Config{'cc'} eq 'cl') {
+ use Win32::Symlink;
+}
use base qw/
PAR::Repository::Zip