mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
fix(install): Unbreak the CI by bringing the old behavior for install of /dev/null
This commit is contained in:
parent
e1439dd199
commit
faef7e9214
1 changed files with 5 additions and 7 deletions
|
@ -488,6 +488,10 @@ fn copy_file_to_file(file: &PathBuf, target: &PathBuf, b: &Behavior) -> i32 {
|
||||||
/// If the copy system call fails, we print a verbose error and return an empty error value.
|
/// If the copy system call fails, we print a verbose error and return an empty error value.
|
||||||
///
|
///
|
||||||
fn copy(from: &PathBuf, to: &PathBuf, b: &Behavior) -> Result<(), ()> {
|
fn copy(from: &PathBuf, to: &PathBuf, b: &Behavior) -> Result<(), ()> {
|
||||||
|
if b.compare && !need_copy(from, to, b) {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
if from.to_string_lossy() == "/dev/null" {
|
if from.to_string_lossy() == "/dev/null" {
|
||||||
/* workaround a limitation of fs::copy
|
/* workaround a limitation of fs::copy
|
||||||
* https://github.com/rust-lang/rust/issues/79390
|
* https://github.com/rust-lang/rust/issues/79390
|
||||||
|
@ -501,13 +505,7 @@ fn copy(from: &PathBuf, to: &PathBuf, b: &Behavior) -> Result<(), ()> {
|
||||||
);
|
);
|
||||||
return Err(());
|
return Err(());
|
||||||
}
|
}
|
||||||
}
|
} else if let Err(err) = fs::copy(from, to) {
|
||||||
|
|
||||||
if b.compare && !need_copy(from, to, b) {
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Err(err) = fs::copy(from, to) {
|
|
||||||
show_error!(
|
show_error!(
|
||||||
"cannot install '{}' to '{}': {}",
|
"cannot install '{}' to '{}': {}",
|
||||||
from.display(),
|
from.display(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue