[pacman-dev] [PATCH] makepkg: also clean cache if no character was entered at the prompt

Cedric Staniewski cedric at gmx.ca
Wed Oct 21 10:06:41 EDT 2009


If no character was entered, the preselected option (= the capital)
should be assumed; just as pacman it does.

Signed-off-by: Cedric Staniewski <cedric at gmx.ca>
---
 scripts/makepkg.sh.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 40367ae..3b29b31 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1600,7 +1600,7 @@ if [ "$CLEANCACHE" -eq 1 ]; then
 		echo -n "$(gettext "[Y/n]")"
 		read answer
 		answer="${answer^^}"
-		if [ "$answer" = "$(gettext "YES")" -o "$answer" = "$(gettext "Y")" ]; then
+		if [ -z "$answer" -o "$answer" = "$(gettext "YES")" -o "$answer" = "$(gettext "Y")" ]; then
 			rm "$SRCDEST"/*
 			if [ $? -ne 0 ]; then
 				error "$(gettext "Problem removing files; you may not have correct permissions in %s")" "$SRCDEST"
-- 
1.6.5.1



More information about the pacman-dev mailing list