This commit is contained in:
parent
6a6941789f
commit
9ed46ba9fb
1 changed files with 9 additions and 2 deletions
11
src/pkg.rs
11
src/pkg.rs
|
@ -95,12 +95,19 @@ impl Package {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn find(repo: &str, arch: &str, pkg_name: &str) -> Self {
|
pub fn find(repo: &str, arch: &str, pkg_name: &str) -> Self {
|
||||||
Package {
|
let mut base = Package {
|
||||||
repo: repo.to_string(),
|
repo: repo.to_string(),
|
||||||
arch: arch.to_string(),
|
arch: arch.to_string(),
|
||||||
name: pkg_name.to_string(),
|
name: pkg_name.to_string(),
|
||||||
version: None,
|
version: None,
|
||||||
}
|
};
|
||||||
|
|
||||||
|
let versions = base.versions();
|
||||||
|
let ver = versions.first().unwrap();
|
||||||
|
|
||||||
|
base.version = Some(ver.clone());
|
||||||
|
|
||||||
|
base
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn save(&self, pkg: Vec<u8>, sig: Option<Vec<u8>>) {
|
pub fn save(&self, pkg: Vec<u8>, sig: Option<Vec<u8>>) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue