This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Handy script for when one forgets to "dmake clean"
authorNick Ing-Simmons <nik@tiuk.ti.com>
Thu, 21 Dec 2000 22:11:50 +0000 (22:11 +0000)
committerNick Ing-Simmons <nik@tiuk.ti.com>
Thu, 21 Dec 2000 22:11:50 +0000 (22:11 +0000)
p4raw-id: //depot/perlio@8226

MANIFEST
win32/distclean.bat [new file with mode: 0755]

index 49f6e34..1bf4b4a 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1762,6 +1762,7 @@ win32/config_H.vc Win32 config header (Visual C++ build)
 win32/config_h.PL      Perl code to convert Win32 config.sh to config.h
 win32/config_sh.PL     Perl code to update Win32 config.sh from Makefile
 win32/des_fcrypt.patch Win32 port
+win32/distclean.bat    Remove _ALL_ files not listed here in MANIFEST
 win32/dl_win32.xs      Win32 port
 win32/genmk95.pl        Perl code to generate command.com-usable makefile.95
 win32/include/arpa/inet.h      Win32 port
diff --git a/win32/distclean.bat b/win32/distclean.bat
new file mode 100755 (executable)
index 0000000..e202eab
--- /dev/null
@@ -0,0 +1,30 @@
+@perl -w -Sx %0 %*
+@goto end_of_perl
+#!perl -w
+BEGIN { push(@INC,'lib') }
+use strict;
+use File::Find;
+use ExtUtils::Manifest qw(maniread);
+my $files = maniread();
+my @dead;
+find(sub { 
+return if -d $_;
+my $name = $File::Find::name;
+$name =~ s#^\./##;
+ unless (exists $files->{$name})
+  {
+   print "new $name\n";
+   push(@dead,$name);
+  } 
+},'.');
+
+foreach my $file (@dead)
+ {
+  chmod(0666,$file) unless -w $file;
+  unlink($file) || warn "Cannot delete $file:$!";
+ }
+
+__END__
+:end_of_perl
+del perl.exe
+del perl*.dll
\ No newline at end of file