Fix #43 (xbps-install: unhelpful message for invalid dependency)
If a package that is going to be installed or updated contains invalid dependencies return ENXIO and XBPS_STATE_INVALID_DEP xbps state to clients. This improves the error messages returned to the clients when such condition happens.
This commit is contained in:
@@ -159,8 +159,12 @@ state_cb(struct xbps_state_cb_data *xscd, void *cbdata _unused)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
xbps_dbg_printf(xscd->xhp,
|
||||
"%s: unknown state %d\n", xscd->arg, xscd->state);
|
||||
if (xscd->desc)
|
||||
xbps_error_printf("%s\n", xscd->desc);
|
||||
else
|
||||
xbps_dbg_printf(xscd->xhp,
|
||||
"%s: unknown state %d\n", xscd->arg, xscd->state);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -224,6 +224,8 @@ install_new_pkg(struct xbps_handle *xhp, const char *pkg, bool reinstall)
|
||||
} else if (rv == ENOTSUP) {
|
||||
fprintf(stderr, "No repositories "
|
||||
"currently registered!\n");
|
||||
} else if (rv == ENXIO) {
|
||||
fprintf(stderr, "Package `%s' contains invalid dependencies, exiting.\n", pkg);
|
||||
} else {
|
||||
fprintf(stderr, "Unexpected error: %s\n",
|
||||
strerror(rv));
|
||||
|
||||
Reference in New Issue
Block a user