summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-11-23 19:47:25 +0000
committerZac Medico <zmedico@gentoo.org>2008-11-23 19:47:25 +0000
commit1399e02fdc79f9e365724f001f4bcbf59ca35ae3 (patch)
tree306102d38e767841d752871dc979f5c5a12159f9
parent23c7f9f25a3dc787bf8444a5b84474b51d5876f5 (diff)
downloadportage-1399e02fdc79f9e365724f001f4bcbf59ca35ae3.tar.gz
portage-1399e02fdc79f9e365724f001f4bcbf59ca35ae3.tar.bz2
portage-1399e02fdc79f9e365724f001f4bcbf59ca35ae3.zip
Bug #188780 - Make the read_int() function show a more human readable error
message, instead of the 'value too great for base' message when the user enters an invalid value such as '1y'. svn path=/main/trunk/; revision=12053
-rwxr-xr-xbin/etc-update3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/etc-update b/bin/etc-update
index 4d29007f9..af200f6b4 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -223,7 +223,8 @@ read_int() {
read my_input
# failed integer conversions will break a loop unless they're enclosed
# in a subshell.
- echo "${my_input}" | ( declare -i x; read x) && break
+ echo "${my_input}" | ( declare -i x; read x) 2>/dev/null && break
+ echo -n "Value '$my_input' is not valid. Please enter an integer value:" >&2
done
echo ${my_input}
}