Common copy logic shared between install and cp in uucore? #6872
DaringCuteSeal
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Upon investigating an issue with
install
(#5080) after my package build with Arch Linux'smakepkg
failed, I discovered that the latter bug also affectscp
:Looking at uutils'
install
source code, it seems that it uses the copy functionality fromfs::copy
directly. Sincecp
has some other optimizations (like sparse copying), this makesinstall
less performant in some cases. I took a look at GNU'sinstall
and they seem to havesparse_mode
set to automatic by default to enable copying optimizations. I think that it would be a good idea to place a copy subroutine (that also handles special files) in uucore, as suggested by a comment under the issue I mentioned earlier.Now, if this is relevant, I have some questions in regards to the code migration. How much of
cp
should be moved touucore
? Is it the whole thing—like with GNU's, so we get the wholecp
as API? Or is it just one or a few functions that does copy optimizations directly without other logic handling? The problem with the latter is that bothcp
(the app) and the copy underuucore
would have so much duplicates since they are quite coupled (but I need to make the uucore copy code functional on its own). Besides,uucore
only hasthiserror
whilecp
usesquick-error
and not unifying them would be quite unclean I think.Beta Was this translation helpful? Give feedback.
All reactions