From: Zac Medico Date: Sun, 23 Nov 2008 19:48:54 +0000 (-0000) Subject: Bug #188780 - Make the read_int() function show a more human readable error X-Git-Tag: v2.1.6_rc1~14 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a41448867295199ac9cafcfea9babce014e0e16b;p=portage.git 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'. (trunk r12053) svn path=/main/branches/2.1.6/; revision=12054 --- 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} }