diff options
author | Norbert Preining <norbert@preining.info> | 2022-01-16 03:01:19 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-01-16 03:01:19 +0000 |
commit | a574e957682cad50981ddb567c2a106213dc8672 (patch) | |
tree | cd02ecf7773fd7bad8e7b6cdb07cf2ff437ba59f /support/pkgcheck/src/utils.rs | |
parent | 0cb730e5737ffa35f797eaf75c2613e5ac88617c (diff) |
CTAN sync 202201160301
Diffstat (limited to 'support/pkgcheck/src/utils.rs')
-rw-r--r-- | support/pkgcheck/src/utils.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/support/pkgcheck/src/utils.rs b/support/pkgcheck/src/utils.rs index a8f2d56c0f..860b8c223b 100644 --- a/support/pkgcheck/src/utils.rs +++ b/support/pkgcheck/src/utils.rs @@ -15,6 +15,8 @@ use std::sync::atomic::Ordering; use std::fs; +use zip_extensions::*; + #[derive(Debug, Clone, PartialEq, Eq)] pub enum CheckType { Tds, @@ -174,6 +176,13 @@ impl Utils { } } } + + pub fn unzip(&self, zip_archive: &str, out_dir: &str) -> zip::result::ZipResult<()> { + let archive_file = PathBuf::from(zip_archive); + let target_dir = PathBuf::from(out_dir); + + zip_extract(&archive_file, &target_dir) + } } pub fn temp_file_endings() -> Vec<(String, String)> { @@ -267,6 +276,7 @@ pub fn temp_file_endings() -> Vec<(String, String)> { (".w18", "temporary file for the ifplatform package"), (".xdv", "intermediate document"), (".xref", "htlatex related"), + (".xray", "dump of \\show output"), ("~", "a file name ending with ~ (tilde) is temporary anyway"), // ( ".lyx~", "LyX related backup file" ), ]; @@ -414,7 +424,7 @@ pub fn run_cmd(cmd: &str, argument: &[&str]) -> CmdReturn { let output = Command::new(cmd) .args(argument.iter()) .output() - .expect("Failed to execute process"); + .unwrap_or_else(|_| panic!("Failed to execute process `{}`", cmd)); if output.status.success() { CmdReturn { |