Check that pkg is installed before removing.

--HG--
extra : convert_revision : 4ea85e367ecbc0d39dcba1c8ee63392f0e1177f7
This commit is contained in:
Juan RP
2009-02-03 16:51:42 +01:00
parent edfeec4622
commit fe8ea8c21c
2 changed files with 32 additions and 1 deletions

View File

@@ -354,7 +354,12 @@ main(int argc, char **argv)
} else {
rv = xbps_remove_binary_pkg(argv[1], root);
if (rv) {
printf("ERROR: unable to remove %s.\n", argv[1]);
if (rv == ENOENT)
printf("Package %s is not installed.\n",
argv[1]);
else
printf("ERROR: unable to remove %s.\n",
argv[1]);
exit(rv);
}
printf("Package %s removed successfully.\n", argv[1]);