Skip to contentSkip to conversation

COMPATIBLE_MACHINE

DISCUSSION Gary Thomas 3 participants 5 messages Apr 20, 2012

lore
Share & tools
lore
#0 lore raw

I'm writing a .bbappend for a recipe which contains a COMPATIBLE_MACHINE pattern like this:
COMPATIBLE_MACHINE = "(machine1|machine2|machine3)"

Is there a way my .bbappend file can add to this pattern? I don't want to disturb what's there, just add my machine as well.

Thanks

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#1 lore raw
Quoted 6 lines · Gary Thomas

I'm writing a .bbappend for a recipe which contains a COMPATIBLE_MACHINE pattern like this:
COMPATIBLE_MACHINE = "(machine1|machine2|machine3)"

Is there a way my .bbappend file can add to this pattern? I don't want to disturb what's there, just add my machine as well.

COMPATIBLE_MACHINE .= "|machine4"

p.

#2 lore raw
In reply to Gary Thomas
Quoted 6 lines · Gary Thomas

I'm writing a .bbappend for a recipe which contains a COMPATIBLE_MACHINE pattern like this:
 COMPATIBLE_MACHINE = "(machine1|machine2|machine3)"

Is there a way my .bbappend file can add to this pattern?  I don't want to disturb what's there, just add my machine as well.

It's just a standard regular expression.

COMPATIBLE_MACHINE = "(machine1|machine2|machine3)" COMPATIBLE_MACHINE .= "|machine4"

Will result in a value of "(machine1|machine2|machine3)|machine4", which is still a perfectly valid pattern, as far as I can tell.

Signature · 1 line
Christopher Larson
#3 lore raw
Quoted 8 lines · Chris Larson
Quoted 6 lines · Gary Thomas

I'm writing a .bbappend for a recipe which contains a COMPATIBLE_MACHINE pattern like this:
COMPATIBLE_MACHINE = "(machine1|machine2|machine3)"

Is there a way my .bbappend file can add to this pattern? I don't want to disturb what's there, just add my machine as well.

Quoted 7 lines

It's just a standard regular expression.

COMPATIBLE_MACHINE = "(machine1|machine2|machine3)" COMPATIBLE_MACHINE .= "|machine4"

Will result in a value of "(machine1|machine2|machine3)|machine4", which is still a perfectly valid pattern, as far as I can tell.

Yes, this does seem to work. Any clues why most uses of COMPATIBLE_MACHINE use the regex "(x|y|z)" instead of just "x|y|z"? Aren't they the same?

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#4 lore raw
Quoted 17 lines · Gary Thomas
Quoted 16 lines · Chris Larson
Quoted 7 lines · Gary Thomas

I'm writing a .bbappend for a recipe which contains a COMPATIBLE_MACHINE pattern like this:
 COMPATIBLE_MACHINE = "(machine1|machine2|machine3)"

Is there a way my .bbappend file can add to this pattern?  I don't want to disturb what's there, just add my machine as well.

It's just a standard regular expression.

COMPATIBLE_MACHINE = "(machine1|machine2|machine3)" COMPATIBLE_MACHINE .= "|machine4"

Quoted 6 lines
Quoted 2 lines

Will result in a value of "(machine1|machine2|machine3)|machine4", which is still a perfectly valid pattern, as far as I can tell.

Yes, this does seem to work.  Any clues why most uses of COMPATIBLE_MACHINE use the regex "(x|y|z)" instead of just "x|y|z"?  Aren't they the same?

They are. No idea why people use the grouping.

Signature · 1 line
Christopher Larson