int pkg_plugin_init(struct pkg_plugin *p) { self = p; pkg_plugin_set(p, PKG_PLUGIN_NAME, PLUGIN_NAME); pkg_plugin_set(p, PKG_PLUGIN_DESC, "ZFS snapshot plugin"); pkg_plugin_set(p, PKG_PLUGIN_VERSION, "1.0.0"); pkg_plugin_conf_add_list(p, ZFS_FS, "ZFS_FS"); pkg_plugin_conf_add_string(p, ZFS_PREFIX, "ZFS_PREFIX", "pkgsnap"); pkg_plugin_conf_add_bool(p, ZFS_RECURSIVE, "ZFS_RECURSIVE", false); pkg_plugin_parse(p); if (pkg_plugin_hook_register(p, PKG_PLUGIN_HOOK_PRE_INSTALL, &plugins_zfssnap_callback) != EPKG_OK) { pkg_plugin_error(self, "failed to hook into the library"); return (EPKG_FATAL); } if (pkg_plugin_hook_register(p, PKG_PLUGIN_HOOK_PRE_DEINSTALL, &plugins_zfssnap_callback) != EPKG_OK) { pkg_plugin_error(self, "failed to hook into the library"); return (EPKG_FATAL); } return (EPKG_OK); }
int init(struct pkg_plugin *p) { pkg_plugin_set(p, PKG_PLUGIN_NAME, myname); pkg_plugin_set(p, PKG_PLUGIN_DESC, mydesc); pkg_plugin_set(p, PKG_PLUGIN_VERSION, version); return (EPKG_OK); }
int pkg_plugin_init(struct pkg_plugin *p) { self = p; /* * Hook into the library and provide package stats for the following actions: * * - pre-install * - post-install * - pre-deinstall * - post-deinstall */ pkg_plugin_set(p, PKG_PLUGIN_NAME, name); pkg_plugin_set(p, PKG_PLUGIN_DESC, description); pkg_plugin_set(p, PKG_PLUGIN_VERSION, version); if (pkg_plugin_hook_register(p, PKG_PLUGIN_HOOK_PRE_INSTALL, &plugin_stats_callback) != EPKG_OK) { pkg_plugin_error(self, "failed to hook into the library"); return (EPKG_FATAL); } if (pkg_plugin_hook_register(p, PKG_PLUGIN_HOOK_POST_INSTALL, &plugin_stats_callback) != EPKG_OK) { pkg_plugin_error(self, "failed to hook into the library"); return (EPKG_FATAL); } if (pkg_plugin_hook_register(p, PKG_PLUGIN_HOOK_PRE_DEINSTALL, &plugin_stats_callback) != EPKG_OK) { pkg_plugin_error(self, "failed to hook into the library"); return (EPKG_FATAL); } if (pkg_plugin_hook_register(p, PKG_PLUGIN_HOOK_POST_DEINSTALL, &plugin_stats_callback) != EPKG_OK) { pkg_plugin_error(self, "failed to hook into the library"); return (EPKG_FATAL); } return (EPKG_OK); }