This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [PATCH] cygcheck -m, --check-mtimes option
- From: Christian Franke <Christian dot Franke at t-online dot de>
- To: cygwin-patches at cygwin dot com
- Date: Wed, 13 Aug 2014 22:20:03 +0200
- Subject: Re: [PATCH] cygcheck -m, --check-mtimes option
- Authentication-results: sourceware.org; auth=none
- References: <53E3DE5D dot 10302 at t-online dot de> <20140808103139 dot GX13601 at calimero dot vinschen dot de> <20140808125135 dot GA13601 at calimero dot vinschen dot de>
Hi Corinna,
Corinna Vinschen wrote:
On Aug 8 12:31, Corinna Vinschen wrote:
Hi Christian,
On Aug 7 22:15, Christian Franke wrote:
Attached is an experimental patch which adds -m, --check-mtimes[=SECONDS]
option to cygcheck. It provides an IMO useful heuristics to find files
possibly modified after installation.
"cygcheck -c -m" prints the number of files with st_mtime >
INSTALL_TIME+SECONDS. INSTALL_TIME is the st_mtime of the
/etc/setup/PACKAGE.lst.gz file.
With -v, the affected path names are printed. The optional parameter SECONDS
defaults to 600 to hide files modified by postinstall scripts.
That's an interesting idea. I just gave it a try. I think this might
be useful,
On second thought, the modification date isn't very meaningful all by
itself, is it? In theory it's only meaningful if the file has changed
as well.
That's why I called it "heuristics" :-)
Consider, what is the user supposed to do with the information
that the file modification date has changed? Where does the user go
from there?
The info is IMO useful to find changed config files, forgotten hot fixed
scripts or other files you possibly want to save before a package is
updated.
It also sometimes exposes package collisions (e.g. libgnutls26/28
provide different versions of cyggnutls-openssl-27.dll or libsasl2/2_3
provide different version of /usr/sbin/saslauthd).
So I'm wondering if the st_mtime check isn't just a starting
point for a test for a file change. OTOH, we have a problem there.
The rudimentary package database in /etc/setup is not very helpful.
It only contains filenames, but no other information on the files.
What would be really cool: Setup generates the package info files in
/etc/setup with additional file size and md5 (sha1, sha256, you name it)
checksum. Then cygcheck could test if st_mtime, st_size and the
checksum match. Or, in a first step, just store and check the file
size.
Yes, this is an obvious missing feature of the Cygwin package
management. I didn't suggest it because my open source spare time is too
limited to implement it :-)
Christian