fix built pkg not found for any archs

This commit is contained in:
lukas-heiligenbrunner 2024-01-13 14:23:10 +01:00
parent e74a9607a3
commit 64ef138302
2 changed files with 4 additions and 3 deletions

View File

@ -19,7 +19,7 @@ pub async fn init(db: DatabaseConnection, tx: Sender<Action>) {
if let Ok(_result) = tx.subscribe().recv().await {
match _result {
// add a package to parallel build
Action::Build(name, version, url, mut version_model) => {
Action::Build(name, version, url, version_model) => {
let _ = queue_package(
name,
version,
@ -39,7 +39,7 @@ async fn queue_package(
name: String,
version: String,
url: String,
mut version_model: versions::ActiveModel,
version_model: versions::ActiveModel,
db: DatabaseConnection,
semaphore: Arc<Semaphore>,
) -> anyhow::Result<()> {

View File

@ -11,6 +11,7 @@ pub async fn build_pkgbuild(
pkg_name: &str,
tx: Sender<String>,
) -> anyhow::Result<String> {
// update pacman cache
let mut child = tokio::process::Command::new("pacman")
.args([
"-Sy",
@ -111,7 +112,7 @@ fn locate_built_package(
if let Some(file_name) = path.file_name() {
let file_name = file_name.to_str().unwrap();
if file_name.ends_with("-x86_64.pkg.tar.zst")
if file_name.ends_with(".pkg.tar.zst")
&& file_name.starts_with(pkg_name.as_str())
{
if let Ok(metadata) = path.metadata() {