feat: etc
This commit is contained in:
@ -1,11 +1,13 @@
|
||||
use anyhow::{anyhow, Result};
|
||||
use std::hash::{DefaultHasher, Hash, Hasher};
|
||||
|
||||
use crate::pkg::PkgKey;
|
||||
use crate::Profile;
|
||||
use crate::pkg_store::PackageStore;
|
||||
use crate::Profile;
|
||||
use anyhow::{anyhow, Result};
|
||||
|
||||
pub struct AppData {
|
||||
pub profile: Option<Profile>,
|
||||
pub pkgs: PackageStore
|
||||
pub pkgs: PackageStore,
|
||||
}
|
||||
|
||||
impl AppData {
|
||||
@ -37,4 +39,14 @@ impl AppData {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
pub fn sum_packages(&self, p: &Profile) -> String {
|
||||
let mut hasher = DefaultHasher::new();
|
||||
for pkg in &p.mods {
|
||||
let x = self.pkgs.get(pkg).unwrap().loc.as_ref().unwrap();
|
||||
pkg.hash(&mut hasher);
|
||||
x.version.hash(&mut hasher);
|
||||
}
|
||||
hasher.finish().to_string()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user