diff --git a/Cargo.lock b/Cargo.lock index 7208771..ab42d04 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -494,7 +494,7 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "squishy" -version = "0.2.1" +version = "0.3.0" dependencies = [ "backhand", "goblin", @@ -504,7 +504,7 @@ dependencies = [ [[package]] name = "squishy-cli" -version = "0.2.2" +version = "0.3.0" dependencies = [ "clap", "goblin", diff --git a/Cargo.toml b/Cargo.toml index 48f1307..a9aa390 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ members = [ resolver = "2" [workspace.package] -version = "0.2.1" +version = "0.3.0" authors = ["Rabindra Dhakal "] license = "MIT" edition = "2021" diff --git a/squishy-cli/Cargo.toml b/squishy-cli/Cargo.toml index a33d579..4b143ec 100644 --- a/squishy-cli/Cargo.toml +++ b/squishy-cli/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "squishy-cli" description = "A simple CLI tool to work with SquashFS files" -version = "0.2.2" +version = "0.3.0" authors.workspace = true license.workspace = true edition.workspace = true @@ -13,7 +13,7 @@ name = "squishy" path = "src/main.rs" [dependencies] -squishy = { path = "../squishy", version = "0.2.0", features = ["appimage", "rayon"] } +squishy = { path = "../squishy", version = "0.3.0", features = ["appimage", "rayon"] } clap = { version = "4.5.20", features = ["cargo", "derive"] } goblin = { version = "0.9.2", default-features = false, features = ["elf32", "elf64", "endian_fd", "std"] } rayon = "1.10.0" diff --git a/squishy-cli/src/appimage.rs b/squishy-cli/src/appimage.rs index 0bdb2d4..b315c6c 100644 --- a/squishy-cli/src/appimage.rs +++ b/squishy-cli/src/appimage.rs @@ -1,4 +1,8 @@ -use std::{ffi::{OsStr, OsString}, fs, path::Path}; +use std::{ + ffi::{OsStr, OsString}, + fs, + path::Path, +}; use squishy::{error::SquishyError, EntryKind, SquashFS, SquashFSEntry}; @@ -48,11 +52,7 @@ pub fn extract_file>( fs::create_dir_all(&output_dir)?; let output_path = output_dir.as_ref().join(file_name); if copy_permissions { - squashfs.write_file_with_permissions( - basic_file, - &output_path, - entry.header, - )?; + squashfs.write_file_with_permissions(basic_file, &output_path, entry.header)?; } else { squashfs.write_file(basic_file, &output_path)?; } diff --git a/squishy-cli/src/common.rs b/squishy-cli/src/common.rs index a83980b..0359c2a 100644 --- a/squishy-cli/src/common.rs +++ b/squishy-cli/src/common.rs @@ -1,4 +1,8 @@ -use std::{fs::File, io::{Read, Seek, SeekFrom}, path::Path}; +use std::{ + fs::File, + io::{Read, Seek, SeekFrom}, + path::Path, +}; use goblin::elf::Elf; diff --git a/squishy-cli/src/main.rs b/squishy-cli/src/main.rs index 9022403..9c271b7 100644 --- a/squishy-cli/src/main.rs +++ b/squishy-cli/src/main.rs @@ -73,8 +73,14 @@ fn main() { if desktop { if let Some(desktop) = appimage.find_desktop() { if let Some(ref write_path) = write_path { - extract_file(&appimage.squashfs, &desktop, write_path, output_name, copy_permissions) - .unwrap(); + extract_file( + &appimage.squashfs, + &desktop, + write_path, + output_name, + copy_permissions, + ) + .unwrap(); } else { log!(args.quiet, "Desktop file: {}", desktop.path.display()); } @@ -85,8 +91,14 @@ fn main() { if icon { if let Some(icon) = appimage.find_icon() { if let Some(ref write_path) = write_path { - extract_file(&appimage.squashfs, &icon, write_path, output_name, copy_permissions) - .unwrap(); + extract_file( + &appimage.squashfs, + &icon, + write_path, + output_name, + copy_permissions, + ) + .unwrap(); } else { log!(args.quiet, "Icon: {}", icon.path.display()); } @@ -97,8 +109,14 @@ fn main() { if appstream { if let Some(appstream) = appimage.find_appstream() { if let Some(ref write_path) = write_path { - extract_file(&appimage.squashfs, &appstream, write_path, output_name, copy_permissions) - .unwrap(); + extract_file( + &appimage.squashfs, + &appstream, + write_path, + output_name, + copy_permissions, + ) + .unwrap(); } else { log!(args.quiet, "Appstream file: {}", appstream.path.display()); } @@ -164,7 +182,8 @@ fn main() { fs::set_permissions( &output_path, Permissions::from_mode(u32::from(entry.header.permissions)), - ).unwrap(); + ) + .unwrap(); log!( args.quiet, "Wrote {} to {}", diff --git a/squishy/src/appimage.rs b/squishy/src/appimage.rs index f0d7314..1f479ce 100644 --- a/squishy/src/appimage.rs +++ b/squishy/src/appimage.rs @@ -1,7 +1,11 @@ -use std::{fs::File, io::{Read, Seek, SeekFrom}, path::Path}; +use std::{ + fs::File, + io::{Read, Seek, SeekFrom}, + path::Path, +}; -use rayon::iter::ParallelIterator; use goblin::elf::Elf; +use rayon::iter::ParallelIterator; use crate::{error::SquishyError, EntryKind, SquashFS, SquashFSEntry};