[Rpm-metadata] createrepo/__init__.py

skvidal at osuosl.org skvidal at osuosl.org
Tue Jul 21 13:57:28 UTC 2009


 createrepo/__init__.py |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 6e6f8febc9042b5a95e20e5d7813a62a2ca30289
Author: Seth Vidal <skvidal at fedoraproject.org>
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


More information about the Rpm-metadata mailing list