Skip to content

Instantly share code, notes, and snippets.

@wki
Created May 10, 2012 19:44
Show Gist options
  • Save wki/2655390 to your computer and use it in GitHub Desktop.
Save wki/2655390 to your computer and use it in GitHub Desktop.
install perl modules from carton.lock file
#!/bin/bash
#
# simple carton.lock based module installer script
# assumes that cpanm is installed natively for the perl used
#
# carton is not fully usable yet.
# One failing example is DBD::Pg.
# Reason: carton does not like "v2.19.2" version strings
#
perl -MJSON \
-E 'say for' \
-E 'map { $_->{pathname} }' \
-E 'values %{decode_json(join("", <>))->{modules}}' \
carton.lock \
| cpanm --mirror http://cpan.noris.net --mirror-only \
--notest --quiet \
-L local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment