build: bump all dependencies and set MSRV to 1.94; fix build failures
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I7d331410864358d30191781d1e6c23f46a6a6964
This commit is contained in:
parent
020514cd7a
commit
8b2140c057
12 changed files with 248 additions and 196 deletions
|
|
@ -72,17 +72,17 @@ pub async fn execute(
|
|||
&format!("Add {} to lockfile?", file_path.display()),
|
||||
false,
|
||||
global_yes,
|
||||
)? {
|
||||
if let Ok(file_data) = fs::read(file_path) {
|
||||
use sha1::Digest;
|
||||
let mut hasher = sha1::Sha1::new();
|
||||
hasher.update(&file_data);
|
||||
let hash = format!("{:x}", hasher.finalize());
|
||||
file_hashes.push(FileHash {
|
||||
path: file_path.clone(),
|
||||
hash,
|
||||
});
|
||||
}
|
||||
)? && let Ok(file_data) = fs::read(file_path)
|
||||
{
|
||||
use sha1::Digest;
|
||||
let mut hasher = sha1::Sha1::new();
|
||||
hasher.update(&file_data);
|
||||
let hash =
|
||||
crate::utils::hash::hash_to_hex(hasher.finalize().as_slice());
|
||||
file_hashes.push(FileHash {
|
||||
path: file_path.clone(),
|
||||
hash,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -91,8 +91,7 @@ pub async fn execute(
|
|||
let result = add_files_batch(&mut lockfile, file_hashes).await;
|
||||
if let Err(e) = result {
|
||||
log::warn!(
|
||||
"Batch lookup failed, falling back to individual lookups: {}",
|
||||
e
|
||||
"Batch lookup failed, falling back to individual lookups: {e}"
|
||||
);
|
||||
for fh in fallback_hashes {
|
||||
if let Err(e) =
|
||||
|
|
@ -220,7 +219,7 @@ async fn add_file_to_lockfile(
|
|||
use sha1::Digest;
|
||||
let mut hasher = sha1::Sha1::new();
|
||||
hasher.update(&file_data);
|
||||
let hash = format!("{:x}", hasher.finalize());
|
||||
let hash = crate::utils::hash::hash_to_hex(hasher.finalize().as_slice());
|
||||
|
||||
// Try Modrinth first (SHA-1 hash)
|
||||
if let Ok(Some(project)) = modrinth.lookup_by_hash(&hash).await {
|
||||
|
|
@ -279,7 +278,11 @@ async fn add_files_batch(
|
|||
for file_info in &project.files {
|
||||
for (idx, fh) in file_hashes.iter().enumerate() {
|
||||
if !matched_indices.contains(&idx)
|
||||
&& file_info.hashes.get("sha1").map(|s| s.as_str()) == Some(&fh.hash)
|
||||
&& file_info
|
||||
.hashes
|
||||
.get("sha1")
|
||||
.map(std::string::String::as_str)
|
||||
== Some(&fh.hash)
|
||||
{
|
||||
lockfile.add_project(project.clone());
|
||||
added_pakku_ids.insert(pakku_id.clone());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue