diff options
Diffstat (limited to 'bin/locmaint')
-rwxr-xr-x | bin/locmaint | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/locmaint b/bin/locmaint index 67eea85b..c182ace0 100755 --- a/bin/locmaint +++ b/bin/locmaint @@ -593,13 +593,20 @@ Check whether C<$dir> contains any hidden or unhidden files, returning a true value if it does not, a false value if it does. If it does, print them. +As a special exception, ignore a zero-sized file named '.keep' (which +is used to prevent empty directories getting clobbered by things like +snap). + =cut sub empty_dir_or_list { my ($dir) = @_; opendir(my $dirh, $dir); - my @files = grep { $_ ne '.' && $_ ne '..' } readdir $dirh; + my @files + = grep $_ ne '.' + && $_ ne '..' + && !($_ eq ".keep" && -z catfile $dir, ".keep"), readdir $dirh; if (@files == 0) { return 1; |