From fc9a19e7c4c7240fd1eb1a4dba9c88675af6cc18 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Mon, 29 Apr 2024 10:45:04 +0200 Subject: [PATCH] indexer: Disable broken dead-package checking for Arch Which I broke in 83ab6c36718651d7b754f8845d77fc0bc3a75f33. Need to find an alternative approach to detecting dead packages sometime. The 'dead' flag isn't super important so it can wait. --- indexer/src/sys_arch.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/indexer/src/sys_arch.rs b/indexer/src/sys_arch.rs index e8ae5d7..b5bc832 100644 --- a/indexer/src/sys_arch.rs +++ b/indexer/src/sys_arch.rs @@ -92,7 +92,7 @@ pub fn sync(pg: &mut T, sys: i32, mirror: &str, repo let mut hasman = false; let mut meta = None; - let mut allpkgs = HashSet::new(); + //let mut allpkgs = HashSet::new(); let r = archive::walk(ent, |x| { if x.filetype() == archive::FileType::Directory { hasman = false; @@ -121,7 +121,7 @@ pub fn sync(pg: &mut T, sys: i32, mirror: &str, repo canbelocal: false, }, }); - allpkgs.insert(m.name.into_boxed_str()); + //allpkgs.insert(m.name.into_boxed_str()); } Ok(true) @@ -130,9 +130,13 @@ pub fn sync(pg: &mut T, sys: i32, mirror: &str, repo if let Err(e) = r { error!("Error reading package index: {}", e); } - mark_dead(pg, sys, repo, allpkgs); + //mark_dead(pg, sys, repo, allpkgs); } +/* TODO: Dead-marking of packages is currently broken. + * Since the removal of the repo information from the `packages` table, the approach below isn't + * going to work anymore. Needs to be revisited... sometime. + * fn mark_dead(pg: &mut T, sys: i32, repo: &str, pkgs: HashSet>) { let mut dead = Vec::new(); for row in pg.query("SELECT id, name FROM packages WHERE system = $1 AND category = $2 AND NOT dead", &[&sys,&repo]).unwrap() { @@ -156,4 +160,4 @@ fn mark_dead(pg: &mut T, sys: i32, repo: &str, pkgs: if let Err(e) = tr.commit() { error!("Error finishing transaction: {}", e); } -} +}*/