1 #! /usr/bin/env perl -w
2 eval 'exec /usr/bin/env perl -S $0 ${1+"$@"}'
3 if 0; #$running_under_some_shell
7 use File::Path qw(mkpath);
10 # Set the variable $File::Find::dont_use_nlink if you're using AFS,
13 # for the convenience of &wanted calls, including -eval statements:
14 use vars qw/*name *dir *prune/;
15 *name = *File::Find::name;
16 *dir = *File::Find::dir;
17 *prune = *File::Find::prune;
18 my $builddir = abs_path($ENV{builddir});
19 my $srcdir = abs_path($ENV{srcdir});
24 # Traverse desired filesystems
25 File::Find::find({wanted => \&wanted, no_chdir => 1}, $srcdir);
30 my ($dev,$ino,$mode,$nlink,$uid,$gid,$newdir);
32 if ((($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
33 (-d _) && (($newdir = abs_path($_)) !~ /$builddir/))
35 $newdir =~ s!$srcdir!$builddir!;
37 print("Creating $newdir\n");