Permalink
Browse files

Make missing cpanmods message friendlier.

Scrapecore needs ~/.genpkg/var/cpanmods data to exist.
When it is missing try to give a friendlier error message.
  • Loading branch information...
1 parent 1808cd4 commit 2ab2432f89f35802dcfea6c1ddd3746f9638a8b1 @juster committed Apr 21, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 preps/perl.d/scrapecore
@@ -208,6 +208,9 @@ sub coreonly
my %mods = map { @$_ } @_;
my $var = $ENV{'PKGVAR'} || "$ENV{'HOME'}/.genpkg/var";
my $path = "$var/cpanmods";
+ unless(-f $path){
+ die "$0: $path is missing. Generate it with fetchcpan.\n";
+ }
open(my $if, '<', $path) or die("open $path failed: $!");
my @dists;

0 comments on commit 2ab2432

Please sign in to comment.