Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP5:GA
mirror.10321
mirror-directories-deleted.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File mirror-directories-deleted.patch of Package mirror.10321
Index: mirror.pl =================================================================== --- mirror.pl.orig +++ mirror.pl @@ -3179,9 +3179,12 @@ sub do_delete $del =~ s,/+$,,; if( $do_deletes ){ if( $get_file ){ - &msg( $log, "rmdir $cwd/$del\n" ); - rmdir( "$cwd/$del" ) || - &msg( $log, "rmdir $cwd/$del failed: $!\n" ); + # bsc#1117110, delete empty dir only + if( is_folder_empty("$cwd/$del") ){ + &msg( $log, "rmdir $cwd/$del\n" ); + rmdir( "$cwd/$del" ) || + &msg( $log, "rmdir $cwd/$del failed: $!\n" ); + } } else { &msg( $log, "delete DIR $del\n" ); @@ -3223,6 +3226,13 @@ sub do_delete } } +sub is_folder_empty +{ + my $dirname = shift; + opendir(my $dh, $dirname) or die "Not a directory"; + return scalar(grep { $_ ne "." && $_ ne ".." } readdir($dh)) == 0; +} + sub filesize { local( $fname ) = @_;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor