From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: bb.data.*Var -> d.*Var conversion
Date: Wed, 09 Nov 2011 11:52:55 +0000 [thread overview]
Message-ID: <1320839575.10843.165.camel@ted> (raw)
I'm tempted to run the following over the metata to convert the
bb.data.*Var(...,d) and similar expressions to the form d.*Var(...).
Why? We get a lot of people doing copy, paste and edit of the code and
this way, we'll increase the chances of them finding better examples.
I'm still looking at the diff this generates to see if there are any
more corner cases I need to tweak the expression for but feedback
welcome.
sed \
-e 's:bb.data.\(setVar([^,]*,[^,]*\), \([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,]*,[^,]*,[^,]*\), \([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,]*\), \([^, ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,]*,[^,]*\), \([^, ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,]*,[^,]*\), \([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,]*\), \([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
Cheers,
Richard
next reply other threads:[~2011-11-09 11:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-09 11:52 Richard Purdie [this message]
2011-11-09 14:59 ` bb.data.*Var -> d.*Var conversion Darren Hart
2011-11-09 15:24 ` Chris Larson
2011-11-10 0:11 ` Richard Purdie
2011-11-10 0:19 ` Richard Purdie
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=1320839575.10843.165.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--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