From d2538fba2160d81ed76482cc0d961e3d85a91f54 Mon Sep 17 00:00:00 2001 From: Kevin Koch Date: Sun, 1 Apr 2007 03:28:07 +0000 Subject: [PATCH] Correct directory structure in zip files Make main config file match today's usage & implementation wrt /sign. Clean staging area before using it. Just clean output area instead of removing it. Clean ziptemp area after each zip. Target_Version: 1.6.1 Ticket: 5490 Tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19370 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/build/BKWconfig.xml | 9 +++++---- src/windows/build/bkw.pl | 25 ++++++++++++------------- src/windows/build/makeZip.pl | 2 +- src/windows/build/signFiles.pl | 2 +- src/windows/build/srcfiles.xml | 13 ------------- 5 files changed, 19 insertions(+), 32 deletions(-) delete mode 100644 src/windows/build/srcfiles.xml diff --git a/src/windows/build/BKWconfig.xml b/src/windows/build/BKWconfig.xml index 111aaa601..37c1a5c43 100644 --- a/src/windows/build/BKWconfig.xml +++ b/src/windows/build/BKWconfig.xml @@ -21,7 +21,7 @@ - + @@ -144,10 +144,11 @@ - - - + + + + diff --git a/src/windows/build/bkw.pl b/src/windows/build/bkw.pl index 95b7dc12b..7c25399aa 100644 --- a/src/windows/build/bkw.pl +++ b/src/windows/build/bkw.pl @@ -465,9 +465,11 @@ print Dumper($prunes); # We put the staging area in the fixed area .../pismere/staging. my $prepackage = $config->{Stages}->{PrePackage}; my $staging = "$wd\\staging"; - chdir($wd) or die "Fatal -- couldn't chdir to $wd\n"; - if ($verbose) {print "Info -- chdir to $wd\n";} - (-e $staging) or mkdir($staging); + chdir($wd) or die "Fatal -- couldn't chdir to $wd\n"; + print "Info -- chdir to ".`cd`."\n" if ($verbose); + !system("rm -rf $staging/*") or die "Fatal -- Couldn't clean $staging."; + !system("rmdir $staging") or die "Fatal -- Couldn't remove $staging."; + mkdir($staging) or die "Fatal -- Couldn't create $staging."; # Force Where From and To are relative to: $prepackage->{CopyList}->{Config}->{From}->{root} = "$wd\\athena"; @@ -550,22 +552,19 @@ print Dumper($prunes); # Begin packaging extra items: chdir($src); # Now in . print "Info -- chdir to ".`cd`."\n" if ($verbose); - system("rm -rf $out") if (-d $out); - die "Fatal -- Couldn't remove $out." if (-d $out); - mkdir($out); + if (-d $out) {!system("rm -rf $out/*") or die "Fatal -- Couldn't clean $out."} ## Clean output directory. + else {mkdir($out);} my $zipsXML = $config->{Stages}->{PostPackage}->{Zips}; local $i = 0; while ($zipsXML->{Zip}[$i]) { local $zip = $zipsXML->{Zip}[$i]; - makeZip($zip, $config) if (exists $zip->{name}); ## Ignore dummy entry. + makeZip($zip, $config) if (exists $zip->{name}); ## Ignore dummy entry. + chdir("$out"); + print "Info -- chdir to ".`cd`."\n" if ($verbose); + system("rm -rf ziptemp") if (-d "ziptemp"); ## Clean up any temp directory. $i++; - } ## End zip in xml. - - $ziptemp = "$out\\ziptemp"; ## Clean up any temp directory. - chdir("$out"); - print "Info -- chdir to ".`cd`."\n" if ($verbose); - system("rm -rf $ziptemp") if (-d $ziptemp); + } ## End zip in xml. $config->{Stages}->{PostPackage}->{CopyList}->{Config} = $config->{Stages}->{PostPackage}->{Config}; ## Use the post package config. $config->{Stages}->{PostPackage}->{CopyList}->{Config}->{From}->{root} = "$src\\pismere"; diff --git a/src/windows/build/makeZip.pl b/src/windows/build/makeZip.pl index e54f5a831..a805b7453 100644 --- a/src/windows/build/makeZip.pl +++ b/src/windows/build/makeZip.pl @@ -57,7 +57,7 @@ sub makeZip { # because the CopyList's Config might contain substitution tags. $zip->{CopyList}->{Config}->{FileStem}->{name} = $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name}; $zip->{CopyList}->{Config}->{From}->{root} = "$src\\pismere"; ## Add zip-specific config settings. - $zip->{CopyList}->{Config}->{To}->{root} = "$ziptemp\\$zip->{topdir}"; + $zip->{CopyList}->{Config}->{To}->{root} = $ziptemp; copyFiles($zip->{CopyList}, $config); # Drop down into /ziptemp so the path to the added file won't include : chdir $ziptemp; diff --git a/src/windows/build/signFiles.pl b/src/windows/build/signFiles.pl index 058eff2a4..d2ffb2c0e 100644 --- a/src/windows/build/signFiles.pl +++ b/src/windows/build/signFiles.pl @@ -18,7 +18,7 @@ sub signFiles { local $template2 = $template; $template2 =~ s/%filename%/$target/; print "Info -- Signing $target\n" if ($verbose); - !system($template2) or die "Fatal -- Error signing $target."; + !system("$template2") or die "Fatal -- Error signing $target."; } } $ENV{PATH} = $savedPATH; diff --git a/src/windows/build/srcfiles.xml b/src/windows/build/srcfiles.xml deleted file mode 100644 index 58b58af55..000000000 --- a/src/windows/build/srcfiles.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file -- 2.26.2