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>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Pádraig Brady <P <at> draigBrady.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#70727: closed (cp doesn't recognize the new --update=none-fail
 option)
Date: Fri, 03 May 2024 09:28:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Fri, 3 May 2024 10:26:40 +0100
with message-id <f967c0ed-7a98-450b-b8a2-c3278a0fcdf5 <at> draigBrady.com>
and subject line Re: bug#70727: cp doesn't recognize the new --update=none-fail option
has caused the debbugs.gnu.org bug report #70727,
regarding cp doesn't recognize the new --update=none-fail option
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
70727: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70727
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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!


[Message part 3 (message/rfc822, inline)]
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 4 (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 1 year and 23 days ago.

Previous Next


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