@api.publicApi
    def downloadUpdate(self, uJob, destDir):
        """
        Download the changesets required in order to apply an update job.

        @param uJob: The update job.
        @type uJob: L{database.UpdateJob}
        @param destDir: Directory where the changesets will be stored.
        @type destDir: path
        """
        allJobs = uJob.getJobs()
        csFiles = []
        for i, job in enumerate(allJobs):
            self.updateCallback.setChangesetHunk(i + 1, len(allJobs))
            # Create the relative changeset
            newCs = self._createCs(self.repos, self.db, job, uJob)

            # Dump the changeset to disk
            path = os.path.join(destDir, "%04d.ccs" % i)
            newCs.writeToFile(path)
            csFiles.append(path)

        uJob.setJobsChangesetList(csFiles)
        # Set the search source to use the downloaded troves
        csSource = trovesource.ChangesetFilesTroveSource(self.db,
                                                         storeDeps=True)
        csSource.addChangeSets(
            (changeset.ChangeSetFromFile(self.lzCache.open(x))
                for x in csFiles),
            includesFileContents = True)
        uJob.setSearchSource(csSource)
        uJob.troveSource = csSource
        uJob.setChangesetsDownloaded(True)
dataset/ETHPy150Open sassoftware/conary/conary/conaryclient/update.py/ClientUpdate.downloadUpdate/original