Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add a pkg_has_message function to determine if a package has a message to display
Baptiste Daroussin committed 12 years ago
commit 5a1a7ff50418251e32192f5707d3195c5f12d8fe
parent 2ff77ce
2 files changed +15 -0
modified libpkg/pkg.c
@@ -1301,6 +1301,19 @@ pkg_is_installed(struct pkgdb *db, const char *origin)
}

bool
+
pkg_has_message(struct pkg *p)
+
{
+
	const char *msg;
+

+
	pkg_get(p, PKG_MESSAGE, &msg);
+

+
	if (msg != NULL)
+
		return (true);
+

+
	return (false);
+
}
+

+
bool
pkg_has_file(struct pkg *p, const char *path)
{
	struct pkg_file *f;
modified libpkg/pkg.h.in
@@ -1497,4 +1497,6 @@ struct sbuf *pkg_sbuf_printf(struct sbuf * restrict sbuf,
struct sbuf *pkg_sbuf_vprintf(struct sbuf * restrict sbuf,
	const char * restrict format, va_list ap);

+
bool pkg_has_message(struct pkg *p);
+

#endif