diff --git a/bin/xbps-bin/main.c b/bin/xbps-bin/main.c index 0013c70d4dd..0bd318460bd 100644 --- a/bin/xbps-bin/main.c +++ b/bin/xbps-bin/main.c @@ -173,17 +173,16 @@ main(int argc, char **argv) /* Install into root directory by default. */ if (strcasecmp(argv[0], "install") == 0) { rv = xbps_install_binary_pkg(argv[1], root, flags); - if (rv != 0 && rv != EEXIST) { - if (rv == ENOENT) { + if (rv != 0) { + if (rv == EAGAIN) { printf("Unable to locate %s in " "repository pool.\n", argv[1]); - exit(EXIT_FAILURE); + } else if (rv == ENOENT) { + dict = xbps_get_pkg_deps_dictionary(); + if (dict) + show_missing_deps(dict, argv[1]); } - dict = xbps_get_pkg_deps_dictionary(); - if (dict && errno == ENOENT) - show_missing_deps(dict, argv[1]); - exit(EXIT_FAILURE); } printf("Package %s installed successfully.\n", argv[1]); diff --git a/lib/install.c b/lib/install.c index 4550e09d64a..45229e293fc 100644 --- a/lib/install.c +++ b/lib/install.c @@ -105,8 +105,8 @@ xbps_install_binary_pkg(const char *pkgname, const char *destdir, int flags) */ rv = xbps_callback_array_iter_in_repolist(install_binpkg_repo_cb, (void *)&cb); - if (rv == 0 && errno == EAGAIN) - return ENOENT; + if (rv == 0 && errno != 0) + return errno; return rv; }