diff options
author | Justin Davis <jrcd83@gmail.com> | 2012-04-21 21:13:32 +0200 |
---|---|---|
committer | Justin Davis <jrcd83@gmail.com> | 2012-04-21 21:13:32 +0200 |
commit | 1808cd499ad844d13036049e0f34a2a92b723849 (patch) | |
tree | 7414465dd65670b8aec3080046e2ec6fb8cdefd6 | |
parent | 3065f2e3477e281f73031716cfab45e39189d5f9 (diff) | |
download | genpkg-1808cd499ad844d13036049e0f34a2a92b723849.tar.gz genpkg-1808cd499ad844d13036049e0f34a2a92b723849.tar.xz |
Make missing coremods message friendlier.
Use the PREPSPATH env variable to tell the user exactly
where the scrapecore script is located.
-rwxr-xr-x | preps/perl.d/perl-dist | 18 |
1 files changed, 11 insertions, 7 deletions
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>){ |