rpool: if pkg wasn't found set errno to ENOENT.
This is to return a proper error to the callers (i.e xbps-query(1)).
This commit is contained in:
3
NEWS
3
NEWS
@ -1,5 +1,8 @@
|
|||||||
xbps-0.48 (???):
|
xbps-0.48 (???):
|
||||||
|
|
||||||
|
* libxbps: the rpool functions now set errno to ENOENT when the target
|
||||||
|
pkg cannot be found in registered repos.
|
||||||
|
|
||||||
* libxbps: fix a bug where broken reverse dependencies would be detected
|
* libxbps: fix a bug where broken reverse dependencies would be detected
|
||||||
before detecting packages that need to be replaced in transaction.
|
before detecting packages that need to be replaced in transaction.
|
||||||
|
|
||||||
|
11
lib/rpool.c
11
lib/rpool.c
@ -296,14 +296,21 @@ repo_find_pkg(struct xbps_handle *xhp,
|
|||||||
* Find revdeps for pkg.
|
* Find revdeps for pkg.
|
||||||
*/
|
*/
|
||||||
rv = xbps_rpool_foreach(xhp, find_pkg_revdeps_cb, &rpf);
|
rv = xbps_rpool_foreach(xhp, find_pkg_revdeps_cb, &rpf);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (rv != 0) {
|
if (rv != 0) {
|
||||||
errno = rv;
|
errno = rv;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (type == REVDEPS_PKG)
|
if (type == REVDEPS_PKG) {
|
||||||
return rpf.revdeps;
|
if (rpf.revdeps == NULL)
|
||||||
|
errno = ENOENT;
|
||||||
|
|
||||||
|
return rpf.revdeps;
|
||||||
|
} else {
|
||||||
|
if (rpf.pkgd == NULL)
|
||||||
|
errno = ENOENT;
|
||||||
|
}
|
||||||
return rpf.pkgd;
|
return rpf.pkgd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user