3 # (c) 2002 Martin Pitt (martin@piware.de)
4 # This software is protected by the terms and conditions of the GNU
5 # General Public License (see http://www.gnu.org/copyleft/gpl.html for
11 # generate a recursive list of files in $d; honors per-directory
12 # configuration files .pibackuprc
15 $d .= '/' if ( substr( $d, -1 ) ne '/' );
17 # look for exclude file
19 if( -r $d.'.pibackuprc' ) {
20 open( EXCL, $d.'.pibackuprc' ) or die "Error: could not open $d.pibackuprc";
23 push @excl, glob $d.$_;
28 # open and traverse dir
30 opendir( DIR, $d ) or print STDERR "Could not open directory $d\n" && return;
33 while( defined( $f = readdir DIR ) ) {
34 next if $f eq '.' || $f eq '..';
36 foreach ( @excl ) { next FILE if $d.$f eq $_; }
38 if( !( -l $d.$f ) && -d _ ) {
41 if( !$newer || ( ( lstat _ )[9] >= $newer ) ) {
52 $newer = ( lstat $opt_n )[9]; # mtime
55 $term = $opt_0 ? "\0" : "\n";
57 $dir = $ARGV[0] || $ENV{'HOME'} || '/';