[svn:parrot] r48115 - trunk/lib/Parrot

gerd at svn.parrot.org gerd at svn.parrot.org
Mon Jul 19 19:14:53 UTC 2010


Author: gerd
Date: Mon Jul 19 19:14:53 2010
New Revision: 48115
URL: https://trac.parrot.org/parrot/changeset/48115

Log:
to take care about symlinks; according to tt #509; also tested with a FAT32 destination, there the library will be copied

Modified:
   trunk/lib/Parrot/Install.pm

Modified: trunk/lib/Parrot/Install.pm
==============================================================================
--- trunk/lib/Parrot/Install.pm	Mon Jul 19 18:39:53 2010	(r48114)
+++ trunk/lib/Parrot/Install.pm	Mon Jul 19 19:14:53 2010	(r48115)
@@ -226,6 +226,23 @@
         else {
             next unless -e $src;
             next if $^O eq 'cygwin' and -e "$src.exe"; # stat works, copy not
+            eval {
+                if (-l $src) {   # a link should be created
+                    # check if the system supports symbolic linking
+                    use Config;
+                    if ($Config{d_symlink} && $Config{d_readlink}) {
+                        # copy as symbolic link
+                        symlink(readlink($src), $dest);
+                        # by success take next file, else the file will be
+                        # copied with the command after the eval block of
+                        # this loop
+                        if (-e $dest) {
+                            print "$dest\n";
+                            next;
+                        }
+                    }
+                }
+            };
             copy( $src, $dest ) or die "Error: couldn't copy $src to $dest: $!\n";
             print "$dest\n";
         }


More information about the parrot-commits mailing list