33#include "xbps_api_impl.h"
55 xbps_dictionary_t pkgd;
57 xbps_object_iterator_t iter;
61 if ((rv = xbps_pkgdb_init(xhp)) != 0)
64 iter = xbps_dictionary_iterator(xhp->
pkgdb);
66 while ((obj = xbps_object_iterator_next(iter))) {
67 pkgd = xbps_dictionary_get_keysym(xhp->
pkgdb, obj);
68 if (!xbps_dictionary_get_cstring_nocopy(pkgd,
"pkgver", &pkgver))
70 if (xbps_array_count(ignpkgs)) {
73 xbps_dbg_printf(
"%s: ignoring pkg %s\n",
80 xbps_dbg_printf(
"%s: failed to configure %s: %s\n",
81 __func__, pkgver, strerror(rv));
85 xbps_object_iterator_release(iter);
96 xbps_dictionary_t pkgd;
98 char pkgname[XBPS_NAME_SIZE];
103 assert(pkgver != NULL);
113 xbps_dbg_printf(
"[configure] cannot find %s (%s) "
114 "in pkgdb\n", p, pkgver);
119 xbps_dbg_printf(
"%s: state %d rv %d\n", pkgver, state, rv);
121 xbps_dbg_printf(
"%s: [configure] failed to get "
122 "pkg state: %s\n", pkgver, strerror(rv));
127 if (state == XBPS_PKG_STATE_INSTALLED) {
128 if ((xhp->
flags & XBPS_FLAG_FORCE_CONFIGURE) == 0) {
131 }
else if (state != XBPS_PKG_STATE_UNPACKED) {
136 myumask = umask(022);
138 xbps_set_cb_state(xhp, XBPS_STATE_CONFIGURE, 0, pkgver, NULL);
142 xbps_set_cb_state(xhp, XBPS_STATE_CONFIGURE_FAIL,
144 "%s: [configure] INSTALL script failed to execute "
145 "the post ACTION: %s", pkgver, strerror(rv));
151 xbps_set_cb_state(xhp, XBPS_STATE_CONFIGURE_FAIL, rv,
152 pkgver,
"%s: [configure] failed to set state to installed: %s",
153 pkgver, strerror(rv));
158 xbps_set_cb_state(xhp, XBPS_STATE_CONFIGURE_DONE, 0, pkgver, NULL);
162 return xbps_cb_message(xhp, pkgd,
"install-msg");
Generic XBPS structure handler for initialization.
xbps_dictionary_t xbps_pkgdb_get_pkg(struct xbps_handle *xhp, const char *pkg)
int xbps_pkg_exec_script(struct xbps_handle *xhp, xbps_dictionary_t d, const char *script, const char *action, bool update)
int xbps_set_pkg_state_dictionary(xbps_dictionary_t dict, pkg_state_t state)
int xbps_pkg_state_dictionary(xbps_dictionary_t dict, pkg_state_t *state)
bool xbps_match_pkgver_in_array(xbps_array_t array, const char *pkgver)
bool xbps_match_string_in_array(xbps_array_t array, const char *val)
bool xbps_pkg_name(char *dst, size_t len, const char *pkg)