Optimize file/directory pruning
authorKevin Koch <kpkoch@mit.edu>
Mon, 23 Apr 2007 15:54:19 +0000 (15:54 +0000)
committerKevin Koch <kpkoch@mit.edu>
Mon, 23 Apr 2007 15:54:19 +0000 (15:54 +0000)
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
src/windows/build/bkw-automation.html
src/windows/build/bkw.pl
src/windows/build/pruneFiles.pl
src/windows/build/sdkfiles.xml

index 30c77f91854bc683057200699220ec2b560cba3b..42cf1543b8e163721e1a80e48cb6d18043ea3e14 100644 (file)
                             </Files>\r
                     </CopyList>\r
                     <Prunes> <!-- Files to be removed from current build to match what is in the 3.1 distribution:    -->\r
-                        <Prune dummy="foo" />\r
                         <Prune name="CVS" />\r
                         <Prune name=".cvsignore" flags="i" />\r
                         <Prune name="Changelog"  flags="i" />\r
-<!--                        <Prune name="site" />   -->\r
                         </Prunes>\r
                     <Requires>\r
                         <Switch dummy="foo" />\r
                             <Include path="sdkfiles.xml" />         <!-- Included file is relative to location of bkw.pl. -->\r
                             </Files>\r
                         </CopyList>\r
-                    <Prunes> \r
-                        <Prune dummy="foo" />\r
-                        <Prune name="*.exe" />\r
-                        <Prune name="*.msi" />\r
-                        <Prune name="*.dll" />\r
-                        <Prune name="*.obj" />\r
-                        <Prune name="*.wixobj" />\r
-                        <Prune name="custom.lib" />\r
-                        <Prune name="custom.exp" />\r
-                        </Prunes>\r
                     </Zip>\r
                 </Zips>            \r
             <CopyList>            <!-- Copied at end of post-package step.  -->\r
index ab0ef7d3c1e24318b30752ac84a6a36b6fa35acc..637c9c9b806443d274dc88bec8ac0e62162a5913 100644 (file)
@@ -349,6 +349,8 @@ Default is bkw.pl.log. <BR>&nbsp;
             </H2>\r
             <P><STRONG>Can't clean directory; can't delete file or directory</STRONG><BR>\r
                 Make sure a file in the named directory isn't open in another application.</P>\r
+            <P><STRONG>Can't find kerberos.ver</STRONG><BR>\r
+                You skipped the repository step and are trying to build in an empty directory.</P>\r
         </DIV>\r
     </BODY>\r
 </HTML>\r
index 08a168243f6540476436ee2602e2f52284927ab0..439e68053bb10cf79e52cd1452deb3c1314556c5 100644 (file)
@@ -341,7 +341,6 @@ sub main {
                 'pismere/athena/util/lib/getopt', \r
                 'pismere/athena/util/guiwrap'\r
                 );\r
-            local $logging = $odr->{logfile}->{def} ? ">> $odr->{logfile}->{value} 2>&1" : " ";\r
             foreach my $module (@cvsmodules) {\r
                 local $cvscmd = $cvscmdroot." ".$module;\r
                 if ($verbose) {print "Info -- cvs command: $cvscmd\n";}\r
index 091a6a090a465526381295d416b0f8f5309f9214..9e47b1777e117ccae7fd19cb2044087163860408 100644 (file)
@@ -1,33 +1,35 @@
 #!perl -w\r
 \r
 #use strict;\r
-require "makeZip.pl";\r
+use Data::Dumper;\r
 \r
 sub pruneFiles {\r
     local ($xml, $config)   = @_;\r
-    local $prunes   = $xml->{Prunes};\r
+    local $prunes       = $xml->{Prunes};\r
     if (! $prunes) {return 0;}\r
-    \r
+\r
     # Use Unix find instead of Windows find.  Save PATH so we can restore it when we're done:\r
     local $savedPATH    = $ENV{PATH};\r
     $ENV{PATH}          = $config->{Config}->{unixfind}->{value}.";".$savedPATH;\r
-    local $j=0;\r
     print "Info -- Processing prunes in ".`cd`."\n"     if ($verbose);\r
-    while ($prunes->{Prune}->[$j]) {\r
-        if (exists $prunes->{Prune}->[$j]->{name}) {    ## Don't process dummy entry!\r
-            local $prune    = $prunes->{Prune}->[$j]->{name};\r
-            local $flags    = $prunes->{Prune}->[$j]->{flags};\r
-            $flags = "" if (!$flags);\r
-            local $cmd    = "find . -".$flags."name $prune";\r
-            print "Info -- Looking for filenames containing $prune\n";\r
-            local $list = `$cmd`;\r
-            foreach $target (split("\n", $list)) {\r
-                print "Info -- Pruning $target\n" if ($verbose);\r
-                ! system("rm -rf $target")              or die "Unable to prune $target";\r
-                }\r
-            }\r
-        $j++;\r
+    local $pru          = $prunes->{Prune};\r
+    local $files        = "( ";\r
+    local $bFirst       = 1;\r
+    while (($key, $val) = each %$pru) {\r
+        local $flags    = $val->{flags};\r
+        $flags          = "" if (!$flags);\r
+        if (!$bFirst)   {$files .= " -or ";}\r
+        $bFirst         = 0;\r
+        $files          .= "-".$flags."name $key";\r
+        print "Info -- Looking for filenames matching $key\n"   if ($verbose);\r
+        }\r
+    $files              .= " )";\r
+    local $list = `find . $files`;\r
+    if (length($list) >   1) {\r
+        print "Info -- Pruning $list\n" if ($verbose);\r
+        ! system("rm -rf $list")              or die "Unable to prune $list";\r
         }\r
+\r
     $ENV{PATH} = $savedPATH;\r
     }\r
 \r
index 3c1481f17cbd106f888f671919d722853de74cab..37a5f422c7230bcb932113bca3d74132b6ba54af 100644 (file)
@@ -7,7 +7,7 @@
 \r
                <File name="relnotes.html"  from="doc\kerberos"                 to="doc" />\r
                <File name="kclient.rtf"    from="athena\auth\krb4\kclient\doc" to="doc" />\r
-                <File name="msi-deployment-guide.txt" from="athena\auth\krb5\src\windows\installer\wix\"   to="\doc" />\r
+        <File name="msi-deployment-guide.txt" from="athena\auth\krb5\src\windows\installer\wix\"   to="\doc" />\r
 \r
                <File  name="*.*"           from="staging\inc"                  to="inc" />\r
                <!-- loadfuncs.c is deliberately here.  Otherwise, *.h would work. -->\r