From d6658915d06df1f90191b2ff12c7c4a61ab0e47e Mon Sep 17 00:00:00 2001 From: Kevin Koch Date: Mon, 23 Apr 2007 15:54:19 +0000 Subject: [PATCH] Optimize file/directory pruning Not tagged yet so it can be evaluated first. Consolidate find and rm operations in prunefiles.pl as suggested by Ken. Remove pruning of SDK files. This hasn't been needed since the installer builds moved from staging to temp directories. Remove debug statement not cleaned up previously. Add a troubleshooting tip to the doc. Ticket: new Target_Version: 1.6.1 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19521 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/build/BKWconfig.xml | 12 --------- src/windows/build/bkw-automation.html | 2 ++ src/windows/build/bkw.pl | 1 - src/windows/build/pruneFiles.pl | 38 ++++++++++++++------------- src/windows/build/sdkfiles.xml | 2 +- 5 files changed, 23 insertions(+), 32 deletions(-) diff --git a/src/windows/build/BKWconfig.xml b/src/windows/build/BKWconfig.xml index 30c77f918..42cf1543b 100644 --- a/src/windows/build/BKWconfig.xml +++ b/src/windows/build/BKWconfig.xml @@ -67,11 +67,9 @@ - - @@ -155,16 +153,6 @@ - - - - - - - - - - diff --git a/src/windows/build/bkw-automation.html b/src/windows/build/bkw-automation.html index ab0ef7d3c..637c9c9b8 100644 --- a/src/windows/build/bkw-automation.html +++ b/src/windows/build/bkw-automation.html @@ -349,6 +349,8 @@ Default is bkw.pl.log.
 

Can't clean directory; can't delete file or directory
Make sure a file in the named directory isn't open in another application.

+

Can't find kerberos.ver
+ You skipped the repository step and are trying to build in an empty directory.

diff --git a/src/windows/build/bkw.pl b/src/windows/build/bkw.pl index 08a168243..439e68053 100644 --- a/src/windows/build/bkw.pl +++ b/src/windows/build/bkw.pl @@ -341,7 +341,6 @@ sub main { 'pismere/athena/util/lib/getopt', 'pismere/athena/util/guiwrap' ); - local $logging = $odr->{logfile}->{def} ? ">> $odr->{logfile}->{value} 2>&1" : " "; foreach my $module (@cvsmodules) { local $cvscmd = $cvscmdroot." ".$module; if ($verbose) {print "Info -- cvs command: $cvscmd\n";} diff --git a/src/windows/build/pruneFiles.pl b/src/windows/build/pruneFiles.pl index 091a6a090..9e47b1777 100644 --- a/src/windows/build/pruneFiles.pl +++ b/src/windows/build/pruneFiles.pl @@ -1,33 +1,35 @@ #!perl -w #use strict; -require "makeZip.pl"; +use Data::Dumper; sub pruneFiles { local ($xml, $config) = @_; - local $prunes = $xml->{Prunes}; + local $prunes = $xml->{Prunes}; if (! $prunes) {return 0;} - + # Use Unix find instead of Windows find. Save PATH so we can restore it when we're done: local $savedPATH = $ENV{PATH}; $ENV{PATH} = $config->{Config}->{unixfind}->{value}.";".$savedPATH; - local $j=0; print "Info -- Processing prunes in ".`cd`."\n" if ($verbose); - while ($prunes->{Prune}->[$j]) { - if (exists $prunes->{Prune}->[$j]->{name}) { ## Don't process dummy entry! - local $prune = $prunes->{Prune}->[$j]->{name}; - local $flags = $prunes->{Prune}->[$j]->{flags}; - $flags = "" if (!$flags); - local $cmd = "find . -".$flags."name $prune"; - print "Info -- Looking for filenames containing $prune\n"; - local $list = `$cmd`; - foreach $target (split("\n", $list)) { - print "Info -- Pruning $target\n" if ($verbose); - ! system("rm -rf $target") or die "Unable to prune $target"; - } - } - $j++; + local $pru = $prunes->{Prune}; + local $files = "( "; + local $bFirst = 1; + while (($key, $val) = each %$pru) { + local $flags = $val->{flags}; + $flags = "" if (!$flags); + if (!$bFirst) {$files .= " -or ";} + $bFirst = 0; + $files .= "-".$flags."name $key"; + print "Info -- Looking for filenames matching $key\n" if ($verbose); + } + $files .= " )"; + local $list = `find . $files`; + if (length($list) > 1) { + print "Info -- Pruning $list\n" if ($verbose); + ! system("rm -rf $list") or die "Unable to prune $list"; } + $ENV{PATH} = $savedPATH; } diff --git a/src/windows/build/sdkfiles.xml b/src/windows/build/sdkfiles.xml index 3c1481f17..37a5f422c 100644 --- a/src/windows/build/sdkfiles.xml +++ b/src/windows/build/sdkfiles.xml @@ -7,7 +7,7 @@ - + -- 2.26.2