termux-packages/packages/newsboat/rust-libnewsboat-src-fslock.rs.patch
2022-05-05 12:10:44 +05:30

48 lines
2.0 KiB
Diff

--- a/rust/libnewsboat/src/fslock.rs
+++ b/rust/libnewsboat/src/fslock.rs
@@ -1,5 +1,4 @@
use crate::logger::{self, Level};
-use gettextrs::gettext;
use std::fs::{self, File, OpenOptions};
use std::io::{Error, Read, Write};
use std::os::unix::fs::OpenOptionsExt;
@@ -54,10 +53,10 @@
Ok(file) => file,
Err(reason) => {
return Err(fmt!(
- &gettext("Failed to open lock file '%s': %s"),
+ "Failed to open lock file '%s': %s",
new_lock_path
.to_str()
- .unwrap_or(&gettext("<filename containing invalid UTF-8 codepoint>")),
+ .unwrap_or("<filename containing invalid UTF-8 codepoint>"),
reason.to_string()
))
}
@@ -74,10 +73,10 @@
if let Err(reason) = file.set_len(0).and_then(|_| file.write_all(pid.as_bytes())) {
log!(Level::Debug, "FsLock: Failed to write PID");
return Err(fmt!(
- &gettext("Failed to write PID to lock file '%s': %s"),
+ "Failed to write PID to lock file '%s': %s",
new_lock_path
.to_str()
- .unwrap_or(&gettext("<filename containing invalid UTF-8 codepoint>")),
+ .unwrap_or("<filename containing invalid UTF-8 codepoint>"),
reason.to_string()
));
}
@@ -106,10 +105,10 @@
pid
);
Err(fmt!(
- &gettext("Failed to lock '%s', already locked by process with PID %s"),
+ "Failed to lock '%s', already locked by process with PID %s",
new_lock_path
.to_str()
- .unwrap_or(&gettext("<filename containing invalid UTF-8 codepoint>")),
+ .unwrap_or("<filename containing invalid UTF-8 codepoint>"),
&(*pid).to_string()
))
}