[zypp-devel] Re: [zypp-commit] r10844 - /trunk/sat-solver/tools/repo_products.c
On Wed, Aug 13, 2008 at 04:06:31PM -0000, kkaempf@svn.opensuse.org wrote:
Author: kkaempf Date: Wed Aug 13 18:06:31 2008 New Revision: 10844
URL: http://svn.opensuse.org/viewcvs/zypp?rev=10844&view=rev Log: provide solvable:installtime for product solvables [...] if (!s) { + struct stat st; + s = pool_id2solvable(pool, repo_add_solvable(repo)); repodata_extend(data, s - pool->solvables); handle = repodata_get_handle(data, s - pool->solvables - repo->start); + if (!fstat(fileno(fp), &st)) + { + repodata_set_num(data, handle, SOLVABLE_INSTALLTIME, st.st_ctime);
That's the last inode change time. Don't you mean "st.st_mtime"? Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
* Michael Schroeder
On Wed, Aug 13, 2008 at 04:06:31PM -0000, kkaempf@svn.opensuse.org wrote:
Author: kkaempf Date: Wed Aug 13 18:06:31 2008 New Revision: 10844
URL: http://svn.opensuse.org/viewcvs/zypp?rev=10844&view=rev Log: provide solvable:installtime for product solvables [...] if (!s) { + struct stat st; + s = pool_id2solvable(pool, repo_add_solvable(repo)); repodata_extend(data, s - pool->solvables); handle = repodata_get_handle(data, s - pool->solvables - repo->start); + if (!fstat(fileno(fp), &st)) + { + repodata_set_num(data, handle, SOLVABLE_INSTALLTIME, st.st_ctime);
That's the last inode change time. Don't you mean "st.st_mtime"?
Thanks for catching this. Actually, I was unsure what to use for a 'product' _install_time. st_mtime didn't seem right since modification != installation. So I choose st_ctime, assuming that inode changes are less likely. Klaus -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Thu, Aug 21, 2008 at 10:47:52PM +0200, Klaus Kaempf wrote:
* Michael Schroeder
[Aug 21. 2008 20:44]: On Wed, Aug 13, 2008 at 04:06:31PM -0000, kkaempf@svn.opensuse.org wrote:
Author: kkaempf Date: Wed Aug 13 18:06:31 2008 New Revision: 10844
URL: http://svn.opensuse.org/viewcvs/zypp?rev=10844&view=rev Log: provide solvable:installtime for product solvables [...] if (!s) { + struct stat st; + s = pool_id2solvable(pool, repo_add_solvable(repo)); repodata_extend(data, s - pool->solvables); handle = repodata_get_handle(data, s - pool->solvables - repo->start); + if (!fstat(fileno(fp), &st)) + { + repodata_set_num(data, handle, SOLVABLE_INSTALLTIME, st.st_ctime);
That's the last inode change time. Don't you mean "st.st_mtime"?
Thanks for catching this.
Actually, I was unsure what to use for a 'product' _install_time. st_mtime didn't seem right since modification != installation. So I choose st_ctime, assuming that inode changes are less likely.
Well, traditionally access time change is also a inode change, thus ctime changed on every file access. Linux seems to be different here, file access seems to only change atime. Anyway, every write changes both ctime and mtime, so mtime is the one that changes the fewest. Unix doesn't maintain a 'creation time' at all. Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
* Michael Schroeder
Well, traditionally access time change is also a inode change, thus ctime changed on every file access. Linux seems to be different here, file access seems to only change atime. Anyway, every write changes both ctime and mtime, so mtime is the one that changes the fewest.
Then lets use mtime.
Unix doesn't maintain a 'creation time' at all.
Bummer ! Klaus -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (2)
-
Klaus Kaempf
-
Michael Schroeder