Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Local CPAN modules

by Tanktalus (Canon)
on Feb 05, 2008 at 00:39 UTC ( [id://666160]=note: print w/replies, xml ) Need Help??


in reply to Local CPAN modules

Been there, done that. :-)

What I do is simply do this:

  1. Untar everything (check if it's untarred already)
  2. Loop:
    1. If Build.PL exists:
      • Run $^X -I$install_base/lib Build.PL --install_base $install_base, and catch the output.
      • Check for /ERROR: Prerequisite (\S+) isn't installed/. If found, go to next item in loop.
      • Run $^X Build install (if failed, go to next item)
      • Delete current build from to-do hash.
      else if Makefile.PL exists:
      • Run $^X -I$install_base/lib Makefile.PL LIB=$install_base/lib PREFIX=$install_base, and catch the output.
      • Check for /prerequisite\s*(\S+)\s.*not found/. If found, go to next item in loop.
      • Run make install (if failed, go to next item)
      • Delete current build from to-do hash.
  3. After each iteration of the loop, if the size of the to-do hash is non-zero and hasn't changed (meaning some prereqs may not be satisfied, or some installs failed), bail. (This is important :->)
Obviously, I do this in perl. I don't even want to know how to do it in make - at least, automatically, that is. If it were in make, I'd just set up a bunch of targets where "DBD-mySQL: DBI" or something ... but that sounds painful, too :-)

Replies are listed 'Best First'.
Re^2: Local CPAN modules
by Jeppe (Monk) on Feb 05, 2008 at 11:01 UTC
    Thanks! I had that algorithm in the back of my head, but I had hoped to do something .. more elegant. Oh well. No tux and lotsa elbow grease will get the job done!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://666160]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-19 23:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found