fix for https://bugzilla.redhat.com/show_bug.cgi?id=512610
authorSeth Vidal <skvidal@fedoraproject.org>
Tue, 21 Jul 2009 13:55:02 +0000 (09:55 -0400)
committerSeth Vidal <skvidal@fedoraproject.org>
Tue, 21 Jul 2009 13:55:02 +0000 (09:55 -0400)
take timestamp of repomd.xml - not of repodata dir - just in case repodata
dir is empty, for some bizarre reason

createrepo/__init__.py

index 233fa1c38d14ac25c10faeae523bee64b7819453..a28433e0723f8ed3b13682702595f23f5b088426 100644 (file)
@@ -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