perl/perl-file_path_rmtree_chmod_again.diff
OBS User autobuild 609b92152f Accepting request 31309 from devel:languages:perl
Copy from devel:languages:perl/perl based on submit request 31309 from user coolo

OBS-URL: https://build.opensuse.org/request/show/31309
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/perl?expand=0&rev=36
2010-02-05 12:54:45 +00:00

25 lines
1.1 KiB
Diff

--- lib/File/Path.pm.orig
+++ lib/File/Path.pm
@@ -316,10 +316,8 @@ sub _rmtree {
print "skipped $root\n" if $arg->{verbose};
next ROOT_DIR;
}
- if (!chmod $perm | 0700, $root) {
- if ($Force_Writeable) {
- _error($arg, "cannot make directory writeable", $canon);
- }
+ if ($Force_Writeable && !chmod $perm | 0700, $root) {
+ _error($arg, "cannot make directory writeable", $canon);
}
print "rmdir $root\n" if $arg->{verbose};
if (rmdir $root) {
@@ -328,7 +326,7 @@ sub _rmtree {
}
else {
_error($arg, "cannot remove directory", $canon);
- if (!chmod($perm, ($Is_VMS ? VMS::Filespec::fileify($root) : $root))
+ if ($Force_Writeable && !chmod($perm, ($Is_VMS ? VMS::Filespec::fileify($root) : $root))
) {
_error($arg, sprintf("cannot restore permissions to 0%o",$perm), $canon);
}