Skip to content

Commit

Permalink
v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
QaidVoid committed Dec 1, 2024
1 parent 5e2a0ed commit c9d8d1b
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ members = [
resolver = "2"

[workspace.package]
version = "0.2.1"
version = "0.3.0"
authors = ["Rabindra Dhakal <[email protected]>"]
license = "MIT"
edition = "2021"
Expand Down
4 changes: 2 additions & 2 deletions squishy-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
12 changes: 6 additions & 6 deletions squishy-cli/src/appimage.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down Expand Up @@ -48,11 +52,7 @@ pub fn extract_file<P: AsRef<Path>>(
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)?;
}
Expand Down
6 changes: 5 additions & 1 deletion squishy-cli/src/common.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
33 changes: 26 additions & 7 deletions squishy-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand All @@ -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());
}
Expand All @@ -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());
}
Expand Down Expand Up @@ -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 {}",
Expand Down
8 changes: 6 additions & 2 deletions squishy/src/appimage.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down

0 comments on commit c9d8d1b

Please sign in to comment.