Skip to content

Conversation

hz2
Copy link
Contributor

@hz2 hz2 commented Apr 5, 2025

  • added logic to check in copy_source after resolving src and dst to compare
    timestamps
    • if dst is newer, we skip the operation and prevent prompting the user
    • else, proceed to copy

Fixes #7660

Copy link

github-actions bot commented Apr 6, 2025

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)

@cakebaker
Copy link
Contributor

Can you please run the tests? Your solution currently breaks two tests.

@hz2
Copy link
Contributor Author

hz2 commented Apr 7, 2025

sorry about that, not sure how i missed that.

Copy link

github-actions bot commented Apr 7, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/cp/cp-i is no longer failing!

@sylvestre
Copy link
Contributor

Congrats! The gnu test tests/cp/cp-i is no longer failing!

nice!

two things:

  • please add a test
  • clippy isn't happy :)
    thanks

Copy link

github-actions bot commented Apr 8, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/cp/cp-i is no longer failing!

@hz2
Copy link
Contributor Author

hz2 commented Apr 8, 2025

Apologizes for the failed checks still, could I get some help/clarification on the errors I'm seeing?

Are these failed tests actionable for me? If so, are there starting steps I should take?

The patience and feedback is much appreciated!

@cakebaker
Copy link
Contributor

@hz2 no, those failing tests are unrelated to your PR.

hz2 and others added 2 commits April 10, 2025 07:06
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
@hz2
Copy link
Contributor Author

hz2 commented Apr 10, 2025

@cakebaker much cleaner, thank you!

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/cp/cp-i is no longer failing!

@cakebaker cakebaker merged commit cd2b56e into uutils:main Apr 10, 2025
69 checks passed
@cakebaker
Copy link
Contributor

Thanks for your PR :)

nickorlow pushed a commit to nickorlow/coreutils that referenced this pull request Jul 17, 2025
* added logic to check if we are updating the file and the destination is newer, to skip copying

* corrected logic to handle cp update

* - added test case that mocks the issue described in uutils#7660
- adjusted conditions to satisfy clippy

* typo

* Update src/uu/cp/src/cp.rs

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* Update tests/by-util/test_cp.rs

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cp: -i --update=none prompts but shouldn't
3 participants