createrepo has a --unique-md-filenames switch that causes the repodata files (e.g. primary.xml.gz) to be named uniquely by having their checksum prepended to the filename. This is necessary in environments where there is a proxy between the end user and the repodata. By not uniquely naming the files, the proxy will return stale, cached data. Please include the following patch. diff --git a/src/pulp/server/util.py b/src/pulp/server/util.py index eee5a0e..6dc2d65 100644 --- a/src/pulp/server/util.py +++ b/src/pulp/server/util.py @@ -451,15 +451,15 @@ def create_symlinks(source_path, link_path): def _create_repo(dir, groups=None, checksum_type="sha256"): try: - cmd = "createrepo --database --checksum %s -g %s --update %s " % (checksum_type, groups, dir) + cmd = "createrepo --unique-md-filenames --database --checksum %s -g %s --update %s " % (checksum_type, groups, dir) except UnicodeDecodeError: checksum_type = decode_unicode(checksum_type) if groups: groups = decode_unicode(groups) dir = decode_unicode(dir) - cmd = "createrepo --database --checksum %s -g %s --update %s " % (checksum_type, groups, dir) + cmd = "createrepo --unique-md-filenames --database --checksum %s -g %s --update %s " % (checksum_type, groups, dir) if not groups: - cmd = "createrepo --database --checksum %s --update %s " % (checksum_type, dir) + cmd = "createrepo --unique-md-filenames --database --checksum %s --update %s " % (checksum_type, dir) repodata_file = os.path.join(dir, "repodata", "repomd.xml") repodata_file = encode_unicode(repodata_file) if os.path.isfile(repodata_file): @@ -476,7 +476,7 @@ def _create_repo(dir, groups=None, checksum_type="sha256"): renamed_comps_file = os.path.join(dir, renamed_filetype_path) os.rename(filetype_path, renamed_comps_file) if renamed_comps_file and os.path.isfile(renamed_comps_file): - cmd = "createrepo --database --checksum %s -g %s --update %s " % \ + cmd = "createrepo --unique-md-filenames --database --checksum %s -g %s --update %s " % \ (checksum_type, renamed_comps_file, dir) # shlex now can handle unicode strings as well
Aligning to v1.1.1 -Todd
The patch is invalid in 2.x, but the RFE itself may still be valid. Will be considered in a future release.
Pulp 2.2 seems to behave in the suggested way, so I am closing the bug. Please re-open if you think there is additional work to do.