Openembedded Core Discussions
 help / color / mirror / Atom feed
* bb.data.*Var -> d.*Var conversion
@ 2011-11-09 11:52 Richard Purdie
  2011-11-09 14:59 ` Darren Hart
  2011-11-10  0:19 ` Richard Purdie
  0 siblings, 2 replies; 5+ messages in thread
From: Richard Purdie @ 2011-11-09 11:52 UTC (permalink / raw)
  To: openembedded-core

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-11-10  0:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-09 11:52 bb.data.*Var -> d.*Var conversion Richard Purdie
2011-11-09 14:59 ` Darren Hart
2011-11-09 15:24   ` Chris Larson
2011-11-10  0:11     ` Richard Purdie
2011-11-10  0:19 ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox