From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 15 13:57:31 2023 Received: (at submit) by debbugs.gnu.org; 15 Feb 2023 18:57:32 +0000 Received: from localhost ([127.0.0.1]:34022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSMyB-0001Rw-HJ for submit@debbugs.gnu.org; Wed, 15 Feb 2023 13:57:31 -0500 Received: from lists.gnu.org ([209.51.188.17]:35048) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSMy5-0001Rj-E9 for submit@debbugs.gnu.org; Wed, 15 Feb 2023 13:57:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSMy4-0007LY-W3 for bug-coreutils@gnu.org; Wed, 15 Feb 2023 13:57:25 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSMy4-0007ub-NM for bug-coreutils@gnu.org; Wed, 15 Feb 2023 13:57:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Subject:To:MIME-Version:From:Date:in-reply-to: references; bh=tMLb/6vfzyPp3b8JBV/SHpfX1gDqKRcYO35GsMr+oGY=; b=DtBXWluziQkg6s m5Sdq79rBBY0Da4Z/8hdNCUAciUr0UpLMCU7ZWi6+ahHzyj/9Y4fEMToWtaxGu3rKBSDVt8sH6r1O /fJKrNWyvzZ3sKHcMG+aF47LHBk9CI0cZx6K/HYjUjKPqNBcT55LRTcgzYY+yrDZuw68DBzFS1/9d z5csxObV+Cwgyl4ee2mTsPa6CvPZbk/EJHXcxOBxTBDaIuXBgIVQA5zJ3056J3dQVk4gXZceuGczw +1H0fBLoUu//XRz41YT1eKbdemVBhqTXzJUiWn/ztNf4fF3Pft+W8xV8zcP8BRhA2vXSfiM4jvjGl eRYagcRex2GmsiOu26Dg==; Received: from 93.red-81-34-173.dynamicip.rima-tde.net ([81.34.173.93] helo=[192.168.1.2]) by fencepost.gnu.org with esmtpsa (TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1pSMy3-0000Ks-UV; Wed, 15 Feb 2023 13:57:24 -0500 Message-ID: <63ED2B4E.6070105@gnu.org> Date: Wed, 15 Feb 2023 19:58:22 +0100 From: Antonio Diaz Diaz User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 MIME-Version: 1.0 To: bug-coreutils@gnu.org Subject: [Bug-coreutils] 'cp -au' re-copies (removes and relinks) hard links that are up to date Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: Antonio Diaz Diaz X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello. I have been forced recently to update my coreutils 8.11 (because 'touch' in 8.11 didn't understand the dates with a 'T' separator passed to it by the configure of another GNU package I was installing) and have found that 'cp -au' now re-copies (removes and relinks) hard links that are up to date and it didn't recopy with 8.11. I have tried coreutils 8.23 and 9.1, but I think all versions after 8.11 have this problem. To illustrate the problem, I first create a directory 'src' containing two linked files and then make a copy of 'src' in 'dest': $ md src $ echo "foo" > src/a $ ln src/a src/b $ cp -auv src dest 'src' -> 'dest' 'src/a' -> 'dest/a' 'src/b' -> 'dest/b' Now, every time I update 'dest' using 'cp -au', it removes and relinks 'dest/b' in spite of it already being a link to 'dest/a': $ cp -auv src/* dest removed 'dest/b' But with 'cp' from coreutils 8.11, 'dest/b' was not recopied: $ /tmp/coreutils-8.11/src/cp -auv src/* dest $ Can current 'cp' be fixed so that it notices that the destination is already updated, and thus avoids removing and relinking it, just as it did in coreutils 8.11? Thanks, Antonio.