Re: [kbuild-devel] [patch] config language dep_* enhancements

Andreas Schwab (schwab@suse.de)
Fri, 09 Aug 2002 17:38:30 +0200


Greg Banks <gnb@alphalink.com.au> writes:

|> > --- 2.4.20pre1/scripts/Configure 2001-07-02 15:56:40.000000000 -0500
|> > +++ 2.4.20pre1p/scripts/Configure 2002-08-08 22:31:49.000000000 -0500
|> > @@ -232,6 +241,28 @@
|> > }
|> >
|> > #
|> > +# dep_calc reduces a dependency line down to a single char [ymn]
|> > +#
|> > +function dep_calc () {
|> > + local neg arg
|> > + cur_dep=y # return value
|> > + for arg; do
|> > + neg=;
|> > + case "$arg" in
|> > + !*) neg=N; arg=${arg#?} ;;
|> > + esac
|> > + case "$arg" in
|> > + y|m|n) ;;
|> > + *) arg=$(eval echo \$$arg) ;;
|>
|> Don't you want to check at this point that arg starts with CONFIG_?
|> Also, how about quoting \$$arg ?

The Right Way to write that is like this, assuming that $arg has already
been verified to be a valid identifier:

eval arg=\$$arg

No need for further quoting.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/