Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r12054 - main/branches/2.1.6/bin
Date: Sun, 23 Nov 2008 19:48:56
Message-Id: E1L4Kww-0001TV-P0@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-11-23 19:48:54 +0000 (Sun, 23 Nov 2008)
3 New Revision: 12054
4
5 Modified:
6 main/branches/2.1.6/bin/etc-update
7 Log:
8 Bug #188780 - Make the read_int() function show a more human readable error
9 message, instead of the 'value too great for base' message when the user
10 enters an invalid value such as '1y'. (trunk r12053)
11
12
13 Modified: main/branches/2.1.6/bin/etc-update
14 ===================================================================
15 --- main/branches/2.1.6/bin/etc-update 2008-11-23 19:47:25 UTC (rev 12053)
16 +++ main/branches/2.1.6/bin/etc-update 2008-11-23 19:48:54 UTC (rev 12054)
17 @@ -223,7 +223,8 @@
18 read my_input
19 # failed integer conversions will break a loop unless they're enclosed
20 # in a subshell.
21 - echo "${my_input}" | ( declare -i x; read x) && break
22 + echo "${my_input}" | ( declare -i x; read x) 2>/dev/null && break
23 + echo -n "Value '$my_input' is not valid. Please enter an integer value:" >&2
24 done
25 echo ${my_input}
26 }