static bool audit_infofile(struct pkginfo *pkg, const struct audit_problem *problem) { if (pkg->status < PKG_STAT_HALFINSTALLED) return false; return !pkg_infodb_has_file(pkg, &pkg->installed, problem->value.string); }
static bool bsyn_infofile(struct pkginfo *pkg, const struct badstatinfo *bsi) { if (pkg->status < stat_halfinstalled) return false; return !pkg_infodb_has_file(pkg, &pkg->installed, bsi->value.string); }
static bool foundcyclebroken(struct cyclesofarlink *thislink, struct cyclesofarlink *sofar, struct pkginfo *dependedon, struct deppossi *possi) { struct cyclesofarlink *sol; if(!possi) return false; /* We're investigating the dependency ‘possi’ to see if it * is part of a loop. To this end we look to see whether the * depended-on package is already one of the packages whose * dependencies we're searching. */ for (sol = sofar; sol && sol->pkg != dependedon; sol = sol->prev); /* If not, we do a recursive search on it to see what we find. */ if (!sol) return findbreakcyclerecursive(dependedon, thislink); debug(dbg_depcon,"found cycle"); /* Right, we now break one of the links. We prefer to break * a dependency of a package without a postinst script, as * this is a null operation. If this is not possible we break * the other link in the recursive calling tree which mentions * this package (this being the first package involved in the * cycle). It doesn't particularly matter which we pick, but if * we break the earliest dependency we came across we may be * able to do something straight away when findbreakcycle returns. */ sofar= thislink; for (sol = sofar; !(sol != sofar && sol->pkg == dependedon); sol = sol->prev) { if (!pkg_infodb_has_file(sol->pkg, &sol->pkg->installed, POSTINSTFILE)) break; } /* Now we have either a package with no postinst, or the other * occurrence of the current package in the list. */ sol->possi->cyclebreak = true; debug(dbg_depcon, "cycle broken at %s -> %s", pkg_name(sol->possi->up->up, pnaw_always), sol->possi->ed->name); return true; }