install: add --compare (-C) option to install file only when necessary
authorKamil Dudka <kdudka@redhat.com>
Tue, 17 Feb 2009 12:16:54 +0000 (13:16 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 17 Feb 2009 13:12:44 +0000 (14:12 +0100)
commitdac5f12c6ed1225bfb8043d9ff7227d29439a955
treed736baa51d46a7c6b53fe93aed03acb12c73f27e
parent26d3d090bd08ff36b1f66af8d4b7974c5d5b6a95
install: add --compare (-C) option to install file only when necessary

* src/install.c (have_same_content): New function to compare files
content.
(extra_mode): New function checking for non-permission bits in mode.
(need_copy): New function to check if copy is necessary.
(main): Handle new option --compare (-C).
(copy_file): Skip file copying if not necessary.
(usage): Show new option --compare (-C) in --help.
* tests/install/install-C: Basic tests for install --compare (-C).
* tests/install/install-C-root: Tests requiring root privileges.
* tests/install/install-C-selinux: Tests requiring SELinux.
* tests/Makefile.am: Add new tests for install --compare (-C).
* doc/coreutils.texi: Document new install option --compare (-C).
* NEWS: Mention the change.
NEWS
doc/coreutils.texi
src/install.c
tests/Makefile.am
tests/install/install-C [new file with mode: 0755]
tests/install/install-C-root [new file with mode: 0755]
tests/install/install-C-selinux [new file with mode: 0755]