Bug 823602 - [RFE] Support for unique yum repodata filenames
Summary: [RFE] Support for unique yum repodata filenames
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Pulp
Classification: Retired
Component: rpm-support
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: pulp-bugs
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-21 15:54 UTC by Dennis Gregorovic
Modified: 2013-09-27 22:32 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-09-27 22:32:27 UTC
Embargoed:


Attachments (Terms of Use)

Description Dennis Gregorovic 2012-05-21 15:54:36 UTC
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 12:14:21 UTC
Aligning to v1.1.1

-Todd

Comment 2 Jay Dobies 2012-11-27 14:40:44 UTC
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 22:32:27 UTC
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.