# HG changeset patch # User Dario Sestito # Date 1250679681 -3600 # Node ID 4379a1e558cde925480b3ac947b11f6dd98a3b25 # Parent 4db5e28df88822b4e4cd7e8d8bf29e67116860d0# Parent 61887c5ee9dbd339302de8bd9121ceaca043fb0b Merge diff -r 4db5e28df888 -r 4379a1e558cd build_package.pl --- a/build_package.pl Wed Aug 19 11:55:21 2009 +0100 +++ b/build_package.pl Wed Aug 19 12:01:21 2009 +0100 @@ -72,7 +72,7 @@ print "\t--production Tag this build as 'production' (default: 'test') and use nnn numbering (default: Tnnn)\n"; print "\t--tag=TAG Apply Diamonds tag TAG to this build (exclusive with --production)\n"; print "\t--hudson Checks that there is at least NUMBER_OF_PROCESSORS X 10 GB available on the working drive\n"; - print "\t--nopublish Use numbers_test.txt for numbers and disable publishing\n"; + print "\t--nopublish Use \\numbers_test.txt for numbers and disable publishing\n"; exit(0); } @@ -94,9 +94,7 @@ # exit(0); #} -my $sWORKING_DRIVE = "G:"; -my $output = `G: 2>&1`; -$sWORKING_DRIVE = "D:" if ($output =~ /The device is not ready./); +my $sWORKING_DRIVE = find_working_drive(); print "Will use drive $sWORKING_DRIVE as working drive for this build\n"; if ($bHudson) @@ -132,7 +130,7 @@ $sTestBuildOpt = "-Dsf.spec.publish.diamonds.tag=$sDiamondsTag" if ( $sDiamondsTag ); my $sNoPublishOpt = ""; $sNoPublishOpt = "-Dsf.spec.publish.enable=false" if ( !$bPublish ); -$sNUMBERS_FILE = "d:\\numbers_test.txt" if ( !$bPublish ); +$sNUMBERS_FILE = "$sWORKING_DRIVE\\numbers_test.txt" if ( !$bPublish ); my $sJobLabel = 'job'; if ($sSubProject) @@ -279,21 +277,24 @@ close(PIPE); close(LOG); -# copy console outputs to remote log archive -if (-d "$sREMOTE_LOG_ARCHIVE\\$sPackage\\builds\\$sPlatform\\$sPackage\_$sPlatform.$nJobNumber\\logs") +if ($bPublish) { - my $sTgtDir = "$sREMOTE_LOG_ARCHIVE\\$sPackage\\builds\\$sPlatform\\$sPackage\_$sPlatform.$nJobNumber\\logs\\console"; - print "copying console output files to $sTgtDir\n"; - system("mkdir $sTgtDir"); - system("copy /Y $sBOOTSTRAP_DIR\\console_bootstrap_$$.txt $sTgtDir"); - system("del $sBOOTSTRAP_DIR\\console_bootstrap_$$.txt"); - system("copy $sJobDir\\sf-config\\console_sfprep_$$.txt $sTgtDir"); - system("copy $sJobDir\\sf-config\\console_sfbuildall_$$.txt $sTgtDir"); - system("copy $sJobDir\\sf-config\\console_sfsummary_$$.txt $sTgtDir"); -} -else -{ - print "directory $sREMOTE_LOG_ARCHIVE\\$sPackage\\builds\\$sPlatform\\$sPackage\_$sPlatform.$nJobNumber\\logs doesn't exist.\n"; + # copy console outputs to remote log archive + if (-d "$sREMOTE_LOG_ARCHIVE\\$sPackage\\builds\\$sPlatform\\$sPackage\_$sPlatform.$nJobNumber\\logs") + { + my $sTgtDir = "$sREMOTE_LOG_ARCHIVE\\$sPackage\\builds\\$sPlatform\\$sPackage\_$sPlatform.$nJobNumber\\logs\\console"; + print "copying console output files to $sTgtDir\n"; + system("mkdir $sTgtDir"); + system("copy /Y $sBOOTSTRAP_DIR\\console_bootstrap_$$.txt $sTgtDir"); + system("del $sBOOTSTRAP_DIR\\console_bootstrap_$$.txt"); + system("copy $sJobDir\\sf-config\\console_sfprep_$$.txt $sTgtDir"); + system("copy $sJobDir\\sf-config\\console_sfbuildall_$$.txt $sTgtDir"); + system("copy $sJobDir\\sf-config\\console_sfsummary_$$.txt $sTgtDir"); + } + else + { + print "directory $sREMOTE_LOG_ARCHIVE\\$sPackage\\builds\\$sPlatform\\$sPackage\_$sPlatform.$nJobNumber\\logs doesn't exist.\n"; + } } print("cd $sBOOTSTRAP_DIR\n"); @@ -319,6 +320,18 @@ } } +sub find_working_drive +{ + my @drive_list = ('E', 'G', 'D', 'C'); + + for my $drive (@drive_list) + { + return "$drive:" if (-d "$drive:/"); + } + + die "Could not find suitable working drive."; +} + sub mkdir_unique { my ($sBaseDir) = @_;