Train build script to use repository sources, omit sample configuration. [wix area.]
authorKevin Koch <kpkoch@mit.edu>
Mon, 5 Mar 2007 22:34:25 +0000 (22:34 +0000)
committerKevin Koch <kpkoch@mit.edu>
Mon, 5 Mar 2007 22:34:25 +0000 (22:34 +0000)
Add control of the repository access step, fetch all sources from the repository.  Track in documentation.

Eliminate unhelpful output during pre-package step.

The next step is to fetch only krb5/src/windows/build and run the entire build.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19207 dc483132-0cff-0310-8789-dd5450dbe970

src/windows/build/BKWconfig.xml
src/windows/build/bkw-automation.html
src/windows/build/bkw.pl
src/windows/installer/wix/features.wxi
src/windows/installer/wix/files.wxi

index 17b88af85cfbc59fc5b59a7aa93e8e3af4b0d772..61e5ee59d29c38f687b3336e012e6d19a71531ba 100644 (file)
@@ -5,8 +5,8 @@
          <!-- The most changeable parameters can be specified on the command line.\r
               Less changeable params are in section Config, below. -->\r
                <Tags>\r
-                       <cvs value="2.6.5 build 1234"/>\r
-<!--                   <svn value="http://anonsvn.mit.edu/foo/bar"/>   -->\r
+                       <cvs value=""/>\r
+<!--                   <svn value=""/> -->\r
                </Tags>\r
                <Directories>\r
                        <!--    Sources will be checked out of repositories into <src>.  The structure\r
@@ -20,7 +20,8 @@
                </Directories>\r
                <Options>\r
                        <debug                  value="0" />\r
-                       <log                            value="1" path="bkw_pl.log" />\r
+                       <logfile                        value="1" path="bkw.pl.log" />\r
+                       <repository     value="skip" />\r
                        <clean                  value="0" />\r
                        <nomake         value="0" />\r
                        <nopackage      value="0" />\r
@@ -30,7 +31,7 @@
        </CommandLine>\r
        <Config>\r
                <CVSROOT        name=":kserver:cvs.mit.edu:/cvs/pismere" />\r
-               <SVNURL         name="" />\r
+               <SVNURL         name="svn+ssh://svn.mit.edu/" />\r
        </Config>\r
        <Stages>\r
                <FetchSources></FetchSources>\r
index 6bad28bb4d320f5fad624200981a919aca971512..d7ca7a0c3abc28b343427cee443ff1df60cf8d8a 100644 (file)
                                                                                                                <TT>/vverbose&nbsp;&nbsp;&nbsp;&nbsp; very verbose output</TT><BR>\r
                                                                                                                <TT>/config path&nbsp; Path to config file</TT><BR>\r
                                                                                                                <TT>/logfile path Where to write output. If omitted, ...</TT><BR>\r
-                                                                                                               <TT>Other:</TT><BR>\r
+                                                                                                               <TT>/srcdir dir&nbsp;&nbsp; Source directory to use. Should contain\r
+                                                                                                                       <BR>\r
+                                                                                                                       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TT><TT>pismere/athena. \r
+                                                                                                                       If cvstag or svntag is null,\r
+                                                                                                                       <BR>\r
+                                                                                                                       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
+                                                                                                                       the directory should be prepopulated.\r
+                                                                                                                       <BR>\r
+                                                                                                               </TT><TT>/outdir dir&nbsp;&nbsp; Directory to be created where build results will \r
+                                                                                                                       go\r
+                                                                                                                       <BR>\r
+                                                                                                                       /repository checkout | co \ What repository action to take.\r
+                                                                                                                       <BR>\r
+                                                                                                                       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </TT><TT>update&nbsp;&nbsp; \r
+                                                                                                                       | up | Options are to checkout, update or<BR>\r
+                                                                                                                       &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;skip&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \r
+                                                                                                                       / take no action [skip].\r
+                                                                                                                       <BR>\r
+                                                                                                                       /cvstag tag&nbsp;&nbsp; \ For whichever of these tags is specified,\r
+                                                                                                                       <BR>\r
+                                                                                                               </TT><TT>/svntag url&nbsp;&nbsp; / the repository action will be done into srcdir\r
+                                                                                                                       <BR>\r
+                                                                                                                       /debug Do debug make instead of release make\r
+                                                                                                                       <BR>\r
+                                                                                                                       /nomake Skip make step\r
+                                                                                                                       <BR>\r
+                                                                                                                       /nopackage Skip packaging step\r
+                                                                                                                       <BR>\r
+                                                                                                                       /clean Build clean target\r
+                                                                                                                       <BR>\r
+                                                                                                                       /verbose Debug mode - verbose output\r
+                                                                                                                       <BR>\r
+                                                                                                                       /config path Path to config file\r
+                                                                                                                       <BR>\r
+                                                                                                                       /logfile path Where to write output. If omitted, ...<BR>\r
+                                                                                                               </TT><TT>Other:</TT><BR>\r
                                                                                                                <TT>NMAKE-options any options you want to pass to NMAKE, which can be:</TT><BR>\r
                                                                                                                <TT>(note: /nologo is always used)</TT><BR>\r
                                                                                                                <TT>[ nmake options follow ]</TT></P>\r
index 60ada43c3bccc541df529b41fd517baddf12f586..900d4ca44c13afd52ef459c52c9cc4ea90b230d2 100644 (file)
@@ -5,18 +5,16 @@ use FindBin;
 use File::Spec;\r
 use File::Basename;\r
 use lib "$FindBin::Bin/build/lib";\r
-#use Logger;\r
+use ActivePerl::PPM::Logger;\r
 use Getopt::Long;\r
 use Cwd;\r
 use XML::Simple;\r
 use Data::Dumper;\r
-use Archive::Zip qw( :ERROR_CODES :CONSTANTS );\r
-   \r
-# my $zip = Zip->new();\r
 \r
 my $BAIL;\r
 $0 = fileparse($0);\r
-my $OPT = { logfile => 'bkw.pl.log' };\r
+my $OPT = {foo => 'bar'};\r
+\r
 my $MAKE = 'NMAKE';\r
 \r
 sub get_info\r
@@ -41,10 +39,13 @@ Usage: $0 (-f --config) config-file [options] NMAKE-options
     /srcdir dir   Source directory to use.  Should contain \r
                   pismere/athena.  If cvstag or svntag is null, \r
                   the directory should be prepopulated.\r
-    /cvstag tag   \\ For whichever of these tags is specified,\r
-    /svntag url   / a checkout  will be done into srcdir\r
-    /debug        Do debug make instead of release make\r
     /outdir dir   Directory to be created where build results will go\r
+    /repository checkout | co \\  What repository action to take.\r
+               update   | up  ) Options are to checkout, update or \r
+               skip          /  take no action [skip].\r
+    /cvstag tag \\ For whichever of these tags is specified,\r
+    /svntag tag / the repository action will be done into srcdir\r
+    /debug        Do debug make instead of release make\r
     /nomake       Skip make step\r
     /nopackage    Skip packaging step\r
     /clean        Build clean target\r
@@ -95,6 +96,7 @@ sub main {
               'debug|d',\r
               'config|f:s',\r
               'logfile|l:s',\r
+              'repository:s',\r
               'clean',\r
               'verbose',\r
               'vverbose',\r
@@ -167,17 +169,19 @@ sub main {
        @prepackage     = $config->{Stages}->{PrePackage};\r
        @files                          = $config->{Stages}->{PrePackage}->{CopyList}->{Files};\r
 \r
-    # Update the config with overrides from the command line:\r
-       $tags[0]->{cvs}->{value} = $OPT->{cvstag}                                       if exists $OPT->{cvstag};\r
-       $tags[0]->{svn}->{value} = $OPT->{svnurl}                                       if exists $OPT->{svnurl};\r
-       $paths[0]->{src}->{path} = $OPT->{srcdir}                                       if exists $OPT->{srcdir};\r
-    $paths[0]->{out}->{path} = $OPT->{outdir}                          if exists $OPT->{outdir};\r
-    $switches[0]->{debug}->{value} = $OPT->{debug}     if exists $OPT->{debug};\r
-    $switches[0]->{clean}->{value} = 1                                                         if exists $OPT->{clean};\r
-    $switches[0]->{nomake}->{value} = 1                                                        if exists $OPT->{nomake};\r
-    $switches[0]->{nopackage}->{value} = 1                                             if exists $OPT->{nopackage};\r
-    $switches[0]->{verbose}->{value} = $OPT->{verbose}         if exists $OPT->{verbose};\r
-    $switches[0]->{vverbose}->{value} = $OPT->{verbose}        if exists $OPT->{vverbose};\r
+    # Update the configuration with overrides from the command line:\r
+       $tags[0]->{cvs}->{value} = $OPT->{cvstag}                                                               if exists $OPT->{cvstag};\r
+       $tags[0]->{svn}->{value} = $OPT->{svnurl}                                                               if exists $OPT->{svnurl};\r
+       $paths[0]->{src}->{path} = $OPT->{srcdir}                                                               if exists $OPT->{srcdir};\r
+    $paths[0]->{out}->{path} = $OPT->{outdir}                                                  if exists $OPT->{outdir};\r
+    $switches[0]->{debug}->{value} = $OPT->{debug}                             if exists $OPT->{debug};\r
+    $switches[0]->{clean}->{value} = 1                                                                                 if exists $OPT->{clean};\r
+    $switches[0]->{logfile}->{value} = 1                                                                                       if exists $OPT->{logfile};\r
+    $switches[0]->{repository}->{value} = $OPT->{repository}   if exists $OPT->{repository};\r
+    $switches[0]->{nomake}->{value} = 1                                                                                if exists $OPT->{nomake};\r
+    $switches[0]->{nopackage}->{value} = 1                                                                     if exists $OPT->{nopackage};\r
+    $switches[0]->{verbose}->{value} = $OPT->{verbose}                 if exists $OPT->{verbose};\r
+    $switches[0]->{vverbose}->{value} = $OPT->{verbose}                if exists $OPT->{vverbose};\r
        if (exists $OPT->{logfile}) {\r
                $switches[0]->{log}->{path} = $OPT->{logfile};\r
                $switches[0]->{log}->{value} = 1;\r
@@ -213,41 +217,66 @@ sub main {
 ##-- Assemble configuration from config file and command line.\r
 \r
 # Begin logging:\r
-#    my $l;\r
-#    if ($OPT->{logfile}) {\r
+    my $l;\r
+    if ($OPT->{logfile}) {\r
 #              $l = new Logger $OPT->{logfile} or die "Fatal -- Can't create Logger.";\r
 #              $l->start;\r
-#              }\r
-\r
-if (!$switches[0]->{nomake}->{value}) {\r
-       if ($verbose) {print "Info -- *** Begin fetching sources.\n";}\r
-       \r
-       my ($wd, $result);\r
-       $wd = $paths[0]->{src}->{path};\r
-       chdir($wd) or die "Fatal -- couldn't chdir to $wd\n";\r
-       if ($verbose) {print "Info -- chdir to $wd\n";}\r
-       \r
-       #if (! -d "pismere")                                    {print "Warning -- can't find pismere in $wd.  It will be created.\n";}\r
-       #if (! -d "pismere\\athena")    {print "Warning -- can't find pismere\\athena in $wd.  It will be created.\n";}\r
-       \r
-       if ($tags[0]->{cvs}->{value})           {\r
-               # Set up cvs environment variables:\r
-               print "Warning -- cvs checkout skipped for now.\n";\r
-       #       system("cvs checkout krb") or die "Fatal -- checkout of cvs source failed; return code $?\n";\r
                }\r
-       else    {print "Info -- cvs tag not specified; no cvs sources will be checked out.\n";}\r
+\r
+##++ Begin repository action:\r
+       my $sw = $switches[0]->{repository}->{value};\r
+       my $rverb;\r
+       if ($sw =~ /skip/i)                             {print "Info -- Skipping repository access.\n";}\r
+       elsif ($sw =~ /update/i)                {$rverb = "update";}\r
+       elsif ($sw =~ /up/i)                            {$rverb = "update";}\r
+       elsif ($sw =~ /checkout/i)      {$rverb = "checkout";}\r
+       elsif ($sw =~ /co/i)                            {$rverb = "checkout";}\r
+       else {\r
+                       print "Fatal -- invalid /repository value.\n";\r
+                       usage();\r
+                       die;\r
+                       }\r
+\r
+       my $wd  = $paths[0]->{src}->{path}."\\pismere";\r
        \r
-       if ($tags[0]->{svn}->{value})   {\r
-               # Set up svn environment variables:\r
-               print "Warning -- svn checkout skipped for now.\n";\r
-       #       system("svn checkout krb") or die "Fatal -- checkout of svn source failed; return code $?\n";\r
+       if ($rverb) {\r
+               if ($verbose) {print "Info -- *** Begin fetching sources.\n";}\r
+\r
+               my $krb5dir     = $wd."\\athena\\auth\\krb5";\r
+\r
+               # If we are fetching into a new directory, the directory structure won't exist and many cd commands will fail.\r
+               # Use an xcopy to create the directory paths we will need:\r
+               !system("echo tempfile > kpk.tmp") or die "Fatal -- Couldn't creqte a simple temp file.\n";\r
+               !system("echo F | xcopy /y kpk.tmp $krb5dir") or die "Fatal -- Couldn't create path $krb5dir\n";\r
+               !system("del kpk.tmp") or die "Fatal -- Couldn't clean up temporary file.\n";\r
+               \r
+               chdir("$wd") or die "Fatal -- couldn't chdir to $wd\n";\r
+               if ($verbose) {print "Info -- chdir to $wd\n";}\r
+               \r
+               #if (! -d "pismere")                                    {print "Warning -- can't find pismere in $wd.  It will be created.\n";}\r
+               if (! -d "athena")      {print "Warning -- can't find pismere\\athena in $wd.  It will be created.\n";}\r
+               \r
+               # [TODO] Set up cvs environment variables:\r
+               my $cvscmd = "cvs $rverb ";\r
+               if ($tags[0]->{cvs}->{value}) {$cvscmd .= $tags[0]->{cvs}->{value};}\r
+               !system($cvscmd) or die "Fatal -- command \"$cvscmd\" failed; return code $?\n";\r
+               \r
+               # [TODO] Set up svn environment variables:\r
+               chdir("$krb5dir") or die "Fatal -- couldn't chdir to $krb5dir\n";\r
+               if ($verbose) {print "Info -- chdir to $krb5dir\n";}\r
+               my $svncmd = "svn $rverb ";\r
+               if ($tags[0]->{svn}->{value}) {$svncmd .= $tags[0]->{svn}->{value};}\r
+               !system($svncmd) or die "Fatal -- command \"$svncmd\" failed; return code $?\n";\r
+               \r
+               if ($verbose) {print "Info -- ***   End fetching sources.\n";}\r
                }\r
-       else    {print "Info -- svn tag not specified; no svn sources will be checked out.\n";}\r
-       \r
-       if ($verbose) {print "Info -- ***   End fetching sources.\n";}\r
+##-- End  repository action.\r
        \r
        if ($verbose) {print "Info -- *** Begin preparing for build.\n";}\r
-       \r
+       $wd = $paths[0]->{src}->{path};\r
+       chdir("$wd") or die "Fatal -- couldn't chdir to $wd\n";\r
+       if ($verbose) {print "Info -- chdir to $wd\n";}\r
+\r
        my ($path, $destpath);\r
        \r
        # Copy athena\scripts\site\graft\krb5\Makefile.src to athena\auth\krb5:\r
@@ -267,135 +296,145 @@ if (!$switches[0]->{nomake}->{value}) {
        \r
        if ($verbose) {print "Info -- ***   End preparing for build.\n";}\r
        \r
-       my ($buildtarget, $buildtext);\r
-       if ($switches[0]->{clean}->{value}) {\r
-               $buildtarget = "clean" ;\r
-               $buildtext = " clean."\r
-               }\r
-       else {\r
-               $buildtarget = "" ;\r
-               $buildtext = "."\r
-               }\r
-       if ($verbose) {print "Info -- *** Begin build".$buildtext."\n";}\r
-       \r
-       chdir("pismere/athena") or die "Fatal -- couldn't chdir to source directory $wd\\pismere\\athena\n";\r
-       if ($verbose) {print "Info -- chdir to $wd\\pismere\\athena\n";}\r
-               !system("perl ../scripts/build.pl --softdirs $buildtarget")     or die "Fatal -- build $buildtarget failed.";\r
+       if (!$switches[0]->{nomake}->{value}) {\r
+               my ($buildtarget, $buildtext);\r
+               if ($switches[0]->{clean}->{value}) {\r
+                       $buildtarget = "clean" ;\r
+                       $buildtext = " clean."\r
+                       }\r
+               else {\r
+                       $buildtarget = "" ;\r
+                       $buildtext = "."\r
+                       }\r
+               if ($verbose) {print "Info -- *** Begin build".$buildtext."\n";}\r
                \r
-       chdir("..") or die "Fatal -- couldn't chdir to $wd\\pismere.";\r
-       if ($switches[0]->{clean}->{value}) {\r
-               if (-d "staging") {\r
-                       !system("rm -rf staging") or die "Fatal -- Couldn't remove pismere/staging.";\r
+               chdir("pismere/athena") or die "Fatal -- couldn't chdir to source directory $wd\\pismere\\athena\n";\r
+               if ($verbose) {print "Info -- chdir to $wd\\pismere\\athena\n";}\r
+                       !system("perl ../scripts/build.pl --softdirs $buildtarget")     or die "Fatal -- build $buildtarget failed.";\r
+                       \r
+               chdir("..") or die "Fatal -- couldn't chdir to $wd\\pismere.";\r
+               if ($switches[0]->{clean}->{value}) {\r
+                       if (-d "staging") {\r
+                               !system("rm -rf staging") or die "Fatal -- Couldn't remove pismere/staging.";\r
+                               }\r
                        }\r
-               }\r
-\r
-       if ($verbose) {print "Info -- ***   End build".$buildtext."\n";}\r
-       }                               ## End make conditional.\r
        \r
-if (!$switches[0]->{nopackage}->{value}) {\r
-       if ($verbose) {print "Info -- *** Begin prepackage.\n";}\r
+               if ($verbose) {print "Info -- ***   End build".$buildtext."\n";}\r
+               }                               ## End make conditional.\r
        \r
-       # The build results are copied to a staging area, where the packager expects to find them.\r
-       #  We put the staging area in the fixed area .../pismere/staging.\r
-       $wd = $paths[0]->{src}->{path}."\\pismere";\r
-       my $staging_area = "$wd\\staging";\r
-       chdir($wd) or die "Fatal -- couldn't chdir to $wd\n";\r
-       if ($verbose) {print "Info -- chdir to $wd\n";}\r
-       (-e $staging_area) or makeDir($staging_area);\r
+       if (!$switches[0]->{nopackage}->{value}) {\r
+               if ($verbose) {print "Info -- *** Begin prepackage.\n";}\r
+               \r
+               # The build results are copied to a staging area, where the packager expects to find them.\r
+               #  We put the staging area in the fixed area .../pismere/staging.\r
+               $wd = $paths[0]->{src}->{path}."\\pismere";\r
+               my $staging_area = "$wd\\staging";\r
+               chdir($wd) or die "Fatal -- couldn't chdir to $wd\n";\r
+               if ($verbose) {print "Info -- chdir to $wd\n";}\r
+               (-e $staging_area) or makeDir($staging_area);\r
+               \r
+               my $src = $paths[0]->{src}->{path};\r
+               my $CopyList                    = $prepackage[0]->{CopyList};\r
+               \r
+               # A path can contain a variable part, which will be handled here.  If the variable part is \r
+               # the Always or BuildDependent tag, then the variable will be changed to the \r
+               # build-type-dependent PathFragment.\r
+               # If the variable part is the IgnoreTag, then the file will not be copied.\r
+               my ($PathFragment, $BuildDependentTag, $IgnoreTag); \r
        \r
-       my $src = $paths[0]->{src}->{path};\r
-       my $CopyList                    = $prepackage[0]->{CopyList};\r
+               my $AlwaysTag                           = $CopyList->{Config}->{AlwaysTag}->{value};\r
+               if ($switches[0]->{debug}->{value}) {           ## Debug build tags:\r
+                       $PathFragment                           = $CopyList->{Config}->{DebugArea}->{value};\r
+                       $BuildDependentTag      = $CopyList->{Config}->{DebugTag}->{value};\r
+                       $IgnoreTag                                      = $CopyList->{Config}->{ReleaseTag}->{value};\r
+                       }\r
+               else {                                                                                                                          ## Release build tags:\r
+                       $PathFragment                           = $CopyList->{Config}->{ReleaseArea}->{value};\r
+                       $BuildDependentTag      = $CopyList->{Config}->{ReleaseTag}->{value};\r
+                       $IgnoreTag                                      = $CopyList->{Config}->{DebugTag}->{value};\r
+                       }                       \r
        \r
-       # A path can contain a variable part, which will be handled here.  If the variable part is \r
-       # the Always or BuildDependent tag, then the variable will be changed to the \r
-       # build-type-dependent PathFragment.\r
-       # If the variable part is the IgnoreTag, then the file will not be copied.\r
-       my ($PathFragment, $BuildDependentTag, $IgnoreTag); \r
-\r
-       my $AlwaysTag                           = $CopyList->{Config}->{AlwaysTag}->{value};\r
-       if ($switches[0]->{debug}->{value}) {           ## Debug build tags:\r
-               $PathFragment                           = $CopyList->{Config}->{DebugArea}->{value};\r
-               $BuildDependentTag      = $CopyList->{Config}->{DebugTag}->{value};\r
-               $IgnoreTag                                      = $CopyList->{Config}->{ReleaseTag}->{value};\r
-               }\r
-       else {                                                                                                                          ## Release build tags:\r
-               $PathFragment                           = $CopyList->{Config}->{ReleaseArea}->{value};\r
-               $BuildDependentTag      = $CopyList->{Config}->{ReleaseTag}->{value};\r
-               $IgnoreTag                                      = $CopyList->{Config}->{DebugTag}->{value};\r
-               }                       \r
-\r
-       # Copy all the files in the CopyList:\r
-       $i = 0;\r
-       my $nfiles = 0;\r
-       while ($files[0]->{File}[$i]) {\r
-               my ($name, $newname, $from, $to, $ignore);\r
-               $name           = $files[0]->{File}->[$i]->{name};\r
-               if (exists $files[0]->{File}->[$i]->{newname})  {$newname = $files[0]->{File}->[$i]->{newname};}\r
-               else                                                                                                                                                            {$newname = $name;}\r
-               if ($name) {\r
-                       $ignore = 0;\r
-                       $from   = "$src\\pismere\\athena\\$files[0]->{File}->[$i]->{from}\\$name";\r
-                       $to             = "$src\\pismere\\staging\\$files[0]->{File}->[$i]->{to}\\$newname";\r
-                       if (index($from.$to, $IgnoreTag) <0) {                                  ## Test for IgnoreTag\r
-                               # Apply PathTag substitutions:\r
-                               $from   =~ s/$AlwaysTag/$PathFragment/g;\r
-                               $to             =~ s/$AlwaysTag/$PathFragment/g;\r
-                               $from   =~ s/$BuildDependentTag/$PathFragment/g;\r
-                               $to             =~ s/$BuildDependentTag/$PathFragment/g;\r
-                               # We use xcopy instead of copy because it will create directories for us:\r
-                               if (system("echo F | xcopy /D /F /Y $from $to 2>NUL") != 0) {\r
-                                       # xcopy failed.  \r
-                                       if (!exists $files[0]->{File}->[$i]->{notrequired}) {\r
-                                               ( -e $from) or die "Fatal -- can't find $from";\r
-                                               die "Fatal -- Copy of $from to $to failed";\r
+               # Copy all the files in the CopyList:\r
+               $i = 0;\r
+               my $nfiles                      = 0;\r
+               my $bOldDot     = 1;\r
+               my $bDot                        = 0;\r
+               while ($files[0]->{File}[$i]) {\r
+                       my ($name, $newname, $from, $to, $ignore);\r
+                       $name           = $files[0]->{File}->[$i]->{name};\r
+                       if (exists $files[0]->{File}->[$i]->{newname})  {$newname = $files[0]->{File}->[$i]->{newname};}\r
+                       else                                                                                                                                                            {$newname = $name;}\r
+                       if ($name) {\r
+                               $ignore = 0;\r
+                               $from   = "$src\\pismere\\athena\\$files[0]->{File}->[$i]->{from}\\$name";\r
+                               $to             = "$src\\pismere\\staging\\$files[0]->{File}->[$i]->{to}\\$newname";\r
+                               if (index($from.$to, $IgnoreTag) <0) {                                  ## Test for IgnoreTag\r
+                                       # Apply PathTag substitutions:\r
+                                       $from   =~ s/$AlwaysTag/$PathFragment/g;\r
+                                       $to             =~ s/$AlwaysTag/$PathFragment/g;\r
+                                       $from   =~ s/$BuildDependentTag/$PathFragment/g;\r
+                                       $to             =~ s/$BuildDependentTag/$PathFragment/g;\r
+                                       # We use xcopy instead of copy because it will create directories for us:\r
+                                       if (system("echo F | xcopy /D /F /Y $from $to > a.tmp 2>NUL") != 0) {\r
+                                               # xcopy failed.  \r
+                                               if (!exists $files[0]->{File}->[$i]->{notrequired}) {\r
+                                                       ( -e $from) or die "Fatal -- can't find $from";\r
+                                                       die "Fatal -- Copy of $from to $to failed";\r
+                                                       }\r
+                                               }\r
+                                       else {          ## To show progress when files aren't copied, print a string of dots.\r
+                                               open(MYINPUTFILE, "<a.tmp");\r
+                                               my(@lines) = <MYINPUTFILE>;\r
+                                               foreach $line (@lines) { \r
+                                                       $bDot = ($line =~ /^0/);\r
+                                                       }\r
+                                               close(MYINPUTFILE);\r
+                                               if (!$bDot && $bOldDot) {print "\n";}\r
+                                               if ($bDot) {print ".";}\r
+                                               else {print "$from copied to $to\n";}\r
+                                               $bOldDot = $bDot;\r
                                                }\r
                                        }\r
-                               else {$nfiles++;}\r
                                }\r
+                       $i++;\r
                        }\r
-               $i++;\r
-               }\r
+               if ($bDot) {print "\n";}\r
+                       \r
+#              # Copy the extras:\r
+#              print "Info -- Absent a way of scripting unzip, the instructions require manually unzipping into\n";\r
+#              print "        the target area $src\\pismere\\staging.\n";\r
+#              # my $extradir = $paths[0]->{extras}->{path};\r
+#              # !system("xcopy /d/f/y/s $src\\pismere\\athena\\$extradir\\* $src\\pismere\\staging") or die "Fatal -- Couldn't copy extras from $src\\pismere\\athena\\$extradir";\r
+               \r
+               chdir("staging\\install\\wix") or die "Fatal -- Couldn't cd to $wd\\staging\\install\\wix";\r
                \r
-       # Copy the extras:\r
-       print "Info -- Absent a way of scripting unzip, the instructions require manually unzipping into\n";\r
-       print "        the target area $src\\pismere\\staging.\n";\r
-       # my $extradir = $paths[0]->{extras}->{path};\r
-       # !system("xcopy /d/f/y/s $src\\pismere\\athena\\$extradir\\* $src\\pismere\\staging") or die "Fatal -- Couldn't copy extras from $src\\pismere\\athena\\$extradir";\r
+               # Correct errors in files.wxi:\r
+               !system("sed 's/WorkingDirectory=\"\\[dirbin\\]\"/WorkingDirectory=\"dirbin\"/g' files.wxi > a.tmp") or die "Fatal -- Couldn't modify files.wxi.";\r
+               !system("copy /y a.tmp files.wxi") or die "Fatal -- Couldn't update files.wxi.";\r
+               !system("del a.tmp") or print "Warning -- Couldn't clean up temporary file $wd\\staging\\installer\\wix\\a.tmp.\n";\r
+                       \r
+               # Update paths in site-local.wxi:\r
+               my $dblback_originalDir = $originalDir;\r
+               $dblback_originalDir =~ s/\\/\\\\/g;\r
+               !system("sed -f $dblback_originalDir\\site-local.sed site-local.wxi > b.tmp") or die "Fatal -- Couldn't modify site-local.wxi.";\r
+               my $hexback_wd = $wd;\r
+               $hexback_wd =~ s/\\/\\\\\\\\\\\\/g;\r
+               !system("sed 's/%%TARGETDIR%%/$hexback_wd\\\\\\staging\\\\\\/' b.tmp > c.tmp") or die "Fatal -- Couldn't modify site-local.wxi temporary file.";        \r
+               !system("sed 's/%%CONFIGDIR%%/$hexback_wd\\\\\\staging\\\\\\sample\\\\\\/' c.tmp > d.tmp") or die "Fatal -- Couldn't modify site-local.wxi temporary file.";    \r
+               !system("copy /y d.tmp site-local.wxi") or die "Fatal -- Couldn't replace site-local.wxi.";\r
        \r
-       chdir("staging\\install\\wix") or die "Fatal -- Couldn't cd to $wd\\staging\\install\\wix";\r
+               # Copy krb.conf from ...\athena\auth\krb5\src\config-files      to pismere\staging\samples\krb5.ini:\r
+               !system("echo F | xcopy /D $wd\\athena\\auth\\krb5\\src\\config-files\\krb5.conf $wd\\staging\\sample\\krb5.ini") \r
+                       or die "Fatal -- Couldn't update $wd\\staging\\sample\\krb5.ini.";\r
        \r
-       # Correct errors in files.wxi:\r
-       !system("sed 's/WorkingDirectory=\"\\[dirbin\\]\"/WorkingDirectory=\"dirbin\"/g' files.wxi > a.tmp") or die "Fatal -- Couldn't modify files.wxi.";\r
-       !system("copy /y a.tmp files.wxi") or die "Fatal -- Couldn't update files.wxi.";\r
-       !system("del a.tmp") or print "Warning -- Couldn't clean up temporary file $wd\\staging\\installer\\wix\\a.tmp.\n";\r
+               if ($verbose) {print "Info -- ***   End prepackage.\n";}\r
                \r
-       # Update paths in site-local.wxi:\r
-       my $dblback_originalDir = $originalDir;\r
-       $dblback_originalDir =~ s/\\/\\\\/g;\r
-       !system("sed -f $dblback_originalDir\\site-local.sed site-local.wxi > b.tmp") or die "Fatal -- Couldn't modify site-local.wxi.";\r
-       my $hexback_wd = $wd;\r
-       $hexback_wd =~ s/\\/\\\\\\\\\\\\/g;\r
-       !system("sed 's/%%TARGETDIR%%/$hexback_wd\\\\\\staging\\\\\\/' b.tmp > c.tmp") or die "Fatal -- Couldn't modify site-local.wxi temporary file.";        \r
-       !system("sed 's/%%CONFIGDIR%%/$hexback_wd\\\\\\staging\\\\\\sample\\\\\\/' c.tmp > d.tmp") or die "Fatal -- Couldn't modify site-local.wxi temporary file.";    \r
-       !system("copy /y d.tmp site-local.wxi") or die "Fatal -- Couldn't replace site-local.wxi.";\r
-\r
-       # Copy krb.conf from ...\athena\auth\krb5\src\config-files      to pismere\staging\samples\krb5.ini:\r
-       !system("echo F | xcopy /D $wd\\athena\\auth\\krb5\\src\\config-files\\krb5.conf $wd\\staging\\sample\\krb5.ini") \r
-               or die "Fatal -- Couldn't update $wd\\staging\\sample\\krb5.ini.";\r
-\r
-       # Sam said to leave these files out, but it is faster to copy them now \r
-       #  than to figure out how to modify the wix configs to ignore them:\r
-       !system("echo F | xcopy /D $wd\\staging\\kfw-2.5-extra\\sample-config\\*.con $wd\\staging\\sample") \r
-               or die "Fatal -- Couldn't copy $wd\\staging\\kfw-2.5-extra\\sample-config\\*.con.";\r
-\r
-       if ($verbose) {print "Info -- ***   End prepackage.\n";}\r
+               # Make the msi:\r
+               !system("nmake") or die "Fatal -- Couldn't make kfw.msi.";\r
        \r
-       # Make the msi:\r
-       !system("nmake") or die "Fatal -- Couldn't make kfw.msi.";\r
-\r
-       if ($verbose) {print "Info -- *** Begin package.\n";}\r
-       if ($verbose) {print "Info -- ***   End package.\n";}\r
-       }                                               ## End package conditional.\r
+               if ($verbose) {print "Info -- *** Begin package.\n";}\r
+               if ($verbose) {print "Info -- ***   End package.\n";}\r
+               }                                               ## End package conditional.\r
        \r
 #End logging:\r
 #    if (!$OPT->{nolog}) {\r
@@ -403,10 +442,9 @@ if (!$switches[0]->{nopackage}->{value}) {
 #              }\r
 \r
     return $errorState;\r
-}\r
+       }                                                       ## End subroutine main.\r
 \r
 $SIG{'INT'} = \&handler;\r
 $SIG{'QUIT'} = \&handler;\r
 \r
-##exit (0);\r
 exit(main());
\ No newline at end of file
index 72480a94ccacacfa4304290d3a092ab78e639697..7dd2f0b9d1c21683950e1048dfd5cccb70100da7 100644 (file)
             
         <?ifdef OldHelp?>
             <ComponentRef Id="cmf_leash32_hlp" />
-        <?else?>
-            <ComponentRef Id="cmf_leash32_chm" />
+<!--        <?else?>
+            <ComponentRef Id="cmf_leash32_chm" />      -->
         <?endif?>
             <ComponentRef Id="cmf_leashw32_dll" />
             
                 <?endif?>
             <?endif?>
         <?endif?>
-            <ComponentRef Id="cmf_krb5_ini" />
+<!--            <ComponentRef Id="cmf_krb5_ini" />
             <ComponentRef Id="cmf_krb_con" />
-            <ComponentRef Id="cmf_krbrealm_con" />
+            <ComponentRef Id="cmf_krbrealm_con" />     -->
             
             <ComponentRef Id="rcm_common" />
             <ComponentRef Id="rcm_client" />
index 5fc09663180c470d10137cb8ccf71b5d8668a8e4..ee46a07366ad8a91a7fb728889160936f3ea3c5b 100644 (file)
                            <File Id="fil_leash32_hlp" LongName="leash32.hlp" Name="leash32.hlp" KeyPath="yes" />
                     </Component>
                 <?else?>
-                    <Component Id="cmf_leash32_chm" Guid="C50E5E0A-B822-4419-855B-1713637BCA6A" DiskId="1">
+<!--                    <Component Id="cmf_leash32_chm" Guid="C50E5E0A-B822-4419-855B-1713637BCA6A" DiskId="1">
                            <File Id="fil_leash32_chm" LongName="leash32.chm" Name="leash32.chm" KeyPath="yes" />
-                    </Component>
+                    </Component>       -->
                 <?endif?>
                     <Component Id="cmf_leashw32_dll" Guid="8C145D48-A2FC-4C28-BC05-4368545F1184" DiskId="1">
                            <File Id="fil_leashw32_dll" LongName="leashw32.dll" Name="leashw32.dll" KeyPath="yes" />
         </Directory> <!-- /MIT -->
     </Directory> <!-- /Program Files -->
     <Directory Id="WindowsFolder">
-        <Component Id="cmf_krb5_ini" Guid="C1AF0670-BBF1-4AA6-B2A6-6C8B1584A1F4" NeverOverwrite="yes" Permanent="yes" DiskId="1">
+<!--        <Component Id="cmf_krb5_ini" Guid="C1AF0670-BBF1-4AA6-B2A6-6C8B1584A1F4" NeverOverwrite="yes" Permanent="yes" DiskId="1">
                <File Id="fil_krb5_ini" LongName="krb5.ini" Name="krb5.ini" src="$(var.ConfigDir)krb5.ini" KeyPath="yes" />
         </Component>
         <Component Id="cmf_krb_con" Guid="5E91A051-CF14-45FF-BF64-CEE78A7A90C2" NeverOverwrite="yes" Permanent="yes" DiskId="1">
         </Component>
         <Component Id="cmf_krbrealm_con" Guid="D667B54F-1C98-43FB-87C6-0F0517623B90" NeverOverwrite="yes" Permanent="yes" DiskId="1">
                <File Id="fil_krbrealm_con" LongName="krbrealm.con" Name="krbrealm.con" src="$(var.ConfigDir)krbrealm.con" KeyPath="yes" />
-        </Component>
+        </Component>   -->
     </Directory>
     
     <Directory Id="ProgramMenuFolder">