Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Adds already installed and not found events
Arthur Gautier committed 13 years ago
commit 8793be9c05826b77b10e3b65f16eb69425fc307a
parent 43818cd
3 files changed +18 -0
modified libpkg/pkg.h
@@ -1022,6 +1022,7 @@ typedef enum {
	PKG_EVENT_PLUGIN_ERRNO,
	PKG_EVENT_PLUGIN_ERROR,
	PKG_EVENT_PLUGIN_INFO,
+
	PKG_EVENT_NOT_FOUND,
} pkg_event_t;

struct pkg_event {
@@ -1093,6 +1094,9 @@ struct pkg_event {
			struct pkg_plugin *plugin;
			char *msg;
		} e_plugin_error;
+
		struct {
+
			const char *pkg_name;
+
		} e_not_found;
	};
};

modified libpkg/pkg_event.c
@@ -357,3 +357,15 @@ pkg_plugin_info(struct pkg_plugin *p, const char *fmt, ...)
	pkg_emit_event(&ev);
	free(ev.e_plugin_info.msg);
}
+

+
void
+
pkg_emit_package_not_found(const char *p)
+
{
+
	struct pkg_event ev;
+

+
	ev.type = PKG_EVENT_NOT_FOUND;
+
	ev.e_not_found.pkg_name = p;
+

+
	pkg_emit_event(&ev);
+
}
+

modified libpkg/private/event.h
@@ -48,5 +48,7 @@ void pkg_emit_nolocaldb(void);
void pkg_emit_file_mismatch(struct pkg *pkg, struct pkg_file *f, const char *newsum);
void pkg_emit_newpkgversion(void);
void pkg_emit_developer_mode(const char *fmt, ...);
+
void pkg_emit_package_not_found(const char *);
+


#endif