From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Gary Thomas <gary@mlbassoc.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: what's with the loop with "in in" in u-boot.inc?
Date: Sun, 8 Mar 2015 04:48:44 -0400 (EDT) [thread overview]
Message-ID: <alpine.LFD.2.11.1503080446380.13892@Device-040570> (raw)
In-Reply-To: <54FBD854.8060509@mlbassoc.com>
On Sat, 7 Mar 2015, Gary Thomas wrote:
> On 2015-03-07 10:48, Bernhard Reutner-Fischer wrote:
> > On March 7, 2015 3:04:52 PM GMT+01:00, "Robert P. J. Day"
> > <rpjday@crashcourse.ca> wrote:
> > >
> > > based on a recent post to this(?) list, i was curious about the
> > > following loop construct in u-boot.inc:
> > >
> > > for config in ${UBOOT_MACHINE}; do
> > > for type in in ${UBOOT_CONFIG}; do
> > > if [ "${type}"x = "in"x ]
> > > then
> > > continue
> > > fi
> > >
> > > the words "in in" above don't appear to be a typo, as the next
> > > condition explicitly checks for the value "in" and skips it. what's
> > > the rationale for that? i used "git blame" to examine the commit that
> >
> > for may barf on empty iteration input.
> > One usually uses for i in ${foo} '';
> > and skips i with zero length. Any other is obviously fine, too though so
> > nothing wrong or odd here.
>
> But this code is only executed if ${UBOOT_CONFIG} is non-empty
> so this test is nonsense.
>
> My guess is that the code originally tested for ${UBOOT_CONFIG}
> being empty this way, then the if/then/else was added (look at
> the indentation) and the original test was never removed (which
> does no harm)
technically, it *is* possible that UBOOT_CONFIG contains a non-empty
string of spaces so, yes, that test still has some technical value
but ... you know ... yuck. movin' on ...
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
prev parent reply other threads:[~2015-03-08 8:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-07 14:04 what's with the loop with "in in" in u-boot.inc? Robert P. J. Day
2015-03-07 17:48 ` Bernhard Reutner-Fischer
2015-03-08 5:04 ` Gary Thomas
2015-03-08 8:48 ` Robert P. J. Day [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.11.1503080446380.13892@Device-040570 \
--to=rpjday@crashcourse.ca \
--cc=gary@mlbassoc.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox