lkml.org 
[lkml]   [2001]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [reiserfs-list] ReiserFS Oops (2.4.1, deterministic, symlink related)
Date
On Sat, 03 Feb 2001 00:57:45 -0800, David Ford <david@linux.com>
wrote:

>How about a simple patch to the top level makefile that checks the gcc
>version then prints a distinct message ..'this compiler hasn't been approved
>for compiling the kernel', sleeping for one second, then continuing on. This
>solution doesn't stop compiling and makes a visible indicator without forcing
>anything.

A while ago I worked up a nasty bit of make logic which prompted the
user for yes or no... and then did one thing or the other. You could
ask the user if he REALLY wants to continue and wait for a response.
Following is the model code...
John Alvord
=================

_ECHO=@

all: t0 t1 t2 t3 t4 t5 t6

# prompt for input, must be in a separate rule to unbuffer terminal
# output.
t0:
$(_ECHO)echo Enter Y or N: \\c

# capture a line of terminal input, copy to a file, tell user
t1:
$(_ECHO)echo $(shell read ans; echo ans) > ans
$(_ECHO)echo The answer is \\c
$(_ECHO)cat ans

# take first character of answer, upper case, store in another file
# then create two files, one for yes and one for no
# the || exit 0 is to mask the potential grep error, which
# would result in an error message even a - was used to ignore error
# and continue. The result is two files, which may be zero byte
t2:
$(_ECHO)cat ans | cut -c 1-1 | tr 'a-z' 'A-Z' >ans1
$(_ECHO)rm -f ansy
$(_ECHO)rm -f ansn
$(_ECHO)grep Y ans1 > ansy || exit 0
$(_ECHO)grep N ans1 > ansn || exit 0

# Check for case where neither answer file is > 0 bytes
t3:
$(_ECHO)test -s ansy || test -s ansn && exit 0; \
echo Answer [$(shell cat ans)] is neither Y or N! && exit 1

# handle Yes case. Exit if Y answer file is 0 bytes or missing
t4:
$(_ECHO)test ! -s ansy && exit 0; \
echo in YES processing

# handle No case
t5:
$(_ECHO)test ! -s ansn && exit 0; \
echo in NO processing


# remove files used during processing
t6:
$(_ECHO)rm -f ans
$(_ECHO)rm -f ans1
$(_ECHO)rm -f ansn
$(_ECHO)rm -f ansy

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.294 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site