This commit is contained in:
parent
b51ba8deaf
commit
b721c21d9f
2 changed files with 11 additions and 3 deletions
|
@ -561,7 +561,8 @@ pub fn read_file_tar_raw(
|
||||||
.arg("-f")
|
.arg("-f")
|
||||||
.arg("-") // Indicate that the file input comes from stdin
|
.arg("-") // Indicate that the file input comes from stdin
|
||||||
.arg(file_path)
|
.arg(file_path)
|
||||||
.stdin(Stdio::piped()) // Open a pipe to provide the tar data
|
.stdin(Stdio::piped())
|
||||||
|
.stdout(Stdio::piped())
|
||||||
.spawn()
|
.spawn()
|
||||||
.ok()?;
|
.ok()?;
|
||||||
|
|
||||||
|
|
|
@ -48,8 +48,15 @@ pub async fn upload_pkg(
|
||||||
return Err(api_error("This repository is a mirror."));
|
return Err(api_error("This repository is a mirror."));
|
||||||
}
|
}
|
||||||
|
|
||||||
let (_, _, _, _, compression) = Package::extract_pkg_name(upload.pkg.name().unwrap())
|
let (_, _, _, _, compression) = Package::extract_pkg_name(
|
||||||
.ok_or_else(|| api_error("Package has weird filename"))?;
|
upload
|
||||||
|
.pkg
|
||||||
|
.raw_name()
|
||||||
|
.unwrap()
|
||||||
|
.dangerous_unsafe_unsanitized_raw()
|
||||||
|
.as_str(),
|
||||||
|
)
|
||||||
|
.ok_or_else(|| api_error("Package has weird filename"))?;
|
||||||
|
|
||||||
let pkg_file = tmp_file_to_vec(&upload.pkg).await;
|
let pkg_file = tmp_file_to_vec(&upload.pkg).await;
|
||||||
let content = read_file_tar_raw(&pkg_file, ".PKGINFO", compression.clone())
|
let content = read_file_tar_raw(&pkg_file, ".PKGINFO", compression.clone())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue