summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Koch <kpkoch@mit.edu>2007-04-26 13:02:32 +0000
committerKevin Koch <kpkoch@mit.edu>2007-04-26 13:02:32 +0000
commitded1d245bbb7b419f5d583802e4967e82a008801 (patch)
tree1379aa78ccd65d8c457ba28d9e11e7bccf61e7fd
parent25ea5b495029ee066548f6d6c1006c0f938cb9aa (diff)
Look for unix find command in multiple places
Not tagged yet in case it should not go in 3.2. Look for the unix find command in a list of directories instead of in only one place. This way Jeff can install cygwin in c:\tools\cygwin and Ken can have it in C:\cygwin. The two places in the list are for those two possibilities. c:\cygwin\bin and c:\tools\cygwin\bin. Move some prints below where logging starts, so the messages will be in the log. Ticket: new Target_Version: 1.6.1 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19534 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/windows/build/bkw.pl60
1 files changed, 37 insertions, 23 deletions
diff --git a/src/windows/build/bkw.pl b/src/windows/build/bkw.pl
index 439e68053..9321bf69b 100644
--- a/src/windows/build/bkw.pl
+++ b/src/windows/build/bkw.pl
@@ -237,22 +237,34 @@ sub main {
if ($vverbose) {print "Debug -- Config: ".Dumper($config);}
# Test the unix find command:
- if (! exists $odr->{unixfind}->{value}) {
- $odr->{unixfind}->{value} = "C:\\tools\\cygwin\\bin";
- }
- local $unixfind = $odr->{unixfind}->{value};
-
- local $savedPATH = $ENV{PATH};
- $ENV{PATH} = $unixfind.";".$savedPATH;
- print "Info -- chdir to ".`cd`."\n" if ($verbose);
- if (-e "a.tmp") {!system("rm a.tmp") or die "Fatal -- Couldn't clean temporary file a.tmp.";}
- !system("find . -maxdepth 0 -name a.tmp > b.tmp 2>&1") or die "Fatal -- find test failed.";
- local $filesize = -s "b.tmp";
- $ENV{PATH} = $savedPATH;
- if ($filesize > 0) {
- die "Fatal -- $unixfind does not appear to be a path to a UNIX find command.";
+ # List of directories where it might be:
+ my @find_dirs = ('c:\\cygwin\\bin', 'c:\\tools\\cygwin\\bin');
+ if (exists $odr->{unixfind}->{value}) { ## Was an additional place to look specified?
+ push (@find_dirs, $odr->{unixfind}->{value});
}
-
+ my $bFindFound = 0;
+ foreach my $dir (@find_dirs) {
+ if (-d $dir) {
+ local $savedPATH = $ENV{PATH};
+ $ENV{PATH} = $dir.";".$savedPATH;
+ if (-e "a.tmp") {!system("rm a.tmp") or die "Fatal -- Couldn't clean temporary file a.tmp.";}
+ !system("find . -maxdepth 0 -name a.tmp > b.tmp 2>&1") or die "Fatal -- find test failed.";
+ local $filesize = -s "b.tmp";
+ $ENV{PATH} = $savedPATH;
+ if ($filesize <= 0) {
+ $bFindFound = 1;
+ $odr->{unixfind}->{value} = $dir;
+ last;
+ }
+ }
+ }
+ if (! $bFindFound) {
+ print "Fatal -- unix find command not found in \n";
+ map {print " $_ "} @find_dirs;
+ print "\n";
+ die;
+ }
+
# Don't allow /svntag and /svnbranch simultaneously:
if ( (length $odr->{svntag}->{value} > 0) &&
(length $odr->{svnbranch}->{value} > 0) ) {
@@ -282,14 +294,6 @@ sub main {
}
}
- print "Executing $cmdline\n";
- local $argvsize = @ARGV;
- if ($argvsize > 0) {
- print "\nArguments for NMAKE: ";
- map {print " $_ "} @ARGV;
- print "\n";
- }
-
# (------------------------------------------------)
if ( (-d $wd) && ( ($rverb =~ /export/) || ($rverb =~ /checkout/) ) ) {
print "\n\nHEADS UP!!\n\n";
@@ -311,6 +315,16 @@ sub main {
$l->no_die_handler; ## Needed so XML::Simple won't throw exceptions.
}
+ print "Executing $cmdline\n";
+ local $argvsize = @ARGV;
+ if ($argvsize > 0) {
+ print "\nArguments for NMAKE: ";
+ map {print " $_ "} @ARGV;
+ print "\n";
+ }
+
+ print "Info -- Using unix find in $odr->{unixfind}->{value}\n" if ($verbose);
+
##++ Begin repository action:
if ($rverb =~ /skip/) {print "Info -- *** Skipping repository access.\n" if ($verbose);}
else {