Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Just another Perl shrine
 
PerlMonks  

MakeMaker and Symlinks

by beppu (Hermit)
on Dec 02, 2004 at 19:54 UTC ( [id://412011]=perlquestion: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

beppu has asked for the wisdom of the Perl Monks concerning the following question:

I have a set of legacy perl modules that need to stay where they are on the filesystem for backwards compatibility. However, I'd like to make a CPAN-styled perl module distribution out of them. I set up another directory with the standard layout we've all come to know and love, but it's not working for me due to symlinks not being followed.

Inside the lib/ directory, I have a symlink to the directory full of legacy perl modules. Unfortunately, when I do `perl Makefile.PL; make` it doesn't pick up any of the modules because it doesn't follow the symlink. Something that does work is if I make a lib/Legacy directory and then symlink to each individule module. MakeMaker seems to follow symlinks to files but not symlinks to directories.

I don't want to have to symlink each module individually if I could avoid it. What should I do?

Replies are listed 'Best First'.
Re: MakeMaker and Symlinks
by Anonymous Monk on Dec 03, 2004 at 04:42 UTC
    I don't want to have to symlink each module individually if I could avoid it. What should I do?
    Modify whatever magic in MakeMaker (risky) or simply copy (or symlink) each module individually.
    cat Makefile.PL my $to_symlink = '/blah/blah/legacy/lib'; use File::Find; use ExtUtils::Command qw[ mkdir copy ]; my @dirs; my @files; find ( sub { return if $_ =~ /^\.{1,2}$/; if( -d $File::Find::name ){ push @dirs, $File::Find::name; } else { push @files, $File::Find::name; } return;},$to_symlink); s/\Q$to_symlink// for @dirs ; mkpath @dirs; for ( @files ){ my $source = $_; s/\Q$to_symlink//; cp $source, $_; } WriteMakefile( ...
      I'm taking the symlink-every-module-individually approach. It'll do for now, and I don't really feel like modifying MakeMaker. Thanks for the reply.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://412011]
Approved by davidj
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.