fulldeptree: return a proper error if deps can't be resolved.
xbps_get_pkg_fulldeptree() now returns NULL and sets errno to ENODEV when there are missing dependencies, rather than assert()ing. Added another test case to check returned error codes. Signed-off-by: Juan RP <xtraeme@gmail.com>
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*-
|
||||
* Copyright (c) 2010-2015 Juan Romero Pardines.
|
||||
* Copyright (c) 2010-2019 Juan Romero Pardines.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -470,6 +470,13 @@ create_dot_graph(struct xbps_handle *xhp,
|
||||
} else {
|
||||
rdeps = xbps_pkgdb_get_pkg_fulldeptree(xhp, pkgver);
|
||||
}
|
||||
if (rdeps == NULL) {
|
||||
if (errno == ENODEV)
|
||||
die("package depends on missing dependencies\n");
|
||||
else
|
||||
die("package dependencies couldn't be resolved (error %d)\n", errno);
|
||||
}
|
||||
|
||||
process_fulldeptree(xhp, f, plistd, rdeps, repomode);
|
||||
} else {
|
||||
/*
|
||||
|
Reference in New Issue
Block a user