Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionKenneth MacDonald
2012-12-12 10:47:53 UTC
Description of problem:
The --checkts option for createrepo only compares the timestamp on the repodata directory with the *first* rpm in the list of RPMs in the repo.
Version-Release number of selected component (if applicable):
createrepo-0.9.8-5.el6.noarch.rpm
How reproducible:
Almost all the time
Steps to Reproduce:
1. Use --checkts option
Additional info:
I tracked this down to a change in the source code between RHEL5 and RHEL6.
In RHEL5 (createrepo-0.4.11-3.el5.noarch.rpm) /usr/share/createrepo/genpkgmetadata.py:118
118 def checkTimeStamps(self, directory):
119 if self.cmds['checkts']:
120 files = self.getFileList(self.cmds['basedir'], directory, '.
rpm')
121 files = self.trimRpms(files)
122 for f in files:
123 fn = os.path.join(self.cmds['basedir'], directory, f)
124 if not os.path.exists(fn):
125 errorprint(_('cannot get to file: %s') % fn)
126 if os.path.getctime(fn) > self.cmds['mdtimestamp']:
127 return False
128 return True
In RHEL6 (createrepo-0.9.8-5.el6.noarch.rpm) /usr/lib/python2.6/site-packages/createrepo/__init__.py:288
288 def checkTimeStamps(self):
289 """check the timestamp of our target dir. If it is not newer tha
n
290 the repodata return False, else True"""
291 if self.conf.checkts:
292 dn = os.path.join(self.conf.basedir, self.conf.directory)
293 files = self.getFileList(dn, '.rpm')
294 files = self.trimRpms(files)
295 for f in files:
296 fn = os.path.join(self.conf.basedir, self.conf.directory
, f)
297 if not os.path.exists(fn):
298 self.callback.errorlog(_('cannot get to file: %s') %
fn)
299 if os.path.getctime(fn) > self.conf.mdtimestamp:
300 return False
301 else:
302 return True
303
304 return False
Lines 300 and 301 are not required. They cause the function to return if the first RPM it looks at is older than the repodata.
Comment 2Kenneth MacDonald
2012-12-13 11:38:29 UTC
Created attachment 662908[details]
Check all RPM file timestamps
My earlier suggested fix was wrong. I've tested this patch and it works against my repos.
Comment 3RHEL Program Management
2012-12-17 06:48:46 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
Comment 4Kenneth MacDonald
2013-01-23 11:21:02 UTC
Created attachment 685832[details]
Fix checkts option
The previous patch didn't work unless the --checkts option was used.
commit ad8110649baeb8bb9826c9d55be16c023734493e is already in createrepo-0.9.9.tar.gz, the bug should not be in rhel-6.5. Unless someone reproduces this, I'm closing it as CURRENTRELEASE.
Description of problem: The --checkts option for createrepo only compares the timestamp on the repodata directory with the *first* rpm in the list of RPMs in the repo. Version-Release number of selected component (if applicable): createrepo-0.9.8-5.el6.noarch.rpm How reproducible: Almost all the time Steps to Reproduce: 1. Use --checkts option Additional info: I tracked this down to a change in the source code between RHEL5 and RHEL6. In RHEL5 (createrepo-0.4.11-3.el5.noarch.rpm) /usr/share/createrepo/genpkgmetadata.py:118 118 def checkTimeStamps(self, directory): 119 if self.cmds['checkts']: 120 files = self.getFileList(self.cmds['basedir'], directory, '. rpm') 121 files = self.trimRpms(files) 122 for f in files: 123 fn = os.path.join(self.cmds['basedir'], directory, f) 124 if not os.path.exists(fn): 125 errorprint(_('cannot get to file: %s') % fn) 126 if os.path.getctime(fn) > self.cmds['mdtimestamp']: 127 return False 128 return True In RHEL6 (createrepo-0.9.8-5.el6.noarch.rpm) /usr/lib/python2.6/site-packages/createrepo/__init__.py:288 288 def checkTimeStamps(self): 289 """check the timestamp of our target dir. If it is not newer tha n 290 the repodata return False, else True""" 291 if self.conf.checkts: 292 dn = os.path.join(self.conf.basedir, self.conf.directory) 293 files = self.getFileList(dn, '.rpm') 294 files = self.trimRpms(files) 295 for f in files: 296 fn = os.path.join(self.conf.basedir, self.conf.directory , f) 297 if not os.path.exists(fn): 298 self.callback.errorlog(_('cannot get to file: %s') % fn) 299 if os.path.getctime(fn) > self.conf.mdtimestamp: 300 return False 301 else: 302 return True 303 304 return False Lines 300 and 301 are not required. They cause the function to return if the first RPM it looks at is older than the repodata.