Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
debug: add a "jobs" namespace
Baptiste Daroussin committed 1 year ago
commit 36a3d2da467d337bc9d11e8c02289c9d19986b76
parent f380109
2 files changed +6 -0
modified libpkg/pkg_jobs.c
@@ -33,6 +33,8 @@
#include "pkg_config.h"
#endif

+
#define dbg(x, ...) pkg_dbg(PKG_DBG_JOBS, x, __VA_ARGS__)
+

#include <bsd_compat.h>

#include <sys/param.h>
@@ -2148,6 +2150,7 @@ pkg_jobs_handle_delete(struct pkg_solved *ps, struct pkg_jobs *j)
static int
pkg_jobs_execute(struct pkg_jobs *j)
{
+
	dbg(1, "execute");
	struct pkg *p;
	int retcode = EPKG_FATAL;
	pkg_plugin_hook_t pre, post;
@@ -2235,6 +2238,7 @@ pkg_jobs_execute(struct pkg_jobs *j)

cleanup:
	pkgdb_release_lock(j->db, PKGDB_LOCK_EXCLUSIVE);
+
	dbg(1, "execute done");

	return (retcode);
}
modified libpkg/private/event.h
@@ -60,6 +60,7 @@ typedef enum {
	PKG_DBG_DB = (1UL << 4),
	PKG_DBG_MANIFEST = (1UL << 5),
	PKG_DBG_SOLVER = (1UL << 6),
+
	PKG_DBG_JOBS = (1UL << 7),
	PKG_DBG_ALL = (1UL << 63),
} pkg_debug_flags;

@@ -76,6 +77,7 @@ static const struct pkg_dbg_flags debug_flags[] = {
	{ PKG_DBG_DB, "db" },
	{ PKG_DBG_MANIFEST, "manifest" },
	{ PKG_DBG_SOLVER, "solver" },
+
	{ PKG_DBG_JOBS, "jobs"},
	{ PKG_DBG_ALL, "all" },
};