Fix previous.
--HG-- extra : convert_revision : a8073bfa4782f6c6a3e2afe760b184598f268807
This commit is contained in:
parent
b55346ae64
commit
3084354cec
2 changed files with 6 additions and 10 deletions
|
@ -138,24 +138,24 @@ main(int argc, char **argv)
|
|||
if (strcasecmp(argv[0], "install") == 0) {
|
||||
rv = xbps_install_binary_pkg(argv[1], root);
|
||||
if (rv) {
|
||||
if (rv == ENOENT)
|
||||
if (errno == ENOENT)
|
||||
printf("Unable to locate %s in "
|
||||
"repository pool.\n", argv[1]);
|
||||
else
|
||||
printf("Unable to install %s (%s).\n",
|
||||
argv[1], strerror(rv));
|
||||
argv[1], strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
printf("Package %s installed successfully.\n", argv[1]);
|
||||
} else {
|
||||
rv = xbps_remove_binary_pkg(argv[1], root);
|
||||
if (rv) {
|
||||
if (rv == ENOENT)
|
||||
if (errno == ENOENT)
|
||||
printf("Package %s is not installed.\n",
|
||||
argv[1]);
|
||||
else
|
||||
printf("Unable to remove %s (%s).\n",
|
||||
argv[1], strerror(rv));
|
||||
argv[1], strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
printf("Package %s removed successfully.\n", argv[1]);
|
||||
|
|
|
@ -87,8 +87,6 @@ xbps_install_binary_pkg(const char *pkgname, const char *destdir)
|
|||
*/
|
||||
rv = xbps_callback_array_iter_in_repolist(install_binpkg_repo_cb,
|
||||
(void *)&cb);
|
||||
if (errno == ENOENT)
|
||||
rv = ENOENT;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
@ -139,8 +137,7 @@ install_binpkg_repo_cb(prop_object_t obj, void *arg, bool *cbloop_done)
|
|||
/*
|
||||
* Construct the dependency chain for this package.
|
||||
*/
|
||||
rv = xbps_find_deps_in_pkg(pkgrd);
|
||||
if (rv != 0) {
|
||||
if ((rv = xbps_find_deps_in_pkg(pkgrd)) != 0) {
|
||||
prop_object_release(repod);
|
||||
if (rv == ENOENT)
|
||||
return 0;
|
||||
|
@ -151,8 +148,7 @@ install_binpkg_repo_cb(prop_object_t obj, void *arg, bool *cbloop_done)
|
|||
/*
|
||||
* Install all required dependencies and the package itself.
|
||||
*/
|
||||
rv = xbps_install_pkg_deps(pkgrd, destdir);
|
||||
if (rv == 0) {
|
||||
if ((rv = xbps_install_pkg_deps(pkgrd, destdir)) == 0) {
|
||||
rv = xbps_install_binary_pkg_fini(repod, pkgrd, destdir);
|
||||
prop_object_release(repod);
|
||||
if (rv == 0)
|
||||
|
|
Loading…
Reference in a new issue