Bug 823602 - [RFE] Support for unique yum repodata filenames
[RFE] Support for unique yum repodata filenames
Status: CLOSED WORKSFORME
Product: Pulp
Classification: Community
Component: rpm-support (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: pulp-bugs
Preethi Thomas
: FutureFeature, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-21 11:54 EDT by Dennis Gregorovic
Modified: 2013-09-27 18:32 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-27 18:32:27 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dennis Gregorovic 2012-05-21 11:54:36 EDT
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
Comment 1 Todd Sanders 2012-05-22 08:14:21 EDT
Aligning to v1.1.1

-Todd
Comment 2 Jay Dobies 2012-11-27 09:40:44 EST
The patch is invalid in 2.x, but the RFE itself may still be valid. Will be considered in a future release.
Comment 3 Michael Hrivnak 2013-09-27 18:32:27 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.