/[pkgs]/devel/perl/36_fix_file_temp_cleanup
ViewVC logotype

Contents of /devel/perl/36_fix_file_temp_cleanup

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Mar 11 22:01:05 2009 UTC (8 months, 1 week ago) by spot
Branch: MAIN
CVS Tags: F-12-split, perl-5_10_0-63_fc11, perl-5_10_0-61_fc11, perl-5_10_0-80_fc12, perl-5_10_0-81_fc12, perl-5_10_0-84_fc13, perl-5_10_0-82_fc13, perl-5_10_0-77_fc12, perl-5_10_0-83_fc13, perl-5_10_0-71_fc12, perl-5_10_0-75_fc12, perl-5_10_0-73_fc12, perl-5_10_0-68_fc11, perl-5_10_0-67_fc11, perl-5_10_0-64_fc11, perl-5_10_0-72_fc12, F-11-split, perl-5_10_0-62_fc11, perl-5_10_0-69_fc12, perl-5_10_0-79_fc12, perl-5_10_0-78_fc12, perl-5_10_0-70_fc12, perl-5_10_0-74_fc12, perl-5_10_0-66_fc11, perl-5_10_0-65_fc11, perl-5_10_0-76_fc12, HEAD
reorder @INC, fix bz 489204, merge useful debian patches
1 Make File::Temp warn on cleaning up the current working directory at exit instead of bailing out. (Closes: #479317)
2
3 Adapted from File-Temp 0.21.
4 [rt.cpan.org #35779]
5 diff --git a/lib/File/Temp.pm b/lib/File/Temp.pm
6 index b933963..ccc2316 100644
7 --- a/lib/File/Temp.pm
8 +++ b/lib/File/Temp.pm
9 @@ -890,7 +890,12 @@ sub _can_do_level {
10 @{ $dirs_to_unlink{$$} } : () );
11 foreach my $dir (@dirs) {
12 if (-d $dir) {
13 - rmtree($dir, $DEBUG, 0);
14 + # Some versions of rmtree will abort if you attempt to remove
15 + # the directory you are sitting in. We protect that and turn it
16 + # into a warning. We do this because this occurs during
17 + # cleanup and so can not be caught by the user.
18 + eval { rmtree($dir, $DEBUG, 0); };
19 + warn $@ if ($@ && $^W);
20 }
21 }
22
23 @@ -2234,6 +2239,12 @@ srand(EXPR) in each child else all the children will attempt to walk
24 through the same set of random file names and may well cause
25 themselves to give up if they exceed the number of retry attempts.
26
27 +=head2 Directory removal
28 +
29 +Note that if you have chdir'ed into the temporary directory and it is
30 +subsequently cleaned up in the END block, then you will get a warning
31 +from File::Path::rmtree().
32 +
33 =head2 BINMODE
34
35 The file returned by File::Temp will have been opened in binary mode

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2