I've got a number of FinalBuilder variables to control which packages get built in my FinalBuilder script. Their names are like %Build_connect-core% for the connect-core package, %Build_connect-admin% for connect-admin, %Build_mydns-mysql% for the mydns-mysql package, etc.
I've just written a perl script that gives me a list of packages that need to be built. I'd like to be able to set the Build_* variables based on the list of packages, so if I see "connect-core" in the list I want to set %Build_connect-core% to "True" (they all default to "False"). I was thinking of using a list iterator on the list of packages, putting each package name in turn in a %TEMP% variable, and then somehow setting the appropriate Build_* variable based on what is in %TEMP%. I could have a whole bunch of if ... Then actions, one for each possible package, but that's pretty inelegant and makes it a pain when we add more packages. It seems like there ought to be a better way.
Is there a way to Create a variable name in a variable, and then assign to the name I just created? Basically, if %TEMP% contains "connect-core", I want to assign "%%Build_%TEMP%%%" to a variable, so its value ends up being "%Build_connect-core%" and then use that as a reference to the real variable that I want to set to "True". I know I can use that sort of constuct on the "right side" of an assignment, but is there a way to create an lvalue at runtime?
Or is there a better way? In perl I'd use a hash called %Build and just say $Build{$TEMP} = True. Is there equivalent functionality in Finalbuilder that I've missed?
Thanks,
Keith