xbps-bin: use -f to bypass questions while installing/removing.

--HG--
extra : convert_revision : edefc4dbf4dbbcdac53579100732e77004a45463
This commit is contained in:
Juan RP
2009-04-09 18:42:07 +02:00
parent 58c6a31297
commit f0f53cb07e
4 changed files with 26 additions and 19 deletions

View File

@@ -109,7 +109,7 @@ xbps_autoremove_pkgs(void)
}
void
xbps_remove_pkg(const char *pkgname)
xbps_remove_pkg(const char *pkgname, bool force)
{
prop_array_t reqby;
prop_dictionary_t dict;
@@ -133,15 +133,19 @@ xbps_remove_pkg(const char *pkgname)
(void)xbps_callback_array_iter_in_dict(dict,
"requiredby", list_strings_in_array, NULL);
printf("\n\n");
if (xbps_noyes("Do you want to remove %s?", pkgname) == false) {
printf("Cancelling!\n");
exit(EXIT_SUCCESS);
if (!force) {
if (!xbps_noyes("Do you want to remove %s?", pkgname)) {
printf("Cancelling!\n");
exit(EXIT_SUCCESS);
}
}
printf("Forcing %s-%s for deletion!\n", pkgname, version);
} else {
if (xbps_noyes("Do you want to remove %s?", pkgname) == false) {
printf("Cancelling!\n");
exit(EXIT_SUCCESS);
if (!force) {
if (!xbps_noyes("Do you want to remove %s?", pkgname)) {
printf("Cancelling!\n");
exit(EXIT_SUCCESS);
}
}
}