cp: add an option to only copy the file attributes
authorPádraig Brady <P@draigBrady.com>
Mon, 21 Sep 2009 07:43:03 +0000 (08:43 +0100)
committerPádraig Brady <P@draigBrady.com>
Thu, 1 Jul 2010 13:33:27 +0000 (14:33 +0100)
commit1af81dfb4d24d104777b8917544d81097db0deab
tree3030f158798f4246a3b7d38ba9262adb57705849
parent8aa15b2be2bd2ab4b76d197a279abf8b9091680a
cp: add an option to only copy the file attributes

* src/copy.c (copy_attr): A new function which merges copy_attr_by_fd
and copy_attr_by_name.  Also display all errors when --attributes-only
* src/copy.c (copy_reg): Skip copying the file contents if specified.
Refactor the SELinux error handling code a little and display all
SELinux errors when only copying attributes.
* src/copy.h (struct cp_options): Add a data_copy_required boolean
* src/cp.c (main): Default to copying data but don't if specified
* src/install.c: Default to copying data
* src/mv.c: Likewise
tests/cp/reflink-perm: Add a test to check that --attributes-only
does not copy data
* tests/cp/acl: Likewise. Also refactor to remove redundant
acl manipulation
* doc/coreutils.texi (cp invocation): Describe the new option
* NEWS: Mention the new feature
NEWS
doc/coreutils.texi
src/copy.c
src/copy.h
src/cp.c
src/install.c
src/mv.c
tests/cp/acl
tests/cp/reflink-perm