LoggingInterface.__init__(self, logger)
- self.repoid_type = None
+ self.contenthash_type = None
self.unique_md_filenames = False
self.force_database = force_database
self.ignore_missing = ignore_missing
self.new_repomd = cr.Repomd()
# Check if delta repo id correspond with the old repo id
- if not self.delta_repomd.repoid or \
- len(self.delta_repomd.repoid.split('-')) != 2:
- raise DeltaRepoError("Bad DeltaRepoId")
+ if not self.delta_repomd.contenthash or \
+ len(self.delta_repomd.contenthash.split('-')) != 2:
+ raise DeltaRepoError("Bad content hash")
- self.contenthash_type_str = self.delta_repomd.repoid_type
- res = self.delta_repomd.repoid.split('-')
+ self.contenthash_type_str = self.delta_repomd.contenthash_type
+ res = self.delta_repomd.contenthash.split('-')
self.old_contenthash, self.new_contenthash = res
self._debug("Delta %s -> %s" % (self.old_contenthash,
self.new_contenthash))
- if self.old_repomd.repoid_type == self.delta_repomd.repoid_type:
- if self.old_repomd.repoid and self.old_repomd.repoid != self.old_contenthash:
+ if self.old_repomd.contenthash_type == self.delta_repomd.contenthash_type:
+ if self.old_repomd.contenthash and self.old_repomd.contenthash != self.old_contenthash:
raise DeltaRepoError("Not suitable delta for current repo " \
"(Expected: {0} Real: {1})".format(
- self.old_contenthash, self.old_repomd.repoid))
+ self.old_contenthash, self.old_repomd.contenthash))
else:
- self._debug("Different repoid types repo: {0} vs delta: {1}".format(
- self.old_repomd.repoid_type, self.delta_repomd.repoid_type))
+ self._debug("Different contenthash types repo: {0} vs delta: {1}".format(
+ self.old_repomd.contenthash_type, self.delta_repomd.contenthash_type))
# Use revision and tags
self.new_repomd.set_revision(self.delta_repomd.revision)
self._debug(" - {0}".format(rec.type))
self.new_repomd.set_record(rec)
- # Check if calculated repoids match
+ # Check if calculated contenthashes match
self.check_content_hashes(primary_metadata_object)
# Prepare and write out the new repomd.xml
self._debug("Preparing repomd.xml ...")
- self.new_repomd.set_repoid(self.new_contenthash, self.contenthash_type_str)
+ self.new_repomd.set_contenthash(self.new_contenthash, self.contenthash_type_str)
self.new_repomd.sort_records()
new_repomd_xml = self.new_repomd.xml_dump()
new_repo_path,
out_path=None,
logger=None,
- repoid_type="sha256",
+ contenthash_type="sha256",
compression_type="xz",
force_database=False,
ignore_missing=False):
self.delta_repodata_path = os.path.join(self.delta_repo_path, ".repodata/")
self.delta_repomd_path = os.path.join(self.delta_repodata_path, "repomd.xml")
- # Repoid type
- self.contenthash_type_str = repoid_type or "sha256"
+ # contenthash type
+ self.contenthash_type_str = contenthash_type or "sha256"
self.compression_type_str = compression_type or "xz"
self.compression_type = cr.compression_type(self.compression_type_str)
if self.new_records["primary"].location_href.split("primary")[0] != "":
self.unique_md_filenames = True
- self.old_contenthash = self.old_repomd.repoid
- self.new_contenthash = self.new_repomd.repoid
+ self.old_contenthash = self.old_repomd.contenthash
+ self.new_contenthash = self.new_repomd.contenthash
self.deltametadata = DeltaMetadata()
deltametadata_rec.rename_file()
self.delta_repomd.set_record(deltametadata_rec)
- # Check if calculated repoids match
+ # Check if calculated contenthashes match
self.check_content_hashes()
# Prepare and write out the new repomd.xml
self._debug("Preparing repomd.xml ...")
- deltarepoid = "{0}-{1}".format(self.globalbundle.calculated_old_contenthash,
+ deltacontenthash = "{0}-{1}".format(self.globalbundle.calculated_old_contenthash,
self.globalbundle.calculated_new_contenthash)
- self.delta_repomd.set_repoid(deltarepoid, self.contenthash_type_str)
+ self.delta_repomd.set_contenthash(deltacontenthash, self.contenthash_type_str)
self.delta_repomd.sort_records()
delta_repomd_xml = self.delta_repomd.xml_dump()