diff --git a/indexer/src/sys_arch.rs b/indexer/src/sys_arch.rs index b5bc832..8c53b4d 100644 --- a/indexer/src/sys_arch.rs +++ b/indexer/src/sys_arch.rs @@ -92,7 +92,6 @@ 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 r = archive::walk(ent, |x| { if x.filetype() == archive::FileType::Directory { hasman = false; @@ -121,7 +120,6 @@ pub fn sync(pg: &mut T, sys: i32, mirror: &str, repo canbelocal: false, }, }); - //allpkgs.insert(m.name.into_boxed_str()); } Ok(true) @@ -130,34 +128,4 @@ 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); } - -/* 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() { - let id: i32 = row.get(0); - let name: &str = row.get(1); - if !pkgs.contains(name) { - info!("Package not available in database anymore, marking dead; sys {} / {} / pkg {} ({})", sys, repo, id, name); - dead.push(id); - } - } - if dead.is_empty() { - return; - } - - let mut tr = pg.transaction().unwrap(); - let q = tr.prepare("UPDATE packages SET dead = TRUE WHERE id = $1").unwrap(); - for id in dead { - tr.execute(&q, &[&id]).unwrap(); - } - - if let Err(e) = tr.commit() { - error!("Error finishing transaction: {}", e); - } -}*/