Skip to content
No description or website provided.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



cpan2git is a script which allows you to convert perl modules (aka
distributions) from cpan/backpan to git repositories. cpan2git
converts a cpan/backpan mirror to a directory with a git repository
for each cpan module.

Each version of a module is tagged with the string

cpan2git also works incrementally. If a new version of a cpan module is
available, cpan2git will update the corresponding git repository.

System requirements:
 * 2 Gb of memory (swap is ok), due to some very large CPAN dists.


 * git (version >= 1.6.3)
 * perl (version >= 5.8.8)
 * perl modules
    * Archive::Extract
    * CPAN::DistnameInfo
    * List::MoreUtils
    * Locale::Maketext::Simple
    * Module::Load::Conditional
    * Params::Check
    * Scriptalicious
    * IO::Uncompress::Bunzip2
    * Archive::Zip
    * File::Touch (for the tests)

How to use to get a complete mirror in git repositories:

1. Setup local cpan/backpan mirror
     wget --mirror
     mkdir -p /var/lib/cpan2git/
     mv /var/lib/cpan2git/cpan-mirror
2. Install cpan2git
   example: git clone
3. Create a directory to contain your git repositories.
   example: mkdir -p /var/lib/cpan2git/repositories
4. Run cpan2git
   example: cd cpan2git && ./cpan2git --all --cpan-dir=/var/lib/cpan2git/cpan-mirror --repos-dir=/var/lib/cpan2git/repositories

Keeping your repository up-to-date:

1. Keep cpan mirror up-to-date
   example: add to crontab:
     rsync -qa rsync:// /var/lib/cpan2git/cpan-mirror
2. Keep repositories up-to-date
   example: add to crontab:
     /path/to/cpan2git --all --cpan-dir=/var/lib/cpan2git/cpan-mirror --repos-dir=/var/lib/cpan2git/repositories

Updating a single repository:

1. Keep cpan mirror up-to-date
   example: add to crontab:
     rsync -qa rsync:// /var/lib/cpan2git/cpan-mirror
2. Update your module:
   example: /path/to/cpan2git --dist-name=Plucene-Plugin-Analyzer-MetaphoneAnalyzer --cpan-dir=/var/lib/cpan2git/cpan-mirror --repos-dir=/var/lib/cpan2git/repositories

Something went wrong with that request. Please try again.