ref true/false
This commit is contained in:
24
src/main.rs
24
src/main.rs
@@ -133,9 +133,10 @@ fn process_config_item(options: &Options, config_item: &OSSBackupdConfigItem,
|
|||||||
let zip_file = || {
|
let zip_file = || {
|
||||||
if let Err(e) = zip_util::compress_file(target, temp_zip_file) {
|
if let Err(e) = zip_util::compress_file(target, temp_zip_file) {
|
||||||
print_error(&format!("Error in zip file: {}, at item index: {}", e, item_index));
|
print_error(&format!("Error in zip file: {}, at item index: {}", e, item_index));
|
||||||
return false;
|
false
|
||||||
};
|
} else {
|
||||||
true
|
true
|
||||||
|
}
|
||||||
};
|
};
|
||||||
#[cfg(feature = "use_zip")]
|
#[cfg(feature = "use_zip")]
|
||||||
let zip_file = || {
|
let zip_file = || {
|
||||||
@@ -143,9 +144,10 @@ fn process_config_item(options: &Options, config_item: &OSSBackupdConfigItem,
|
|||||||
cmd.args(&["-r", temp_zip_file, target]);
|
cmd.args(&["-r", temp_zip_file, target]);
|
||||||
if let Err(e) = rust_util::util_cmd::run_command_and_wait(&mut cmd) {
|
if let Err(e) = rust_util::util_cmd::run_command_and_wait(&mut cmd) {
|
||||||
print_message(MessageType::ERROR, &format!("Error in zip file: {}, at item index: {}", e, item_index));
|
print_message(MessageType::ERROR, &format!("Error in zip file: {}, at item index: {}", e, item_index));
|
||||||
return false;
|
false
|
||||||
|
} else {
|
||||||
|
true
|
||||||
}
|
}
|
||||||
true
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if !zip_file() {
|
if !zip_file() {
|
||||||
@@ -166,9 +168,10 @@ fn process_config_item(options: &Options, config_item: &OSSBackupdConfigItem,
|
|||||||
if let Err(e) = open_pgp_tool.encrypt_file(temp_zip_file, temp_pgp_file, false) {
|
if let Err(e) = open_pgp_tool.encrypt_file(temp_zip_file, temp_pgp_file, false) {
|
||||||
print_message(MessageType::ERROR, &format!("Error in encrypt file: {}, at item index: {}", e, item_index));
|
print_message(MessageType::ERROR, &format!("Error in encrypt file: {}, at item index: {}", e, item_index));
|
||||||
remove_temp_files();
|
remove_temp_files();
|
||||||
return false;
|
false
|
||||||
};
|
} else {
|
||||||
true
|
true
|
||||||
|
}
|
||||||
};
|
};
|
||||||
#[cfg(not(feature = "use_sequoia_openpgp"))]
|
#[cfg(not(feature = "use_sequoia_openpgp"))]
|
||||||
let enc_file_by_pgp = || {
|
let enc_file_by_pgp = || {
|
||||||
@@ -176,9 +179,10 @@ fn process_config_item(options: &Options, config_item: &OSSBackupdConfigItem,
|
|||||||
cmd.args(&["-e", "-r", encrypt_pubkey_file, "-o", temp_pgp_file, temp_zip_file]);
|
cmd.args(&["-e", "-r", encrypt_pubkey_file, "-o", temp_pgp_file, temp_zip_file]);
|
||||||
if let Err(e) = rust_util::util_cmd::run_command_and_wait(&mut cmd) {
|
if let Err(e) = rust_util::util_cmd::run_command_and_wait(&mut cmd) {
|
||||||
print_error(&format!("Error in encrypt file: {}, at item index: {}", e, item_index));
|
print_error(&format!("Error in encrypt file: {}, at item index: {}", e, item_index));
|
||||||
return false;
|
false
|
||||||
|
} else {
|
||||||
|
true
|
||||||
}
|
}
|
||||||
true
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if !enc_file_by_pgp() {
|
if !enc_file_by_pgp() {
|
||||||
|
|||||||
Reference in New Issue
Block a user