[Rpm-metadata] Why does createrepo -C use ctime, not mtime?
Seth Vidal
skvidal at fedoraproject.org
Wed Apr 7 16:42:28 UTC 2010
On Wed, 7 Apr 2010, Seth Vidal wrote:
>
>
> On Wed, 7 Apr 2010, Robert Vogelgesang wrote:
>
>> Hello developers,
>>
>> currently, I'm investigating an issue with "createrepo --update -C"
>> when run by "cobbler reposync", and found in createrepo's source
>> that the -C option is based on Python's os.path.getctime(), i. e. the
>> time of the last status change on *nix hosts (ctime).
>>
>> As of version 2.0.3.1, "cobbler reposync" chown's and chmod's all
>> files in a repo on each run, changing the ctime of all files in the
>> repo; I think this is a bug in itself, but nonetheless I'd expect
>> that mtime is used by createrepo when checking for changed files.
>>
>> createrepo's variable which holds the reference timestamp,
>> self.mdtimestamp in class MetaDataConfig, seems to indicate that mtime
>> should be, or even was historically used. So, is there any special
>> reason why this is based on ctime and not mtime? I've searched
>> createrepo's source, and http://createrepo.baseurl.org/, but found
>> no answer.
>>
>> Can you shed some light on this, please?
>
> You have to search pretty far back.
>
> here is where the original -C behavior comes from:
>
> http://lists.baseurl.org/pipermail/rpm-metadata/2006-July/000663.html
>
And looking back further - the original behavior was getmtime() but Pete
found some problems with the reliability of mtime() for the check.
I don't remember the _why_ there, though.
-sv
More information about the Rpm-metadata
mailing list