Build/PPK/Deptool/Util.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 31 CC 3 SCAR 14.6
CC
3
Cov
0%
older_than
6.0
recursive_delete
6.0
BEGIN
2.0
CRAP 4.3
1 package Build::PPK::Deptool::Util;
2  
3 # Copyright (c) 2018, cPanel, L.L.C.
4 # All rights reserved.
5 # http://cpanel.net/
6 #
7 # This is free software; you can redistribute it and/or modify it under the same
8 # terms as Perl itself. See the LICENSE file for further details.
9  
10 use strict;
11 use warnings;
12  
13 use File::Find ();
14  
15 sub older_than {
16 my ( $class, $a, $b ) = map { ( stat $_ )[9] } @_;
17  
18 return 1 if $a < $b;
19 return 0;
20 }
21  
22 sub recursive_delete {
23 my ( $class, @items ) = @_;
24  
25 File::Find::finddepth(
26 {
27 'no_chdir' => 1,
28 'wanted' => sub {
29 if ( -d $File::Find::name ) {
30 rmdir $File::Find::name;
31 }
32 else {
33 unlink $File::Find::name;
34 }
35 }
36 },
37 @items
38 );
39 }
40  
41 1;