xbps-bin: while installing binpkgs, detect properly in some cases its return value.

--HG--
extra : convert_revision : 89cb21eed183c1d9702613690fb7f48f8cceb5e2
This commit is contained in:
Juan RP 2009-02-22 06:00:08 +01:00
parent 2cfb55735b
commit eb2e824a33
2 changed files with 8 additions and 9 deletions

View file

@ -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]);