[OE-core] bb.data.*Var -> d.*Var conversion

Richard Purdie richard.purdie at linuxfoundation.org
Wed Nov 9 11:52:55 UTC 2011


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





More information about the Openembedded-core mailing list