[oe] [PATCH 10/12] busybox: simplify update-rc.d OPT handling
Bernhard Reutner-Fischer
rep.dot.nop at gmail.com
Mon Jan 3 21:09:26 UTC 2011
On Mon, Jan 03, 2011 at 11:30:21PM +0300, Roman I Khimov wrote:
>В сообщении от Понедельник 03 января 2011 23:02:04 автор Bernhard Reutner-
>Fischer написал:
>> - if test "x$D" != "x"; then
>> - OPT="-r $D"
>> - else
>> - OPT="-s"
>> - fi
>> + [ -n "$D" ] && OPT="-r $D" || OPT="-s"
>
>I have a strong feeling that this is wrong. Yeah, the first one takes up five
>times more lines but to me it's about five times easier to parse glancing over
>the recipe.
>
>Also, from what I heard '"x$D" != "x"' tests are the most portable ones.
It is more portable, yes. But given that test(1) is required to support
both -n and -z even in SUSv3 -- and still is in SUSv4 and i doubt this
fact will change anytime soon -- it's sane to assume it works.
ok?
More information about the Openembedded-devel
mailing list