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.
Bug 886460 - createrepo --checkts option only compares one RPM from repo with the repodata directory.
Summary: createrepo --checkts option only compares one RPM from repo with the repodata...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: createrepo
Version: 6.3
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Packaging Maintenance Team
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-12 10:47 UTC by Kenneth MacDonald
Modified: 2015-04-24 06:16 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-05-14 13:51:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Check all RPM file timestamps (632 bytes, patch)
2012-12-13 11:38 UTC, Kenneth MacDonald
no flags Details | Diff
Fix checkts option (699 bytes, patch)
2013-01-23 11:21 UTC, Kenneth MacDonald
no flags Details | Diff

Description Kenneth 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 2 Kenneth 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 3 RHEL 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 4 Kenneth 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.

Comment 5 James Antill 2013-04-16 20:22:36 UTC
Upstream fix:

commit ad8110649baeb8bb9826c9d55be16c023734493e
Author: Seth Vidal <skvidal>
Date:   Mon Oct 5 16:13:48 2009 -0400

Comment 10 Zdeněk Pavlas 2013-05-14 12:48:02 UTC
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.

Comment 11 James Antill 2013-05-14 13:51:02 UTC
Yeh, confirmed. This got fixed as part of the rebase for multitasking.


Note You need to log in before you can comment on or make changes to this bug.