Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r12053 - main/trunk/bin
Date: Sun, 23 Nov 2008 19:47:37
Message-Id: E1L4Kva-0001Rp-3k@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-11-23 19:47:25 +0000 (Sun, 23 Nov 2008)
3 New Revision: 12053
4
5 Modified:
6 main/trunk/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'.
11
12
13 Modified: main/trunk/bin/etc-update
14 ===================================================================
15 --- main/trunk/bin/etc-update 2008-11-23 07:47:43 UTC (rev 12052)
16 +++ main/trunk/bin/etc-update 2008-11-23 19:47:25 UTC (rev 12053)
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 }