createrepo/__init__.py

[email protected]
Newsgroups gmane.linux.rpm.metadata
Message-ID <[email protected]>
 createrepo/__init__.py |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 6e6f8febc9042b5a95e20e5d7813a62a2ca30289
Author: Seth Vidal <[email protected]>
Date:   Tue Jul 21 09:55:02 2009 -0400

    fix for https://bugzilla.redhat.com/show_bug.cgi?id=512610
    take timestamp of repomd.xml - not of repodata dir - just in case repodata
    dir is empty, for some bizarre reason

diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 233fa1c..a28433e 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -216,9 +216,12 @@ class MetaDataGenerator:
                     raise MDError, _('error in must be able to write to metadata dir:\n  -> %s') % filepath
 
                 if self.conf.checkts:
-                    timestamp = os.path.getctime(filepath)
-                    if timestamp > self.conf.mdtimestamp:
-                        self.conf.mdtimestamp = timestamp
+                    # checking for repodata/repomd.xml - not just the data dir
+                    rxml = filepath + '/repomd.xml'
+                    if os.path.exists(rxml):
+                        timestamp = os.path.getctime(rxml)
+                        if timestamp > self.conf.mdtimestamp:
+                            self.conf.mdtimestamp = timestamp
 
         if self.conf.groupfile:
             a = self.conf.groupfile
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.