Changed location of default config repo, added --testbuild option, extended help
authorDario Sestito <darios@symbian.org>
Thu, 18 Jun 2009 15:23:28 +0100
changeset 19 472feb69d0c9
parent 18 27ea4714a2aa
child 20 78c3f68f39f1
Changed location of default config repo, added --testbuild option, extended help
build_package.pl
--- a/build_package.pl	Thu Jun 11 19:28:03 2009 +0100
+++ b/build_package.pl	Thu Jun 18 15:23:28 2009 +0100
@@ -28,18 +28,36 @@
 
 my $sFbfProjectRepo = '';
 my $sFbfProjectDir = '';
-my $sFbfConfigRepo="\\\\v800008.ad-sfpd.intra\\g\$\\mercurial_development\\oss\\FCL\\interim\\fbf\\configs\\pkgbuild";
+my $sFbfConfigRepo="\\\\v800008.ad-sfpd.intra\\g\$\\mercurial_internal\\fbf\\configs\\pkgbuild";
 my $sFbfConfigDir = '';
 my $sJobLabel = '';
 my $nCmdLineNumber;
-GetOptions(('label:s' => \$sJobLabel, 'configrepo:s' => \$sFbfConfigRepo, 'configdir:s' => \$sFbfConfigDir, 'projectrepo:s' => \$sFbfProjectRepo, 'projectdir:s' => \$sFbfProjectDir, 'number:s' => \$nCmdLineNumber));
+my $bTestBuild = 0;
+GetOptions((
+	'label:s' => \$sJobLabel,
+	'configrepo:s' => \$sFbfConfigRepo,
+	'configdir:s' => \$sFbfConfigDir,
+	'projectrepo:s' => \$sFbfProjectRepo,
+	'projectdir:s' => \$sFbfProjectDir,
+	'number:s' => \$nCmdLineNumber,
+	'testbuild!' => \$bTestBuild
+));
 
 if (!$sJobLabel or !($sFbfProjectRepo or $sFbfProjectDir))
 {
-	print "Usage: build_package.pl --label=<label> --projectrepo=<project repo> | --projectdir=<project dir>\n\t[--configrepo=<config repo> | --configdir=<config dir>]\n";
+	print "Usage: build_package.pl --label=LABEL (--projectrepo=REPO | --projectdir=DIR) OPTIONS\n";
+	print "\tOPTIONS:\n";
+	print "\t--configrepo=REPO Use REPO location for the config instead of \\\\v800008\\g\$\\mercurial_development\\oss\\FCL\\interim\\fbf\\config\\pkgbuild\\n";
+	print "\t--configdir=DIR Use DIR location for the config (exclusive with --configrepo)\n";
+	print "\t--number=N Force build number to N\n";
+	print "\t--testbuild Use d:\\numbers_test.txt for numbers and d:\\SF_builds_test to publish results\n";
 	exit(0);
 }
 
+my $sTestBuildOpts = "";
+$sTestBuildOpts = "-Dsf.spec.publish.networkdrive=d:\\SF_builds_test" if ( $bTestBuild );
+$sNUMBERS_FILE = "d:\\numbers_test.txt" if ( $bTestBuild );
+
 my $sJobDir = mkdir_unique("$sJOB_BASE_DIR\\$sJobLabel");
 
 print("cd $sBOOTSTRAP_DIR\n");
@@ -79,8 +97,8 @@
 print("cd $sJobDir\\sf-config\n");
 chdir("$sJobDir\\sf-config");
 print "###### BUILD PREPARATION ######\n";
-print("hlm sf-prep -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter:\n");
-system("hlm sf-prep -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter:");
+print("hlm sf-prep -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter: $sTestBuildOpts\n");
+system("hlm sf-prep -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter: $sTestBuildOpts");
 
 print "###### EXECUTE BUILD ######\n";
 print("hlm sf-build-all -Dsf.spec.job.number=$nJobNumber -Dsf.spec.job.drive=$sDriveLetter:\n");
@@ -187,8 +205,9 @@
 					}
 					else
 					{
-						# do nothing
-						print "forced release of letter: $sLetter\n";
+						# lease has expired: unsubst drive letter and don't add to hash
+						system("subst $sLetter: /d");
+						print "forced release of letter: $sLetter (and drive unsubsted)\n";
 					}
 				}
 			}