This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Introduce a 'veryclean' target that is like 'distclean'
[perl5.git] / lib / ExtUtils / MM_Unix.pm
index 4c8da33..c55cc0a 100644 (file)
@@ -457,7 +457,7 @@ EOT
     push(@otherfiles, qw[./blib $(MAKE_APERL_FILE) $(INST_ARCHAUTODIR)/extralibs.all
                         perlmain.c mon.out core core.*perl.*.?
                         *perl.core so_locations pm_to_blib
-                        *~ */*~ */*/*~ *$(OBJ_EXT) *$(LIB_EXT) perl.exe
+                        *$(OBJ_EXT) *$(LIB_EXT) perl.exe
                         $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def
                         $(BASEEXT).exp
                        ]);
@@ -812,7 +812,7 @@ DIST_DEFAULT = $dist_default
 
 =item dist_basics (o)
 
-Defines the targets distclean, distcheck, skipcheck, manifest.
+Defines the targets distclean, distcheck, skipcheck, manifest, veryclean.
 
 =cut
 
@@ -840,6 +840,11 @@ manifest :
        $(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) -MExtUtils::Manifest=mkmanifest \\
                -e mkmanifest
 };
+
+    push @m, q{
+veryclean : realclean
+       $(RM_F) *~ *.orig */*~ */*.orig
+};
     join "", @m;
 }
 
@@ -1249,11 +1254,6 @@ eval 'exec $interpreter $arg -S \$0 \${1+"\$\@"}'
            next;
        }
        my($dev,$ino,$mode) = stat FIXIN;
-       # If they override perm_rwx, we won't notice it during fixin,
-       # because fixin is run through a new instance of MakeMaker.
-       # That is why we must run another CHMOD later.
-       $mode = oct($self->perm_rwx) unless $dev;
-       chmod $mode, $file;
        
        # Print out the new #! line (or equivalent).
        local $\;
@@ -1261,7 +1261,15 @@ eval 'exec $interpreter $arg -S \$0 \${1+"\$\@"}'
        print FIXOUT $shb, <FIXIN>;
        close FIXIN;
        close FIXOUT;
-       # can't rename open files on some DOSISH platforms
+
+       # can't rename/chmod open files on some DOSISH platforms
+
+       # If they override perm_rwx, we won't notice it during fixin,
+       # because fixin is run through a new instance of MakeMaker.
+       # That is why we must run another CHMOD later.
+       $mode = oct($self->perm_rwx) unless $dev;
+       chmod $mode, $file;
+
        unless ( rename($file, "$file.bak") ) { 
            warn "Can't rename $file to $file.bak: $!";
            next;
@@ -1276,6 +1284,7 @@ eval 'exec $interpreter $arg -S \$0 \${1+"\$\@"}'
        }
        unlink "$file.bak";
     } continue {
+       close(FIXIN) if fileno(FIXIN);
        chmod oct($self->perm_rwx), $file or
          die "Can't reset permissions for $file: $!\n";
        system("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';;
@@ -3496,7 +3505,7 @@ MOD_INSTALL = $(PERL) -I$(INST_LIB) -I$(PERL_LIB) -MExtUtils::Install \
 -e "install({@ARGV},'$(VERBINST)',0,'$(UNINST)');"
 
 DOC_INSTALL = $(PERL) -e '$$\="\n\n";' \
--e 'print "=head2 ", scalar(localtime), ": C<", shift, ">", " L<", shift, ">";' \
+-e 'print "=head2 ", scalar(localtime), ": C<", shift, ">", " L<", $$arg=shift, "|", $$arg, ">";' \
 -e 'print "=over 4";' \
 -e 'while (defined($$key = shift) and defined($$val = shift)){print "=item *";print "C<$$key: $$val>";}' \
 -e 'print "=back";'