add .7z format support

This commit is contained in:
2026-09-10 22:10:46 +03:00
parent 410f4524c2
commit 4a3dff8f98
4 changed files with 22 additions and 6 deletions

View File

@ -1,3 +1,11 @@
hplip hplip
= =
https://sourceforge.net/projects/hplip/files/hplip/3.26.4/hplip-3.26.4.tar.gz https://sourceforge.net/projects/hplip/files/hplip/3.26.4/hplip-3.26.4.tar.gz
``` sh *** build ***
./configure --prefix=/pkg/gnu/hplip --disable-network-build
```
``` cfg *** build deps ***
libusb
```

6
assets/var/gnu/libusb.md Normal file
View File

@ -0,0 +1,6 @@
libusb 1.0.3
=
https://github.com/libusb/libusb/releases/download/v1.0.30/libusb-1.0.30.7z
``` sh *** build ***
```

View File

@ -94,7 +94,7 @@ pub fn download(repo: &String, pkgname: &String, force: bool, recursive: bool) {
io::stdout().flush().unwrap(); io::stdout().flush().unwrap();
let mut cmd = Command::new("rsync"); let mut cmd = Command::new("rsync");
cmd.arg("-azHX").arg("--stats").arg("--no-times"); cmd.arg("-azHX").arg("--stats");
if force { cmd.arg("--delete"); } if force { cmd.arg("--delete"); }
cmd.arg(&remote_path); cmd.arg(&remote_path);
cmd.arg(&local_path_sync); cmd.arg(&local_path_sync);

View File

@ -43,15 +43,17 @@ pub fn download(repo: &String, pkgname: &String) {
} }
} }
else if url.is_empty() { return } else if url.is_empty() { return }
else if url.ends_with(".zip") { else if url.ends_with(".zip") || url.ends_with(".7z") {
let ext = if url.ends_with(".zip") { "zip" } else { "7z" };
if let Err(e) = fs::create_dir_all(&src) { if let Err(e) = fs::create_dir_all(&src) {
panic!("Failed to create directory {}: {}", &src.display(), e) panic!("Failed to create directory {}: {}", &src.display(), e)
} }
let zip_path = src.join("archive.zip"); let archive_path = src.join(format!("archive.{}", ext));
let wget_status = Command::new("wget") let wget_status = Command::new("wget")
.arg("-O") .arg("-O")
.arg(&zip_path) .arg(&archive_path)
.arg("-q") .arg("-q")
.arg("--show-progress") .arg("--show-progress")
.arg(&url) .arg(&url)
@ -65,7 +67,7 @@ pub fn download(repo: &String, pkgname: &String) {
let output_flag = format!("-o{}", src.display()); let output_flag = format!("-o{}", src.display());
let sevenz_status = Command::new("7z") let sevenz_status = Command::new("7z")
.arg("x") .arg("x")
.arg(&zip_path) .arg(&archive_path)
.arg(output_flag) .arg(output_flag)
.arg("-y") .arg("-y")
.arg("-bd") .arg("-bd")
@ -79,7 +81,7 @@ pub fn download(repo: &String, pkgname: &String) {
panic!("Failed to extract zip archive from URL: {}", url) panic!("Failed to extract zip archive from URL: {}", url)
} }
fs::remove_file(&zip_path).ok(); fs::remove_file(&archive_path).ok();
} }
else { else {
if let Err(e) = fs::create_dir_all(&src) { if let Err(e) = fs::create_dir_all(&src) {