def writeCsList(self, path): csListFile = os.path.join(path, 'cslist') if not os.path.exists(csListFile): log.info('writing cslist') fd = open(csListFile, 'w') fd.write('\n'.join(self.cslist)) fd.close()
def _getGroupChangeSet(self): name, version, flavor = self.topGroup cl = [ (name, (None, None), (version, flavor), False) ] log.info('requesting changeset %s=%s[%s]' % (name, version, flavor)) self.groupcs = self.client.createChangeSet(cl, withFiles=False, withFileContents=False, skipNotByDefault = False) # Get a cscache as soon as possible. self.cscache = CsCache(self.client, self.groupcs, cacheDir=self.cacheDir, changesetVersion=self.changesetVersion)
def extractChangeSets(self, csdir, callback=None): self.cslist = [] self._cslist = [] total = len(self.pkgorder) for num, trv in enumerate(self.pkgorder): log.info('extracting %s' % trv.name) csfile = self._getCsFilename(trv) self._cslist.append(csfile) self.cslist.append(self._getCsListEntry(trv, csfile)) csPath = os.path.join(csdir, csfile) cachefn = self.cscache.getCs(trv, callback=callback, num=num, total=total) _linkOrCopyFile(cachefn, csPath) if not self.cacheDir: os.unlink(cachefn)
def writeGroupCs(self, path): groupCsFile = os.path.join(path, 'group.ccs') if not os.path.exists(groupCsFile): log.info('writing group changeset') self.groupcs.writeToFile(groupCsFile, versionOverride=self.changesetVersion)
def parsePackageData(self): # Get the group changeset. log.info('getting group changeset') self._getGroupChangeSet() # Parse the group into a node tree. log.info('calculating group hierarchy') self._calcGroupHierarchy(*self.topGroup) # Make sure that all kernels get on the disc. log.info('selecting kernels') self.selectTroveByName('kernel:runtime') # Check deps and get package install order. log.info('checking deps') updJob, suggMap = self._checkDeps() assert not suggMap # Get an ordered list of troves from the job set. log.info('calculating package order') self.pkgorder = self._orderValidTroves(updJob.getJobs()) # Verify that all selected troves are in the pkgorder. log.info('verifying package list') assert self._verifyPackageList()