equal
deleted
inserted
replaced
153 # $sSourcesFile =~ m,(.*[\\/])?([^\\^/]+),; |
153 # $sSourcesFile =~ m,(.*[\\/])?([^\\^/]+),; |
154 # $sJobLabel = $2 if (!$sJobLabel); |
154 # $sJobLabel = $2 if (!$sJobLabel); |
155 #} |
155 #} |
156 mkdir("$sWORKING_DRIVE\\$sJOB_BASE_DIR") if (!-d "$sWORKING_DRIVE\\$sJOB_BASE_DIR"); |
156 mkdir("$sWORKING_DRIVE\\$sJOB_BASE_DIR") if (!-d "$sWORKING_DRIVE\\$sJOB_BASE_DIR"); |
157 my $sJobDir = mkdir_unique("$sWORKING_DRIVE\\$sJOB_BASE_DIR\\$sJobLabel"); |
157 my $sJobDir = mkdir_unique("$sWORKING_DRIVE\\$sJOB_BASE_DIR\\$sJobLabel"); |
158 print "Created project dir $sWORKING_DRIVE\\$sJOB_BASE_DIR\\$sJobLabel\n"; |
158 print "Created project dir $sWORKING_DRIVE\\$sJOB_BASE_DIR\\$sJobDir\n"; |
159 |
159 |
160 print("cd $sBOOTSTRAP_DIR\n"); |
160 print("cd $sBOOTSTRAP_DIR\n"); |
161 chdir("$sBOOTSTRAP_DIR"); |
161 chdir("$sBOOTSTRAP_DIR"); |
162 print "###### BOOTSTRAP ######\n"; |
162 print "###### BOOTSTRAP ######\n"; |
163 my $sConfigArg = "-Dsf.config.repo=$sFbfConfigRepo"; |
163 my $sConfigArg = "-Dsf.config.repo=$sFbfConfigRepo"; |
175 open FILE, ">$sNUMBERS_FILE"; |
175 open FILE, ">$sNUMBERS_FILE"; |
176 print FILE "\n"; |
176 print FILE "\n"; |
177 close FILE; |
177 close FILE; |
178 } |
178 } |
179 |
179 |
|
180 my $sJobNumberKey = ''; |
180 my $nUnformattedNumber = 0; |
181 my $nUnformattedNumber = 0; |
181 if ($nCmdLineNumber) |
182 if ($nCmdLineNumber) |
182 { |
183 { |
183 $nUnformattedNumber = $nCmdLineNumber; |
184 $nUnformattedNumber = $nCmdLineNumber; |
184 } |
185 } |
185 elsif ($sFbfProjectRepo) |
186 elsif ($sFbfProjectRepo) |
186 { |
187 { |
187 my $sJobNumberKey = ''; |
|
188 if ($sSubProject) |
188 if ($sSubProject) |
189 { |
189 { |
190 # key = <package>_<codeline>, e.g. for subproj=MCL/os/boardsupport -> key=boardsupport_MCL |
190 # key = <package>_<codeline>, e.g. for subproj=MCL/os/boardsupport -> key=boardsupport_MCL |
191 $sSubProject =~ m,^([^/]+)/[^/]+/([^/]+)$,; |
191 $sSubProject =~ m,^([^/]+)/[^/]+/([^/]+)$,; |
192 $sJobNumberKey = "$2_$1"; |
192 $sJobNumberKey = "$2_$1"; |
200 $sJobNumberKey .= ".T" if (!$bProduction); |
200 $sJobNumberKey .= ".T" if (!$bProduction); |
201 $nUnformattedNumber = get_job_number($sJobNumberKey); |
201 $nUnformattedNumber = get_job_number($sJobNumberKey); |
202 } |
202 } |
203 my $nJobNumber = sprintf("%.3d", $nUnformattedNumber); |
203 my $nJobNumber = sprintf("%.3d", $nUnformattedNumber); |
204 $nJobNumber = "T$nJobNumber" if (!$bProduction); |
204 $nJobNumber = "T$nJobNumber" if (!$bProduction); |
|
205 print "For build key $sJobNumberKey got assigned number \"$nJobNumber\"\n"; |
205 |
206 |
206 # check that $sLETTERS_FILE exists, otherwise create it |
207 # check that $sLETTERS_FILE exists, otherwise create it |
207 if (!-f "$sWORKING_DRIVE\\$sLETTERS_FILE") |
208 if (!-f "$sWORKING_DRIVE\\$sLETTERS_FILE") |
208 { |
209 { |
209 open FILE, ">$sWORKING_DRIVE\\$sLETTERS_FILE"; |
210 open FILE, ">$sWORKING_DRIVE\\$sLETTERS_FILE"; |
232 |
233 |
233 # release the drive letter |
234 # release the drive letter |
234 release_drive_letter($sDriveLetter); |
235 release_drive_letter($sDriveLetter); |
235 system("subst $sDriveLetter: /d"); # this is not required, but it's a good idea to keep things in order |
236 system("subst $sDriveLetter: /d"); # this is not required, but it's a good idea to keep things in order |
236 print "drive letter $sDriveLetter released (and drive unsubsted)\n"; |
237 print "drive letter $sDriveLetter released (and drive unsubsted)\n"; |
|
238 |
|
239 if ($bHudson) |
|
240 { |
|
241 print "cleaning job directories...\n"; |
|
242 if (-d "$sWORKING_DRIVE\\$sJOB_BASE_DIR\\$sJobLabel") # project dir |
|
243 { |
|
244 print "rmdir /S $sWORKING_DRIVE\\$sJOB_BASE_DIR\\$sJobLabel\n"; |
|
245 system("rmdir /S /Q $sWORKING_DRIVE\\$sJOB_BASE_DIR\\$sJobLabel"); |
|
246 } |
|
247 if (-d "$sWORKING_DRIVE\\fbf_job\\$sJobNumberKey.$nJobNumber") # build drive |
|
248 { |
|
249 print "rmdir /S $sWORKING_DRIVE\\fbf_job\\$sJobNumberKey.$nJobNumber\n"; |
|
250 system("rmdir /S /Q $sWORKING_DRIVE\\fbf_job\\$sJobNumberKey.$nJobNumber"); |
|
251 } |
|
252 } |
237 |
253 |
238 sub mkdir_unique |
254 sub mkdir_unique |
239 { |
255 { |
240 my ($sBaseDir) = @_; |
256 my ($sBaseDir) = @_; |
241 |
257 |