GNU bug report logs - #70727
cp doesn't recognize the new --update=none-fail option

Previous Next

Package: coreutils;

Reported by: Attila Fidan <dev <at> print0.net>

Date: Fri, 3 May 2024 04:42:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

To reply to this bug, email your comments to 70727 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#70727; Package coreutils. (Fri, 03 May 2024 04:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Attila Fidan <dev <at> print0.net>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Fri, 03 May 2024 04:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Attila Fidan <dev <at> print0.net>
To: bug-coreutils <at> gnu.org
Subject: cp doesn't recognize the new --update=none-fail option
Date: Fri, 3 May 2024 04:12:34 +0000
Hi,

I wanted to use the new cp --update=none-fail option introduced in 9.5,
but it said "invalid argument ‘none-fail’ for ‘--update’". It turns out
that the commit (49912bac286eb3c0ef7d1567ae790193ad5eb2e8) adding it
forgot to add the new operation to update_type[] and
update_type_string[] in cp.c like it did for mv.c. After patching
coreutils locally the functionality works as expected.

It seems like the test suite didn't catch this because there's no
cp/update.sh test like there is for mv. There's a test for if using
--backup and --update=none-fail are mutually exclusive by checking if cp
returns 1, but an invalid argument also makes cp return 1 :)

I didn't include a patch in case a change to the test suite is wanted,
but the proposed change is tiny and rather obvious.

Thanks!




Reply sent to Pádraig Brady <P <at> draigBrady.com>:
You have taken responsibility. (Fri, 03 May 2024 09:28:01 GMT) Full text and rfc822 format available.

Notification sent to Attila Fidan <dev <at> print0.net>:
bug acknowledged by developer. (Fri, 03 May 2024 09:28:02 GMT) Full text and rfc822 format available.

Message #10 received at 70727-done <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Attila Fidan <dev <at> print0.net>, 70727-done <at> debbugs.gnu.org
Subject: Re: bug#70727: cp doesn't recognize the new --update=none-fail option
Date: Fri, 3 May 2024 10:26:40 +0100
[Message part 1 (text/plain, inline)]
On 03/05/2024 05:12, Attila Fidan via GNU coreutils Bug Reports wrote:
> Hi,
> 
> I wanted to use the new cp --update=none-fail option introduced in 9.5,
> but it said "invalid argument ‘none-fail’ for ‘--update’". It turns out
> that the commit (49912bac286eb3c0ef7d1567ae790193ad5eb2e8) adding it
> forgot to add the new operation to update_type[] and
> update_type_string[] in cp.c like it did for mv.c. After patching
> coreutils locally the functionality works as expected.
> 
> It seems like the test suite didn't catch this because there's no
> cp/update.sh test like there is for mv. There's a test for if using
> --backup and --update=none-fail are mutually exclusive by checking if cp
> returns 1, but an invalid argument also makes cp return 1 :)
> 
> I didn't include a patch in case a change to the test suite is wanted,
> but the proposed change is tiny and rather obvious.

Well that's embarrassing.
I implemented in cp first, tested that manually,
then must have messed up that hunk when rebasing.

The attached should fix this.

Marking this as done.

thanks,
Pádraig.
[cp--update=none-fail.patch (text/x-patch, attachment)]

This bug report was last modified 15 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.