Open TheDcoder opened 1 year ago
Found in the wild here:
echo 'g keyd' | install -Dm644 /dev/stdin "${pkgdir}/usr/lib/sysusers.d/${pkgname%-git}.conf"
I checked the source code and install
just uses std::fs::copy
, which indeed doesn't handle that case. cp
has a more complicated procedure which falls back to copying the contents. I think it might make sense to extract that procedure to uucore
and share it between the two utils. Could also be fun to make it a separate crate later too, because it might be useful for other projects to have a more flexible copy
function, but let's start with uucore
.
Wondering if this (moving cp code to uucore
) could be a good "first step" for https://github.com/uutils/coreutils/issues/5203 ?
Checked right now, works correctly. Perhaps the issue should be closed?
What fixed the issue? :thinking:
I don't know, but this issue seems to be quite old. Perhaps somebody fixed it and forgot to mark this as complete.
GNU coreutils accepts special files like
/dev/stdin
without any issues, for e.g.:That creates a file called
test
withfoo\n
as its contents, which isn't surprising.However our coreutils fail with the same usage with this error:
This issue doesn't effect
cp
, however it might effect other utils which haven't been tested.