summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Davis <jrcd83@gmail.com>2012-04-21 21:14:32 +0200
committerJustin Davis <jrcd83@gmail.com>2012-04-21 21:14:32 +0200
commit2ab2432f89f35802dcfea6c1ddd3746f9638a8b1 (patch)
tree3ce631710ca8723aa53317ac8dd3b4d10e25d304
parent1808cd499ad844d13036049e0f34a2a92b723849 (diff)
downloadgenpkg-2ab2432f89f35802dcfea6c1ddd3746f9638a8b1.tar.gz
genpkg-2ab2432f89f35802dcfea6c1ddd3746f9638a8b1.tar.xz
Make missing cpanmods message friendlier.
Scrapecore needs ~/.genpkg/var/cpanmods data to exist. When it is missing try to give a friendlier error message.
-rwxr-xr-xpreps/perl.d/scrapecore3
1 files changed, 3 insertions, 0 deletions
diff --git a/preps/perl.d/scrapecore b/preps/perl.d/scrapecore
index 25f5c80..c8bdac5 100755
--- a/preps/perl.d/scrapecore
+++ b/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;