source: branches/samba-3.5.x/source4/script/buildtree.pl@ 738

Last change on this file since 738 was 414, checked in by Herwig Bauernfeind, 15 years ago

Samba 3.5.0: Initial import

File size: 953 bytes
Line 
1#! /usr/bin/env perl -w
2 eval 'exec /usr/bin/env perl -S $0 ${1+"$@"}'
3 if 0; #$running_under_some_shell
4
5use strict;
6use File::Find ();
7use File::Path qw(mkpath);
8use Cwd 'abs_path';
9
10# Set the variable $File::Find::dont_use_nlink if you're using AFS,
11# since AFS cheats.
12
13# for the convenience of &wanted calls, including -eval statements:
14use vars qw/*name *dir *prune/;
15*name = *File::Find::name;
16*dir = *File::Find::dir;
17*prune = *File::Find::prune;
18my $builddir = abs_path($ENV{builddir});
19my $srcdir = abs_path($ENV{srcdir});
20sub wanted;
21
22
23
24# Traverse desired filesystems
25File::Find::find({wanted => \&wanted, no_chdir => 1}, $srcdir);
26exit;
27
28
29sub wanted {
30 my ($dev,$ino,$mode,$nlink,$uid,$gid,$newdir);
31
32 if ((($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
33 (-d _) && (($newdir = abs_path($_)) !~ /$builddir/))
34 {
35 $newdir =~ s!$srcdir!$builddir!;
36 mkpath($newdir);
37 print("Creating $newdir\n");
38 }
39}
40
Note: See TracBrowser for help on using the repository browser.