\r
Options:\r
/help /? usage information (what you now see).\r
- /config /c path Path to config file.\r
+ /config /f path Path to config file.\r
/srcdir /r dir Source directory to use. Should contain \r
pismere/athena. If cvstag or svntag is null, \r
the directory should be prepopulated.\r
}\r
if ($verbose) {print "Info -- svn command: $svncmd\n";}\r
!system($svncmd) or die "Fatal -- command \"$svncmd\" failed; return code $?\n";\r
-\r
- ##++ Read in the version information to be able to update the \r
- # site-local files in the install build areas.\r
- # ** Do this now (after repository update and before first zip) \r
- # because making zip files requires some configuration data be set up.\r
- local $version_path = $config->{Stages}->{Package}->{Config}->{Paths}->{Versions}->{path};\r
- open(DAT, "$src/$version_path") or die "Could not open $version_path.";\r
- @raw = <DAT>;\r
- close DAT;\r
- foreach $line (@raw) {\r
- chomp $line;\r
- if ($line =~ /#define/) { # Process #define lines:\r
- $line =~ s/#define//; # Remove #define token\r
- $line =~ s/^\s+//; # and leading & trailing whitespace\r
- $line =~ s/\s+$//;\r
- local @qr = split("\"", $line); # Try splitting with quotes\r
- if (exists $qr[1]) {\r
- $qr[0] =~ s/^\s+//; # Clean up whitespace\r
- $qr[0] =~ s/\s+$//;\r
- $config->{Versions}->{$qr[0]} = $qr[1]; # Save string\r
- }\r
- else { # No quotes, so\r
- local @ar = split(" ", $line); # split with space\r
- $ar[0] =~ s/^\s+//; # Clean up whitespace\r
- $ar[0] =~ s/\s+$//;\r
- $config->{Versions}->{$ar[0]} = $ar[1]; # and save numeric value\r
- }\r
+ if ($verbose) {print "Info -- *** End fetching sources.\n";}\r
+ }\r
+##-- End repository action.\r
+ \r
+ ##++ Read in the version information to be able to update the \r
+ # site-local files in the install build areas.\r
+ # ** Do this now (after repository update and before first zip) \r
+ # because making zip files requires some configuration data be set up.\r
+ local $version_path = $config->{Stages}->{Package}->{Config}->{Paths}->{Versions}->{path};\r
+ open(DAT, "$src/$version_path") or die "Could not open $version_path.";\r
+ @raw = <DAT>;\r
+ close DAT;\r
+ foreach $line (@raw) {\r
+ chomp $line;\r
+ if ($line =~ /#define/) { # Process #define lines:\r
+ $line =~ s/#define//; # Remove #define token\r
+ $line =~ s/^\s+//; # and leading & trailing whitespace\r
+ $line =~ s/\s+$//;\r
+ local @qr = split("\"", $line); # Try splitting with quotes\r
+ if (exists $qr[1]) {\r
+ $qr[0] =~ s/^\s+//; # Clean up whitespace\r
+ $qr[0] =~ s/\s+$//;\r
+ $config->{Versions}->{$qr[0]} = $qr[1]; # Save string\r
}\r
- }\r
- \r
- # Check that the versions we will need for site-local have been defined:\r
- my @required_versions = ('VER_PROD_MAJOR', 'VER_PROD_MINOR', 'VER_PROD_REV', \r
- 'VER_PROD_MAJOR_STR', 'VER_PROD_MINOR_STR', 'VER_PROD_REV_STR', \r
- 'VER_PRODUCTNAME_STR');\r
- $requirements_met = 1;\r
- $first_missing = 0;\r
- $error_list = "";\r
- foreach my $required (@required_versions) {\r
- if (! exists $config->{Versions}->{$required}) {\r
- $requirements_met = 0;\r
- if (!$first_missing) {\r
- $first_missing = 1;\r
- $error_list = "Fatal -- The following version(s) are not defined in $src/$version_path.\n";\r
- }\r
- $error_list .= "$required\n";\r
+ else { # No quotes, so\r
+ local @ar = split(" ", $line); # split with space\r
+ $ar[0] =~ s/^\s+//; # Clean up whitespace\r
+ $ar[0] =~ s/\s+$//;\r
+ $config->{Versions}->{$ar[0]} = $ar[1]; # and save numeric value\r
}\r
}\r
- if (!$requirements_met) {\r
- print $error_list;\r
- exit(0);\r
- }\r
+ }\r
\r
- # Apply any of these tags to filestem:\r
- my $filestem = $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name};\r
- $filestem =~ s/%VERSION_MAJOR%/$config->{Versions}->{'VER_PROD_MAJOR_STR'}/;\r
- $filestem =~ s/%VERSION_MINOR%/$config->{Versions}->{'VER_PROD_MINOR_STR'}/;\r
- $filestem =~ s/%VERSION_PATCH%/$config->{Versions}->{'VER_PROD_REV_STR'}/;\r
- $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name} = $filestem;\r
- ##-- Read in the version information & set config info.\r
-\r
- if ($rverb =~ /checkout/) { \r
- if (! $bOutputCleaned) { ## In case somebody cleaned $out before us.\r
- if (-d $out) {!system("rm -rf $out/*") or die "Fatal -- Couldn't clean $out."} ## Clean output directory.\r
- else {mkdir($out);}\r
- $bOutputCleaned = 1;\r
+ # Check that the versions we will need for site-local have been defined:\r
+ my @required_versions = ('VER_PROD_MAJOR', 'VER_PROD_MINOR', 'VER_PROD_REV', \r
+ 'VER_PROD_MAJOR_STR', 'VER_PROD_MINOR_STR', 'VER_PROD_REV_STR', \r
+ 'VER_PRODUCTNAME_STR');\r
+ $requirements_met = 1;\r
+ $first_missing = 0;\r
+ $error_list = "";\r
+ foreach my $required (@required_versions) {\r
+ if (! exists $config->{Versions}->{$required}) {\r
+ $requirements_met = 0;\r
+ if (!$first_missing) {\r
+ $first_missing = 1;\r
+ $error_list = "Fatal -- The following version(s) are not defined in $src/$version_path.\n";\r
}\r
- zipXML($config->{Stages}->{FetchSources}, $config); ## Make zips.\r
+ $error_list .= "$required\n";\r
}\r
-\r
- if ($verbose) {print "Info -- *** End fetching sources.\n";}\r
}\r
-##-- End repository action.\r
- \r
+ if (!$requirements_met) {\r
+ print $error_list;\r
+ exit(0);\r
+ }\r
+ \r
+ # Apply any of these tags to filestem:\r
+ my $filestem = $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name};\r
+ $filestem =~ s/%VERSION_MAJOR%/$config->{Versions}->{'VER_PROD_MAJOR_STR'}/;\r
+ $filestem =~ s/%VERSION_MINOR%/$config->{Versions}->{'VER_PROD_MINOR_STR'}/;\r
+ $filestem =~ s/%VERSION_PATCH%/$config->{Versions}->{'VER_PROD_REV_STR'}/;\r
+ $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name} = $filestem;\r
+ ##-- Read in the version information & set config info.\r
+\r
+##++ Repository action, part 2:\r
+ if ($rverb =~ /checkout/) { \r
+ if (! $bOutputCleaned) { ## In case somebody cleaned $out before us.\r
+ if (-d $out) {!system("rm -rf $out/*") or die "Fatal -- Couldn't clean $out."} ## Clean output directory.\r
+ else {mkdir($out);}\r
+ $bOutputCleaned = 1;\r
+ }\r
+ zipXML($config->{Stages}->{FetchSources}, $config); ## Make zips.\r
+ }\r
+##-- End repository action, part 2.\r
+\r
##++ Make action:\r
if ( (!$switches[0]->{nomake}->{value}) ) {\r
if ($verbose) {print "Info -- *** Begin preparing for build.\n";}\r
}\r
\r
chdir("$staging\\install\\wix") or die "Fatal -- Couldn't cd to $staging\\install\\wix";\r
+ print "Info -- chdir to ".`cd`."\n" if ($verbose);\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("mv a.tmp files.wxi") or die "Fatal -- Couldn't update files.wxi.";\r
\r
# Make sed script to run on the site-local configuration files:\r
local $tmpfile = "site-local.sed" ;\r
- system("del $tmpfile");\r
+ if (-e $tmpfile) {system("del $tmpfile");}\r
# Basic substitutions:\r
local $dblback_wd = $wd;\r
$dblback_wd =~ s/\\/\\\\/g;\r
!system("echo !define DEBUG >> b.tmp") or die "Fatal -- Couldn't modify b.tmp."; \r
}\r
else { ## release build\r
- !system("echo !define RELEASE >> b.tmp") or die "Fatal -- Couldn't modify b.tmp."; \r
+ if (!exists $config->{Versions}->{'BETA_STR'}) {!system("echo !define RELEASE >> b.tmp") or die "Fatal -- Couldn't modify b.tmp.";}\r
!system("echo !define NO_DEBUG >> b.tmp") or die "Fatal -- Couldn't modify b.tmp."; \r
}\r
# Add BETA if present:\r
- if ( exists $config->{Versions}->{'BETA_STR'}) {\r
+ if (exists $config->{Versions}->{'BETA_STR'}) {\r
!system("echo !define BETA $config->{Versions}->{'BETA_STR'} >> b.tmp") or die "Fatal -- Couldn't modify b.tmp."; \r
+ !system("echo !define NOT_RELEASE >> b.tmp") or die "Fatal -- Couldn't modify b.tmp."; \r
}\r
!system("mv -f b.tmp site-local.nsi") or die "Fatal -- Couldn't replace site-local.nsi.";\r
\r
\r
if ($verbose) {print "Info -- *** Begin package.\n";}\r
# Make the msi:\r
- chdir("$wd\\staging\\install\\wix") or die "Fatal -- Couldn't cd to $wd\\staging\\install\\wix";\r
+ if (-d "$wd\\buildwix") {!system("rm -rf $wd\\buildwix/*") or die "Fatal -- Couldn't clean $wd\\buildwix."} \r
+ !system("echo D | xcopy /s $wd\\staging\\*.* $wd\\buildwix") or die "Fatal -- Couldn't create $wd\\buildwix.";\r
+ chdir("$wd\\buildwix\\install\\wix") or die "Fatal -- Couldn't cd to $wd\\buildwix\\install\\wix";\r
print "Info -- *** Make .msi:\n" if ($verbose);\r
+ print "Info -- chdir to ".`cd`."\n" if ($verbose);\r
!system("$MAKE") or die "Error -- msi installer build failed.";\r
\r
- chdir("$wd\\staging\\install\\nsis") or die "Fatal -- Couldn't cd to $wd\\staging\\install\\nsis";\r
+ if (-d "$wd\\buildnsi") {!system("rm -rf $wd\\buildnsi/*") or die "Fatal -- Couldn't clean $wd\\buildnsi."} \r
+ !system("echo D | xcopy /s $wd\\staging\\*.* $wd\\buildnsi") or die "Fatal -- Couldn't create $wd\\buildnsi.";\r
+ chdir("$wd\\buildnsi\\install\\nsis") or die "Fatal -- Couldn't cd to $wd\\buildnsi\\install\\nsis";\r
print "Info -- chdir to ".`cd`."\n" if ($verbose);\r
print "Info -- *** Make NSIS:\n" if ($verbose);\r
!system("cl.exe killer.cpp advapi32.lib") or die "Error -- nsis killer.exe not built.";\r
!system("rename killer.exe Killer.exe") or die "Error -- Couldn't rename killer.exe";\r
!system("makensis kfw.nsi") or die "Error -- executable installer build failed.";\r
\r
+ chdir("$wd") or die "Fatal -- Couldn't cd to $wd";\r
+ print "Info -- chdir to ".`cd`."\n" if ($verbose);\r
+ !system("xcopy /s $wd\\buildwix\\*.msi $wd\\staging") or die "Fatal -- Couldn't copy $wd\\buildwix\\*.msi.";\r
+ !system("del $wd\\buildnsi\\install\\nsis\\killer.exe") or die "Fatal -- Couldn't clean $wd\\buildnsi\\install\\nsis\\killer.exe.";\r
+ !system("xcopy /s $wd\\buildnsi\\install\\nsis\\*.exe $wd\\staging\\install\\nsis") or die "Fatal -- Couldn't copy $wd\\buildnsi\\install\\nsis\\*.exe.";\r
+ !system("rm -rf $wd\\buildwix") or die "Fatal -- Couldn't remove $wd\\buildwix.";\r
+ !system("rm -rf $wd\\buildnsi") or die "Fatal -- Couldn't remove $wd\\buildnsi.";\r
+\r
# Begin packaging extra items:\r
zipXML($config->{Stages}->{PostPackage}, $config); ## Make zips.\r
\r
system("rm -rf $src/a.tmp"); ## Clean up junk.\r
system("rm -rf $out/a.tmp"); ## Clean up junk.\r
system("rm -rf $out/ziptemp"); ## Clean up junk.\r
- \r
+\r
# End logging:\r
if ($switches[0]->{logfile}->{value}) {$l->stop;}\r
\r