Change-Id: I344385b573a3c7fb6fd11c5ca2703132df0440f6
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/6415
Reviewed-by: michellew <michellew@vmware.com>
Tested-by: michellew <michellew@vmware.com>
| ... | ... |
@@ -260,38 +260,38 @@ def buildSRPMList(srpmPath, yamlDir, blackListPkgs, logger, singleFile=True): |
| 260 | 260 |
continue |
| 261 | 261 |
ossname = package |
| 262 | 262 |
for ossversion in SPECS.getData().getVersions(package): |
| 263 |
- ossrelease = SPECS.getData().getRelease(package, ossversion) |
|
| 264 |
- |
|
| 265 |
- listFoundSRPMFiles = cmdUtils.findFile(ossname+"-"+ossversion+"-"+ossrelease+".src.rpm",srpmPath) |
|
| 266 |
- srpmName = None |
|
| 267 |
- if len(listFoundSRPMFiles) == 1: |
|
| 268 |
- srpmFullPath = listFoundSRPMFiles[0]; |
|
| 269 |
- srpmName = os.path.basename(srpmFullPath) |
|
| 270 |
- cpcmd = "cp "+ srpmFullPath +" "+yamlSrpmDir+"/" |
|
| 271 |
- returnVal = cmdUtils.runCommandInShell(cpcmd) |
|
| 272 |
- if not returnVal: |
|
| 273 |
- logger.error("Copy SRPM File is failed for package:"+ossname)
|
|
| 274 |
- else: |
|
| 275 |
- logger.error("SRPM file is not found:" +ossname)
|
|
| 276 |
- |
|
| 277 |
- if not singleFile: |
|
| 278 |
- yamlFile = open(yamlSrpmDir+"/"+ossname+"-"+ossversion+"-"+ossrelease+".yaml", "w") |
|
| 279 |
- |
|
| 280 |
- yamlFile.write("baseos:"+ossname+":"+ossversion+"-"+ossrelease+":\n")
|
|
| 281 |
- yamlFile.write(" repository: BaseOS\n")
|
|
| 282 |
- yamlFile.write(" name: '"+ossname+"'\n")
|
|
| 283 |
- yamlFile.write(" version: '"+ossversion+"-"+ossrelease+"'\n")
|
|
| 284 |
- yamlFile.write(" url: 'http://www.vmware.com'\n")
|
|
| 285 |
- yamlFile.write(" baseos-style: rpm\n")
|
|
| 286 |
- yamlFile.write(" baseos-source: '"+str(srpmName)+"'\n")
|
|
| 287 |
- yamlFile.write(" baseos-osname: 'photon'\n")
|
|
| 288 |
- yamlFile.write("\n")
|
|
| 289 |
- if not singleFile: |
|
| 290 |
- yamlFile.close() |
|
| 291 |
- |
|
| 292 |
- if singleFile: |
|
| 263 |
+ ossrelease = SPECS.getData().getRelease(package, ossversion) |
|
| 264 |
+ listFoundSRPMFiles = cmdUtils.findFile(ossname+"-"+ossversion+"-"+ossrelease+".src.rpm",srpmPath) |
|
| 265 |
+ srpmName = None |
|
| 266 |
+ if len(listFoundSRPMFiles) == 1: |
|
| 267 |
+ srpmFullPath = listFoundSRPMFiles[0]; |
|
| 268 |
+ srpmName = os.path.basename(srpmFullPath) |
|
| 269 |
+ cpcmd = "cp "+ srpmFullPath +" "+yamlSrpmDir+"/" |
|
| 270 |
+ returnVal = cmdUtils.runCommandInShell(cpcmd) |
|
| 271 |
+ if not returnVal: |
|
| 272 |
+ logger.error("Copy SRPM File is failed for package:"+ossname)
|
|
| 273 |
+ else: |
|
| 274 |
+ logger.error("SRPM file is not found:" +ossname)
|
|
| 275 |
+ |
|
| 276 |
+ if not singleFile: |
|
| 277 |
+ yamlFile = open(yamlSrpmDir+"/"+ossname+"-"+ossversion+"-"+ossrelease+".yaml", "w") |
|
| 278 |
+ |
|
| 279 |
+ print("ossname is %s and ossversion is %s and ossrelease is %s" % (ossname, ossversion, ossrelease))
|
|
| 280 |
+ yamlFile.write("baseos:"+ossname+":"+ossversion+"-"+ossrelease+":\n")
|
|
| 281 |
+ yamlFile.write(" repository: BaseOS\n")
|
|
| 282 |
+ yamlFile.write(" name: '"+ossname+"'\n")
|
|
| 283 |
+ yamlFile.write(" version: '"+ossversion+"-"+ossrelease+"'\n")
|
|
| 284 |
+ yamlFile.write(" url: 'http://www.vmware.com'\n")
|
|
| 285 |
+ yamlFile.write(" baseos-style: rpm\n")
|
|
| 286 |
+ yamlFile.write(" baseos-source: '"+str(srpmName)+"'\n")
|
|
| 287 |
+ yamlFile.write(" baseos-osname: 'photon'\n")
|
|
| 288 |
+ yamlFile.write("\n")
|
|
| 289 |
+ if not singleFile: |
|
| 293 | 290 |
yamlFile.close() |
| 294 |
- logger.info("Generated srpm yaml files for all packages")
|
|
| 291 |
+ |
|
| 292 |
+ if singleFile: |
|
| 293 |
+ yamlFile.close() |
|
| 294 |
+ logger.info("Generated srpm yaml files for all packages")
|
|
| 295 | 295 |
|
| 296 | 296 |
def buildAPackage(package, listBuildOptionPackages, pkgBuildOptionFile, buildThreads, pkgBuildType): |
| 297 | 297 |
listPackages=[] |