From unknown Wed Jun 25 05:43:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#5947: [PATCH] cp: add an option to only copy the file attributes Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 14 Apr 2010 15:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 5947 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: patch To: 5947@debbugs.gnu.org X-Debbugs-Original-To: Report bugs to Received: via spool by submit@debbugs.gnu.org id=B.12712593274329 (code B ref -1); Wed, 14 Apr 2010 15:36:01 +0000 Received: (at submit) by debbugs.gnu.org; 14 Apr 2010 15:35:27 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O24cf-00017m-Rl for submit@debbugs.gnu.org; Wed, 14 Apr 2010 11:35:27 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O24cd-00017h-7T for submit@debbugs.gnu.org; Wed, 14 Apr 2010 11:35:24 -0400 Received: from lists.gnu.org ([199.232.76.165]:35315) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1O24cY-0003ay-CZ for submit@debbugs.gnu.org; Wed, 14 Apr 2010 11:35:18 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O24cX-0007BK-UP for bug-coreutils@gnu.org; Wed, 14 Apr 2010 11:35:17 -0400 Received: from [140.186.70.92] (port=34469 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O24cW-0007A4-0o for bug-coreutils@gnu.org; Wed, 14 Apr 2010 11:35:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.0 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O24cS-0001fO-HX for bug-coreutils@gnu.org; Wed, 14 Apr 2010 11:35:15 -0400 Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:13525) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1O24cS-0001ep-4r for bug-coreutils@gnu.org; Wed, 14 Apr 2010 11:35:12 -0400 Received: (qmail 2437 invoked from network); 14 Apr 2010 15:35:09 -0000 Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218) by mail1.slb.deg.dub.stisp.net with SMTP; 14 Apr 2010 15:35:09 -0000 Message-ID: <4BC5E08B.2010706@draigBrady.com> Date: Wed, 14 Apr 2010 16:34:35 +0100 From: =?UTF-8?Q?P=C3=A1draig?= Brady User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 X-Enigmail-Version: 1.0.1 Content-Type: multipart/mixed; boundary="------------040405080609010405060502" X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -3.9 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.2 (-----) This is a multi-part message in MIME format. --------------040405080609010405060502 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit >From the NEWS of the attached patch: "cp now accepts the --attributes-only option to not copy file data, which is useful for efficiently modifying files." For an example script that uses this option see: http://lists.gnu.org/archive/html/bug-coreutils/2010-03/msg00261.html cheers, Pádraig. --------------040405080609010405060502 Content-Type: text/x-patch; name="cp-attributes-only.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cp-attributes-only.diff" >From 09e1d49eb1e853487fc983176660908b133fb2d9 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?P=C3=A1draig=20Brady?= Date: Mon, 21 Sep 2009 08:43:03 +0100 Subject: [PATCH] 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. Display all errors when only copying attributes * 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 | 3 ++ doc/coreutils.texi | 6 +++ src/copy.c | 88 +++++++++++++++++++++++-------------------------- src/copy.h | 4 ++ src/cp.c | 10 +++++- src/install.c | 1 + src/mv.c | 1 + tests/cp/acl | 19 ++++++---- tests/cp/reflink-perm | 4 ++ 9 files changed, 80 insertions(+), 56 deletions(-) diff --git a/NEWS b/NEWS index 2be9633..a50c35d 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,9 @@ GNU coreutils NEWS -*- outline -*- ** New features + cp now accepts the --attributes-only option to not copy file data, + which is useful for efficiently modifying files. + join now accepts the --header option, to treat the first line of each file as a header line to be joined and printed unconditionally. diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 7561f2a..a3748e4 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -7346,6 +7346,12 @@ Try to preserve SELinux security context and extended attributes (xattr), but ignore any failure to do that and print no corresponding diagnostic. Equivalent to @option{-dR --preserve=all} with the reduced diagnostics. +@itemx --attributes-only +@opindex --attributes-only +Preserve the specified attributes of the original files in the copy, +but do not copy any data. See the @option{--preserve} option for +controlling which attributes to copy. + @item -b @itemx @w{@kbd{--backup}[=@var{method}]} @opindex -b diff --git a/src/copy.c b/src/copy.c index 0fa148e..381bdc6 100644 --- a/src/copy.c +++ b/src/copy.c @@ -179,11 +179,11 @@ static void copy_attr_error (struct error_context *ctx ATTRIBUTE_UNUSED, char const *fmt, ...) { - int err = errno; - va_list ap; - if (!errno_unsupported (errno)) { + int err = errno; + va_list ap; + /* use verror module to print error message */ va_start (ap, fmt); verror (0, err, fmt, ap); @@ -216,51 +216,43 @@ copy_attr_free (struct error_context *ctx ATTRIBUTE_UNUSED, { } -static bool -copy_attr_by_fd (char const *src_path, int src_fd, - char const *dst_path, int dst_fd, const struct cp_options *x) -{ - struct error_context ctx = - { - .error = x->require_preserve_xattr ? copy_attr_allerror : copy_attr_error, - .quote = copy_attr_quote, - .quote_free = copy_attr_free - }; - return 0 == attr_copy_fd (src_path, src_fd, dst_path, dst_fd, 0, - (x->reduce_diagnostics - && !x->require_preserve_xattr)? NULL : &ctx); -} +/* If valid SRC_FD and DST_FD descriptors are passed, + then copy by fd, otherwise copy by name. */ static bool -copy_attr_by_name (char const *src_path, char const *dst_path, - const struct cp_options *x) +copy_attr (char const *src_path, int src_fd, + char const *dst_path, int dst_fd, const struct cp_options *x) { + int ret; + bool all_errors = (!x->data_copy_required || x->require_preserve_xattr); + bool some_errors = (!all_errors && !x->reduce_diagnostics); struct error_context ctx = { - .error = x->require_preserve_xattr ? copy_attr_allerror : copy_attr_error, + .error = all_errors ? copy_attr_allerror : copy_attr_error, .quote = copy_attr_quote, .quote_free = copy_attr_free }; - return 0 == attr_copy_file (src_path, dst_path, 0, - (x-> reduce_diagnostics - && !x->require_preserve_xattr) ? NULL : &ctx); -} -#else /* USE_XATTR */ + if (src_fd > 0 && dst_fd > 0) + { + ret = attr_copy_fd (src_path, src_fd, dst_path, dst_fd, 0, + ((all_errors || some_errors) ? &ctx : NULL)); + } + else + { + ret = attr_copy_file (src_path, dst_path, 0, + ((all_errors || some_errors) ? &ctx : NULL)); + } -static bool -copy_attr_by_fd (char const *src_path ATTRIBUTE_UNUSED, - int src_fd ATTRIBUTE_UNUSED, - char const *dst_path ATTRIBUTE_UNUSED, - int dst_fd ATTRIBUTE_UNUSED, - const struct cp_options *x ATTRIBUTE_UNUSED) -{ - return true; + return ret == 0; } +#else /* USE_XATTR */ static bool -copy_attr_by_name (char const *src_path ATTRIBUTE_UNUSED, - char const *dst_path ATTRIBUTE_UNUSED, - const struct cp_options *x ATTRIBUTE_UNUSED) +copy_attr (char const *src_path ATTRIBUTE_UNUSED, + int src_fd ATTRIBUTE_UNUSED, + char const *dst_path ATTRIBUTE_UNUSED, + int dst_fd ATTRIBUTE_UNUSED, + const struct cp_options *x ATTRIBUTE_UNUSED) { return true; } @@ -485,7 +477,7 @@ copy_reg (char const *src_name, char const *dst_name, struct stat sb; struct stat src_open_sb; bool return_val = true; - bool data_copy_required = true; + bool data_copy_required = x->data_copy_required; source_desc = open (src_name, (O_RDONLY | O_BINARY @@ -528,11 +520,14 @@ copy_reg (char const *src_name, char const *dst_name, that is used when the destination file doesn't already exist. */ if (x->preserve_security_context && 0 <= dest_desc) { + bool all_errors = !x->data_copy_required || + x->require_preserve_context; + bool some_errors = !all_errors && !x->reduce_diagnostics; security_context_t con = NULL; + if (getfscreatecon (&con) < 0) { - if (x->require_preserve_context || - (!x->reduce_diagnostics && !errno_unsupported (errno))) + if (all_errors || (some_errors && !errno_unsupported (errno))) error (0, errno, _("failed to get file system create context")); if (x->require_preserve_context) { @@ -545,8 +540,7 @@ copy_reg (char const *src_name, char const *dst_name, { if (fsetfilecon (dest_desc, con) < 0) { - if (x->require_preserve_context || - (!x->reduce_diagnostics && !errno_unsupported (errno))) + if (all_errors || (some_errors && !errno_unsupported (errno))) error (0, errno, _("failed to set the security context of %s to %s"), quote_n (0, dst_name), quote_n (1, con)); @@ -836,7 +830,7 @@ copy_reg (char const *src_name, char const *dst_name, if (!(sb.st_mode & S_IWUSR) && geteuid () != 0) access_changed = fchmod_or_lchmod (dest_desc, dst_name, 0600) == 0; - if (!copy_attr_by_fd (src_name, source_desc, dst_name, dest_desc, x) + if (!copy_attr (src_name, source_desc, dst_name, dest_desc, x) && x->require_preserve_xattr) return_val = false; @@ -1821,14 +1815,15 @@ copy_internal (char const *src_name, char const *dst_name, if (x->preserve_security_context) { + bool all_errors = !x->data_copy_required || x->require_preserve_context; + bool some_errors = !all_errors && !x->reduce_diagnostics; security_context_t con; if (0 <= lgetfilecon (src_name, &con)) { if (setfscreatecon (con) < 0) { - if (x->require_preserve_context || - (!x->reduce_diagnostics && !errno_unsupported (errno))) + if (all_errors || (some_errors && !errno_unsupported (errno))) error (0, errno, _("failed to set default file creation context to %s"), quote (con)); @@ -1842,8 +1837,7 @@ copy_internal (char const *src_name, char const *dst_name, } else { - if (x->require_preserve_context || - (!x->reduce_diagnostics && !errno_unsupported (errno))) + if (all_errors || (some_errors && !errno_unsupported (errno))) { error (0, errno, _("failed to get security context of %s"), @@ -2168,7 +2162,7 @@ copy_internal (char const *src_name, char const *dst_name, set_author (dst_name, -1, &src_sb); - if (x->preserve_xattr && ! copy_attr_by_name (src_name, dst_name, x) + if (x->preserve_xattr && ! copy_attr (src_name, -1, dst_name, -1, x) && x->require_preserve_xattr) return false; diff --git a/src/copy.h b/src/copy.h index 59e29f5..5782431 100644 --- a/src/copy.h +++ b/src/copy.h @@ -170,6 +170,10 @@ struct cp_options will be hard links to the same file (a copy of F). */ bool preserve_links; + /* Optionally copy the data either with CoW reflink files or + explicitly with the --attributes-only option. */ + bool data_copy_required; + /* If true and any of the above (for preserve) file attributes cannot be applied to a destination file, treat it as a failure and return nonzero immediately. E.g. for cp -p this must be true, for mv it diff --git a/src/cp.c b/src/cp.c index cc958d1..13ce9e0 100644 --- a/src/cp.c +++ b/src/cp.c @@ -72,7 +72,8 @@ struct dir_attr non-character as a pseudo short option, starting with CHAR_MAX + 1. */ enum { - COPY_CONTENTS_OPTION = CHAR_MAX + 1, + ATTRIBUTES_ONLY_OPTION = CHAR_MAX + 1, + COPY_CONTENTS_OPTION, NO_PRESERVE_ATTRIBUTES_OPTION, PARENTS_OPTION, PRESERVE_ATTRIBUTES_OPTION, @@ -115,6 +116,7 @@ ARGMATCH_VERIFY (reflink_type_string, reflink_type); static struct option const long_opts[] = { {"archive", no_argument, NULL, 'a'}, + {"attributes-only", no_argument, NULL, ATTRIBUTES_ONLY_OPTION}, {"backup", optional_argument, NULL, 'b'}, {"copy-contents", no_argument, NULL, COPY_CONTENTS_OPTION}, {"dereference", no_argument, NULL, 'L'}, @@ -167,6 +169,7 @@ Mandatory arguments to long options are mandatory for short options too.\n\ "), stdout); fputs (_("\ -a, --archive same as -dR --preserve=all\n\ + --attributes-only don't copy the file data, just the attributes\n\ --backup[=CONTROL] make a backup of each existing destination file\n\ -b like --backup but does not accept an argument\n\ --copy-contents copy contents of special files when recursive\n\ @@ -781,6 +784,7 @@ cp_option_init (struct cp_options *x) x->reduce_diagnostics = false; x->require_preserve_xattr = false; + x->data_copy_required = true; x->require_preserve = false; x->recursive = false; x->sparse_mode = SPARSE_AUTO; @@ -962,6 +966,10 @@ main (int argc, char **argv) version_control_string = optarg; break; + case ATTRIBUTES_ONLY_OPTION: + x.data_copy_required = false; + break; + case COPY_CONTENTS_OPTION: copy_contents = true; break; diff --git a/src/install.c b/src/install.c index bac5c7c..bef7f8a 100644 --- a/src/install.c +++ b/src/install.c @@ -282,6 +282,7 @@ cp_option_init (struct cp_options *x) x->preserve_mode = false; x->preserve_timestamps = false; x->reduce_diagnostics=false; + x->data_copy_required = true; x->require_preserve = false; x->require_preserve_context = false; x->require_preserve_xattr = false; diff --git a/src/mv.c b/src/mv.c index 8a41d16..91aadfa 100644 --- a/src/mv.c +++ b/src/mv.c @@ -119,6 +119,7 @@ cp_option_init (struct cp_options *x) x->preserve_timestamps = true; x->preserve_security_context = selinux_enabled; x->reduce_diagnostics = false; + x->data_copy_required = true; x->require_preserve = false; /* FIXME: maybe make this an option */ x->require_preserve_context = false; x->preserve_xattr = true; diff --git a/tests/cp/acl b/tests/cp/acl index 010348a..0020b37 100755 --- a/tests/cp/acl +++ b/tests/cp/acl @@ -36,28 +36,31 @@ grep '^#define USE_ACL 1' $CONFIG_HEADER > /dev/null || mkdir -p a b || framework_failure touch a/file || framework_failure -skip=no # Ensure that setfacl and getfacl work on this file system. +skip=no +acl1=`cd a && getfacl file` || skip=yes setfacl -m user:bin:rw a/file 2> /dev/null || skip=yes -acl1=`cd a && getfacl file | grep -v ':bin:' | grep -v 'mask::'` \ - || skip=yes - test $skip = yes && skip_test_ "'.' is not on a suitable file system for this test" # copy a file without preserving permissions cp a/file b/ || fail=1 - acl2=`cd b && getfacl file` || framework_failure test "$acl1" = "$acl2" || fail=1 -rm a/file || framework_failure # copy a file, preserving permissions -touch a/file || framework_failure -setfacl -m user:bin:rw a/file || framework_failure acl1=`cd a && getfacl file` || framework_failure cp -p a/file b/ || fail=1 acl2=`cd b && getfacl file` || framework_failure test "$acl1" = "$acl2" || fail=1 +# copy a file, preserving permissions, with --attributes-only +echo > a/file #add some data +test -s a/file || framework_failure +acl1=`cd a && getfacl file` || framework_failure +cp -p --attributes-only a/file b/ || fail=1 +acl2=`cd b && getfacl file` || framework_failure +test "$acl1" = "$acl2" || fail=1 +test -s b/file && fail=1 + Exit $fail diff --git a/tests/cp/reflink-perm b/tests/cp/reflink-perm index 92cb7ae..ff2e370 100755 --- a/tests/cp/reflink-perm +++ b/tests/cp/reflink-perm @@ -39,4 +39,8 @@ test "$mode" = "-rwxrwxrwx" || fail=1 test copy -nt file && fail=1 +echo > file2 #file with data +cp --reflink=auto --preserve --attributes-only file2 empty_copy || fail=1 +test -s empty_copy && fail=1 + Exit $fail -- 1.6.2.5 --------------040405080609010405060502-- From unknown Wed Jun 25 05:43:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#5947: [PATCH] cp: add an option to only copy the file attributes Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 14 Apr 2010 16:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5947 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: patch To: "Voelker, Bernhard" Cc: "5947@debbugs.gnu.org" <5947@debbugs.gnu.org> Received: via spool by 5947-submit@debbugs.gnu.org id=B5947.12712628758482 (code B ref 5947); Wed, 14 Apr 2010 16:35:01 +0000 Received: (at 5947) by debbugs.gnu.org; 14 Apr 2010 16:34:35 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O25Xu-0002Cl-Q5 for submit@debbugs.gnu.org; Wed, 14 Apr 2010 12:34:35 -0400 Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1O25Xt-0002Cf-M1 for 5947@debbugs.gnu.org; Wed, 14 Apr 2010 12:34:34 -0400 Received: (qmail 17260 invoked from network); 14 Apr 2010 16:34:28 -0000 Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218) by mail1.slb.deg.dub.stisp.net with SMTP; 14 Apr 2010 16:34:28 -0000 Message-ID: <4BC5EE6D.2090005@draigBrady.com> Date: Wed, 14 Apr 2010 17:33:49 +0100 From: =?UTF-8?Q?P=C3=A1draig?= Brady User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 References: <4BC5E08B.2010706@draigBrady.com> <7856072A9D04C24B82DFE2B1112FE38ADA4451D2@MCHP058A.global-ad.net> In-Reply-To: <7856072A9D04C24B82DFE2B1112FE38ADA4451D2@MCHP058A.global-ad.net> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -3.3 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.3 (---) On 14/04/10 17:27, Voelker, Bernhard wrote: > Pádraig Brady wrote: >> "cp now accepts the --attributes-only option to not copy file data, >> which is useful for efficiently modifying files." > > is this like `touch -r ...`? Right, except that it handles permissions and xattrs as well as timestamps. cheers, Pádraig. From unknown Wed Jun 25 05:43:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#5947: [PATCH] cp: add an option to only copy the file attributes Resent-From: "Voelker, Bernhard" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 14 Apr 2010 16:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5947 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: patch To: =?UTF-8?Q?P=C3=A1draig?= Brady , "5947@debbugs.gnu.org" <5947@debbugs.gnu.org> Received: via spool by 5947-submit@debbugs.gnu.org id=B5947.12712637298912 (code B ref 5947); Wed, 14 Apr 2010 16:49:01 +0000 Received: (at 5947) by debbugs.gnu.org; 14 Apr 2010 16:48:49 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O25lg-0002Jg-OA for submit@debbugs.gnu.org; Wed, 14 Apr 2010 12:48:49 -0400 Received: from m0019.fra.mmp.de.bt.com ([62.180.227.30] helo=ms02.m0019.fra.mmp.de.bt.com) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O25Qk-00029L-36 for 5947@debbugs.gnu.org; Wed, 14 Apr 2010 12:27:10 -0400 Received: from senmx12-mx ([62.134.46.10] [62.134.46.10]) by ms02.m0020.fra.mmp.de.bt.com with ESMTP id BT-MMP-1553174; Wed, 14 Apr 2010 18:27:04 +0200 Received: from MCHP063A.global-ad.net (unknown [172.29.37.61]) by senmx12-mx (Server) with ESMTP id 2487E23F0278; Wed, 14 Apr 2010 18:27:04 +0200 (CEST) Received: from MCHP058A.global-ad.net ([172.29.37.55]) by MCHP063A.global-ad.net ([172.29.37.61]) with mapi; Wed, 14 Apr 2010 18:27:04 +0200 From: "Voelker, Bernhard" Date: Wed, 14 Apr 2010 18:27:02 +0200 Thread-Topic: bug#5947: [PATCH] cp: add an option to only copy the file attributes Thread-Index: Acrb7VGafpZVRF+tQmymLV4TnHRyBwAAdBcA Message-ID: <7856072A9D04C24B82DFE2B1112FE38ADA4451D2@MCHP058A.global-ad.net> References: <4BC5E08B.2010706@draigBrady.com> In-Reply-To: <4BC5E08B.2010706@draigBrady.com> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE, en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Spam-Score: -2.6 (--) X-Mailman-Approved-At: Wed, 14 Apr 2010 12:48:47 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) P=E1draig Brady wrote: > "cp now accepts the --attributes-only option to not copy file data, > which is useful for efficiently modifying files." is this like `touch -r ...`? Bye, Berny= From unknown Wed Jun 25 05:43:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#5947: [PATCH] cp: add an option to only copy the file attributes Resent-From: "Voelker, Bernhard" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 14 Apr 2010 16:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5947 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: patch To: =?UTF-8?Q?P=C3=A1draig?= Brady Cc: "5947@debbugs.gnu.org" <5947@debbugs.gnu.org> Received: via spool by 5947-submit@debbugs.gnu.org id=B5947.12712637308917 (code B ref 5947); Wed, 14 Apr 2010 16:49:02 +0000 Received: (at 5947) by debbugs.gnu.org; 14 Apr 2010 16:48:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O25lh-0002Ji-8M for submit@debbugs.gnu.org; Wed, 14 Apr 2010 12:48:49 -0400 Received: from m0019.fra.mmp.de.bt.com ([62.180.227.30] helo=ms01.m0019.fra.mmp.de.bt.com) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O25bc-0002FQ-6v for 5947@debbugs.gnu.org; Wed, 14 Apr 2010 12:38:24 -0400 Received: from senmx11-mx ([62.134.46.9] [62.134.46.9]) by ms01.m0020.fra.mmp.de.bt.com with ESMTP id BT-MMP-1552405; Wed, 14 Apr 2010 18:38:18 +0200 Received: from MCHP064A.global-ad.net (unknown [172.29.37.63]) by senmx11-mx (Server) with ESMTP id 405921EB82AE; Wed, 14 Apr 2010 18:38:18 +0200 (CEST) Received: from MCHP058A.global-ad.net ([172.29.37.55]) by MCHP064A.global-ad.net ([172.29.37.63]) with mapi; Wed, 14 Apr 2010 18:38:18 +0200 From: "Voelker, Bernhard" Date: Wed, 14 Apr 2010 18:38:16 +0200 Thread-Topic: bug#5947: [PATCH] cp: add an option to only copy the file attributes Thread-Index: Acrb8FsMkMPjgHMtRIGW8MwZtchz6AAADE+A Message-ID: <7856072A9D04C24B82DFE2B1112FE38ADA4451D9@MCHP058A.global-ad.net> References: <4BC5E08B.2010706@draigBrady.com> <7856072A9D04C24B82DFE2B1112FE38ADA4451D2@MCHP058A.global-ad.net> <4BC5EE6D.2090005@draigBrady.com> In-Reply-To: <4BC5EE6D.2090005@draigBrady.com> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE, en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Spam-Score: -2.6 (--) X-Mailman-Approved-At: Wed, 14 Apr 2010 12:48:47 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) P=E1draig Brady wrote: > On 14/04/10 17:27, Voelker, Bernhard wrote: >> P=E1draig Brady wrote: >>> "cp now accepts the --attributes-only option to not copy file data, >>> which is useful for efficiently modifying files." >>=20 >> is this like `touch -r ...`? > > Right, except that it handles > permissions and xattrs as well as timestamps. that's cool, thanks. Bye, Berny From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 03 08:37:28 2010 Received: (at control) by debbugs.gnu.org; 3 Jun 2010 12:37:28 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OK9fs-0004c1-JJ for submit@debbugs.gnu.org; Thu, 03 Jun 2010 08:37:28 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OK9fq-0004bw-Dy for control@debbugs.gnu.org; Thu, 03 Jun 2010 08:37:27 -0400 Received: from mx.meyering.net (mx.meyering.net [82.230.74.64]) by smtp1-g21.free.fr (Postfix) with ESMTP id 7A506940162 for ; Thu, 3 Jun 2010 14:37:17 +0200 (CEST) Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 5A07FDA73; Thu, 3 Jun 2010 14:37:16 +0200 (CEST) From: Jim Meyering To: control@debbugs.gnu.org Subject: control Date: Thu, 03 Jun 2010 14:37:16 +0200 Message-ID: <87fx1470n7.fsf@meyering.net> Lines: 1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.3 (--) close 5947