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:
Juan RP
2014-07-02 10:59:25 +02:00
parent 21f32a75c5
commit e60677116d
5 changed files with 35 additions and 6 deletions

View File

@ -187,8 +187,10 @@ find_repo_deps(struct xbps_handle *xhp,
}
if (((pkgname = xbps_pkgpattern_name(reqpkg)) == NULL) &&
((pkgname = xbps_pkg_name(reqpkg)) == NULL)) {
xbps_dbg_printf(xhp, "can't guess pkgname for %s\n", reqpkg);
rv = EINVAL;
xbps_dbg_printf(xhp, "%s: can't guess pkgname for dependency: %s\n", curpkg, reqpkg);
xbps_set_cb_state(xhp, XBPS_STATE_INVALID_DEP, ENXIO, NULL,
"%s: can't guess pkgname for dependency '%s'", curpkg, reqpkg);
rv = ENXIO;
break;
}
/*