From 1808cd499ad844d13036049e0f34a2a92b723849 Mon Sep 17 00:00:00 2001 From: Justin Davis Date: Sat, 21 Apr 2012 15:13:32 -0400 Subject: Make missing coremods message friendlier. Use the PREPSPATH env variable to tell the user exactly where the scrapecore script is located. --- preps/perl.d/perl-dist | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'preps/perl.d') diff --git a/preps/perl.d/perl-dist b/preps/perl.d/perl-dist index 407403d..45169f1 100755 --- a/preps/perl.d/perl-dist +++ b/preps/perl.d/perl-dist @@ -330,17 +330,21 @@ sub _nocore { my(@mods) = @_; - my $path = _vardir() . '/coremods'; - unless(-f $path){ - print STDERR "$PROG: error: $path is missing. + my $cmpath = _vardir() . '/coremods'; + unless(-f $cmpath){ + my $scpath = ($ENV{'PREPSPATH'} + ? "$ENV{'PREPSPATH'}/perl.d/scrapecore" + : q{genpkg's preps/perl.d/scrapecore}); + print STDERR <<"END_ERR"; +$PROG: error: $cmpath is missing. ****************************************************************************** - You must generate it with genpkg's metas/perl.d/scrapecore script. Run it - against the source distribution of perl that is currently being packaged. + You must generate it with $scpath. + Run it against the version of perl that is the official package. ****************************************************************************** -"; +END_ERR exit 1; } - open my $if, '<', $path or die "$PROG: open $path: $!"; + open my $if, '<', $cmpath or die "$PROG: open $cmpath: $!"; my %mods = map { ($_ => 1) } @mods; while(<$if>){ -- cgit v1.2.3-24-g4f1b