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>) {