From 9ed46ba9fb0ae0cd1d38a74f1cd038304583175e Mon Sep 17 00:00:00 2001 From: JMARyA Date: Fri, 27 Dec 2024 05:22:23 +0100 Subject: [PATCH] fix --- src/pkg.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/pkg.rs b/src/pkg.rs index 5d870a2..b775656 100644 --- a/src/pkg.rs +++ b/src/pkg.rs @@ -95,12 +95,19 @@ impl Package { } pub fn find(repo: &str, arch: &str, pkg_name: &str) -> Self { - Package { + let mut base = Package { repo: repo.to_string(), arch: arch.to_string(), name: pkg_name.to_string(), version: None, - } + }; + + let versions = base.versions(); + let ver = versions.first().unwrap(); + + base.version = Some(ver.clone()); + + base } pub fn save(&self, pkg: Vec, sig: Option>) {