On 01/03/2026 04:12, Collin Funk wrote:
Hi Frank,

Apologies for the delayed response.

You wrote:

% install -C -p x y
install: options --compare (-C) and --preserve-timestamps are mutually exclusive
Try 'install --help' for more information.

[...]

I see no explanation there why these options should be mutually exclusive.
(RTFS did not reveal any insight either.)

If the error message is unnecessary, please remove it.

Otherwise, please provide an explanation why and possible workarounds.

What I want to achieve is to preserve timestamps and to avoid doing extra work.
Both goals seem rather natural, and I see no reason why they should not be 
combined.

(In fact it seems "-p" should make it *easier* to implement "-C" as
timestamps will compare equal when nothing's changed. Then again,
need_copy() doesn't seem to care about times at all, so why should
it be incompatible with "-p"?)

The rationale for this was posted on the mailing list when the '-C'
option was introduce. Here is the relevant text [1]:

With this option install checks an existing destination file and if it is not
different (by content, owner, group and mode) from source, the file is not
installed. Preserving destination's original mtime can significantly decrease
time of building when a system library is reinstalled but the header files
are not changed at all.

I'm not sure if that is still the case today.

I think I am okay with allowing the combination, but lets see if anyone
else has differing opinions. I might be missing some history here.

Collin

[1] https://lists.gnu.org/archive/html/bug-coreutils/2009-01/msg00122.html

Yes I can see the intent of disallowing -p with -C.
I.e. if there is no content,ownership,perm change
then don't update anything in the destination, including timestamps.
I.e. -C is for performance, and -p would lose some of that.

However if the user explicitly wants the timestamps updated
there should be no problem with that.
As for performance implications, there may be some, especially for repeated 
install runs,
as the updated mtime would be written to disk and the meta-data cache
would be invalidated.
But if the user wants up to date mtime then it doesn't completely invalidate
the performance obtained with -C, as the page cache shouldn't be invalidated,
and we would still be avoiding data writes.

cheers,
Padraig



Reply via email to