Date: 2005-08-30
Initial Package Version: 2.9.6
Origin: Miklos Vajna <vmiklos@frugalware.org>
Description: Confirms deleting old/all packages from cache.
Requested by many newbie.
 pacman.c |    4 ++++
 1 file changed, 4 insertions(+)
diff -Naur pacman-2.9.6.orig/src/pacman.c pacman-2.9.6/src/pacman.c
--- pacman-2.9.6.orig/src/pacman.c	2005-08-30 20:40:58.000000000 +0200
+++ pacman-2.9.6/src/pacman.c	2005-08-30 20:51:10.000000000 +0200
@@ -359,6 +359,8 @@
 
 			snprintf(dirpath, PATH_MAX, "%s%s", pmo_root, CACHEDIR);
 
+			if(!yesno("Do you want to remove old packages from cache? [Y/n] "))
+				return(0);
 			printf("removing old packages from cache... ");
 			dir = opendir(dirpath);
 			if(dir == NULL) {
@@ -433,6 +435,8 @@
 
 			snprintf(path, PATH_MAX, "%s%s", pmo_root, CACHEDIR);
 
+			if(!yesno("Do you want to remove all packages from cache? [Y/n] "))
+				return(0);
 			printf("removing all packages from cache... ");
 			if(rmrf(path)) {
 				fprintf(stderr, "error: could not remove cache directory: %s\n", strerror(errno));
