diff --git a/libpkgconf/libpkgconf.h b/libpkgconf/libpkgconf.h index 7be551d..6a76caa 100644 --- a/libpkgconf/libpkgconf.h +++ b/libpkgconf/libpkgconf.h @@ -167,8 +167,7 @@ struct pkgconf_pkg_ { pkgconf_tuple_t *prefix; uint64_t serial; - - size_t hits; + uint64_t identifier; }; typedef bool (*pkgconf_pkg_iteration_func_t)(const pkgconf_pkg_t *pkg, void *data); @@ -204,6 +203,7 @@ struct pkgconf_client_ { bool already_sent_notice; uint64_t serial; + uint64_t identifier; pkgconf_pkg_t **cache_table; size_t cache_count; diff --git a/libpkgconf/pkg.c b/libpkgconf/pkg.c index 40565a4..1897600 100644 --- a/libpkgconf/pkg.c +++ b/libpkgconf/pkg.c @@ -1494,7 +1494,7 @@ pkgconf_pkg_walk_list(pkgconf_client_t *client, if (pkgdep->serial == client->serial && !(parent->flags & PKGCONF_PKG_PROPF_VIRTUAL)) { - pkgdep->hits++; + pkgdep->identifier = ++client->identifier; /* In this case we have a circular reference. * We break that by deleteing the circular node from the @@ -1523,7 +1523,7 @@ pkgconf_pkg_walk_list(pkgconf_client_t *client, pkgconf_audit_log_dependency(client, pkgdep, depnode); - pkgdep->hits++; + pkgdep->identifier = ++client->identifier; pkgdep->serial = client->serial; eflags |= pkgconf_pkg_traverse_main(client, pkgdep, func, data, depth - 1, skip_flags); next: diff --git a/libpkgconf/queue.c b/libpkgconf/queue.c index d7c768b..3e515ff 100644 --- a/libpkgconf/queue.c +++ b/libpkgconf/queue.c @@ -144,7 +144,7 @@ dep_sort_cmp(const void *a, const void *b) const pkgconf_dependency_t *depA = *(void **) a; const pkgconf_dependency_t *depB = *(void **) b; - return depB->match->hits - depA->match->hits; + return depB->match->identifier - depA->match->identifier; } static inline void @@ -219,7 +219,7 @@ next: memset(&dep->iter, '\0', sizeof (dep->iter)); pkgconf_node_insert(&dep->iter, dep, list); - PKGCONF_TRACE(client, "slot "SIZE_FMT_SPECIFIER": dep %s matched to %p<%s> hits "SIZE_FMT_SPECIFIER, i, dep->package, dep->match, dep->match->id, dep->match->hits); + PKGCONF_TRACE(client, "slot "SIZE_FMT_SPECIFIER": dep %s matched to %p<%s> id "SIZE_FMT_SPECIFIER, i, dep->package, dep->match, dep->match->id, dep->match->identifier); } free(deps);