pkg: track the number of hits a package has gotten while solving for dependencies

pull/241/head
Ariadne Conill 2 months ago
parent 6ae17bd0ef
commit 5817e8848f
  1. 2
      libpkgconf/libpkgconf.h
  2. 2
      libpkgconf/pkg.c

@ -160,6 +160,8 @@ struct pkgconf_pkg_ {
pkgconf_tuple_t *prefix;
uint64_t serial;
size_t hits;
};
typedef bool (*pkgconf_pkg_iteration_func_t)(const pkgconf_pkg_t *pkg, void *data);

@ -1473,6 +1473,7 @@ pkgconf_pkg_walk_list(pkgconf_client_t *client,
if (pkgdep->serial == client->serial)
{
pkgdep->hits++;
pkgconf_pkg_unref(client, pkgdep);
continue;
}
@ -1485,6 +1486,7 @@ pkgconf_pkg_walk_list(pkgconf_client_t *client,
pkgconf_audit_log_dependency(client, pkgdep, depnode);
pkgdep->hits++;
pkgdep->serial = client->serial;
eflags |= pkgconf_pkg_traverse_main(client, pkgdep, func, data, depth - 1, skip_flags);
pkgconf_pkg_unref(client, pkgdep);

Loading…
Cancel
Save