Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 255528 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-5 / +12 lines)
Line  Link Here
0
-- dmcrypt.rc
0
++ dmcrypt.rc
Lines 71-87 Link Here
71
	if [ -n "${key}" ] ; then
71
	if [ -n "${key}" ] ; then
72
		read_abort() {
72
		read_abort() {
73
			# some colors
73
			# some colors
74
			local ans
74
			local ans savetty resettty
75
			shift
76
			[ -z "${NORMAL}" ] && eval $(eval_ecolors)
75
			[ -z "${NORMAL}" ] && eval $(eval_ecolors)
77
			einfon "  $1? (${WARN}yes${NORMAL}/${GOOD}No${NORMAL}) "
76
			einfon "  $1? (${WARN}yes${NORMAL}/${GOOD}No${NORMAL}) "
78
			if ! read -n 1 $* ans ; then
77
			shift
78
			savetty=`stty -g`
79
			resettty='stty ${savetty}; trap - EXIT HUP INT TERM'
80
			trap 'eval "${resettty}"' EXIT HUP INT TERM
81
			stty -icanon
82
			[ "${1}" = -t ] && stty min 0 time "$(( $2 * 10 ))"
83
			ans=`dd count=1 bs=1 2>/dev/null` || ans=''
84
			eval "${resettty}"
85
			if [ -z "${ans}" ] ; then
79
				printf '\r'
86
				printf '\r'
80
			else
87
			else
81
				echo
88
				echo
82
			fi
89
			fi
83
			case ${ans} in
90
			case ${ans} in
84
				[yY]|[yY][eE][sS]) return 0;;
91
				[yY]) return 0;;
85
				*) return 1;;
92
				*) return 1;;
86
			esac
93
			esac
87
		}
94
		}

Return to bug 255528