This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make mconfig more verbose on fail
authorH.Merijn Brand - Tux <h.m.brand@xs4all.nl>
Fri, 12 May 2017 14:44:27 +0000 (16:44 +0200)
committerH.Merijn Brand - Tux <h.m.brand@xs4all.nl>
Fri, 12 May 2017 14:44:27 +0000 (16:44 +0200)
If a unit erroneously has

?MAKE:  -pick $@ $@

instead of

?MAKE:  -pick $@ %<

it passes with just one make target, but with two make targets, mconfig
fails with

Can't open .

which isn't very helpful

bin/mconfig

index 3ce6c63..0b9036f 100755 (executable)
@@ -1297,7 +1297,7 @@ sub process_command {
                        warn "\t    $msg\n";
                }
        }
-       die "Can't open $file.\n" unless open(UNIT, $file);
+       die "Can't open UNIT (name: $name, target: $target) $file.\n" unless open(UNIT, $file);
        print "\t$cmd $file\n" if $opt_v;
        &init_interp;                                           # Initializes the interpreter
 
@@ -1435,7 +1435,7 @@ sub process_command {
                        open(PREPEND, ">.prepend") ||
                                die "Can't create .MT/.prepend.\n";
                        open(TARGET, $Unit{$target}) ||
-                               die "Can't open $Unit{$target}.\n";
+                               die "Can't open Unit $Unit{$target}.\n";
                        while (<TARGET>) {
                                print PREPEND unless &skipped;
                        }