Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Bundles and offline installation issues

by decebel (Acolyte)
on Sep 16, 2009 at 13:37 UTC ( #795612=perlquestion: print w/ replies, xml ) Need Help??
decebel has asked for the wisdom of the Perl Monks concerning the following question:

Hi All,

I have been struggling with a simple task for offline installation of libraries and I am running into various issues. Fixing one issue brings up something else. I might be doing something silly that does not seem obvious to me at this point.

The issue is, installation of a Bundle module from offline on windows seems to be an issue for me.

Some details: My application requires some CPAN modules such as POE, Log4perl and all these modules and the application modules are downloaded and kept locally.

I am configuring so that urllist points to this path where the modules are downloaded.

Sample: 'urllist' => [q[file:c:\Users\Demouser\libs]]

Also, I have created a Bundle module and in this module I list all the modules I need as part of the installation process.

Now, from the cpan shell, I write, install Bundle::MySetup has POE, Log4perl and my custom modules mentioned in the POD section as required by Bundle specification.

The cpan shell starts looking at the path authors/id/R/RC/RCAPUTO/POE-1.267.tar.gz in c:\Users\Demouser\libs

Why does cpan shell do that? Why doesn't it simply look at c:\Users\Demouser\libs for the modules? Am I missing configuring some other variables here...

Appreciate your help Gracias Dece

Replies are listed 'Best First'.
Re: Bundles and offline installation issues
by marto (Bishop) on Sep 16, 2009 at 13:44 UTC

    This is perhaps slightly off topic, if your goal is to have an executable packaged with all the modules you need why not use something like pp (now part of PAR::Packer) to do that for you?


      Thanks Martin. I really haven't looked at other options. I will check that out but here are my 2 important goals:

      1. I am naturally inclined towards Bundle. Used by CPAN and looks super simple. Just list the names of the packages you want and thats is all to it.

      2. packaging should work for both windows & unix. I am assuming pp is different from ppm (Activestate). ppm is only good for windows.

        PPM is a package mangement tool, pp is an packaging tool. You could use it to make a single stand alone executable which will contain all of your modules (their prerequisites and so on) that your application needs, this executable can be run on machines that don't have Perl installed, so you wouldn't have to install/maintain a distribution of Perl on each machine you wanted to run it on, or worry about how you would get all of the modules you need installed on each target machine.

        So in theory you could develop your application, package it using pp (once for Linux, once for windows) and distribute the executable.

        If I was in your position I would opt for packaging up the application, rather than have to support Perl (ensuring all of the modules you require are installed) on X number of machines which are 'offline'.


Re: Bundles and offline installation issues
by ikegami (Pope) on Sep 16, 2009 at 14:19 UTC

    Because that's how distros are organised on CPAN. If you claim to be a CPAN mirror, you need to look like a CPAN mirror.

    Special mode "cpan ." is not sufficient for your needs, but it proves useful:

    #!/bin/sh cd "$(dirname "$(readlink -e "$0")")" for archive in *.tar.gz ; do distro=${archive%.tar.gz} tar xvzf $archive pushd $distro cpan . popd done

    Error checking needed.

Re: Bundles and offline installation issues
by admiral_grinder (Pilgrim) on Sep 16, 2009 at 14:56 UTC

    I looked into do that too but found it more of pain than anything. I kept running into annoying differences and various things that just didn't work. One of the main kickers was there I needed module versions that where no longer listed on CPAN.

    What I did wasn't any easier though. I ended up writing a script that extract, patch, build, test, and install a list of modules feed to it by a xml file.

    I used system calls to handle all the operations on the modules. Cross platform was easy since I used GNUWin32 builds of tar, gzip, patch, and unzip.

    In the xml file I would define the modules I wanted to use. Each module had their version, module prereqs, filename of the tar.gz file, and which platform to use it on (sometimes a version A works better on windows than version B which works great on linux). A few modules even needed to have environment variables defined and then post build instructions to copy dlls to arch/auto.

    I spent about a week on it, but most of the time was testing and adding little improvements here and there for it. It really makes life simple since all I have to do to support a new module is add it to the xml file and drop the .tar.gz file into a sub directory. In the end it was around 1000 lines, but I do use a lot of whitespace.

    I'm not sure if I will get to make it public, but it wasn't that much effort to write it up and I bet a couple of people looking at it can make it pretty solid too.

      Hey .. this xml thing looks awesome. Any chance you could publicize it with the world? Shamelessly saying ... you want to share it!! - Dece
Re: Bundles and offline installation issues
by Anonymous Monk on Sep 16, 2009 at 14:57 UTC
Re: Bundles and offline installation issues
by randyk (Parson) on Sep 17, 2009 at 01:43 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://795612]
Approved by marto
Front-paged by ikegami
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2016-07-28 06:41 GMT
Find Nodes?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?

    Results (253 votes). Check out past polls.