Archived issue #0022613
Retrieve environment variable in EDL
Description
Currently environment variables doesn't availalbe within EDL scripts.
This force writing EDLs with hardcoded absolute paths making written scripts
not portable / less flexible.
This is suggested to implement this feature in some way. Possible solutions:
- parse input strings and replace substrings when special synax found (like
Unish ${MY_ENV_VAR} or NT %MY_ENV_VAR%);
- automatically fill EDL local variables list with evironment variables
(probably with special prefix like ENV_);
- add new keyword in syntax to retrieve environment variable (for example SET
VAR '=' ENV STR SEPARATOR { edl_set_var($2, edl_get_env($5)); edlstring_free
($2); edlstring_free($5);})
This force writing EDLs with hardcoded absolute paths making written scripts
not portable / less flexible.
This is suggested to implement this feature in some way. Possible solutions:
- parse input strings and replace substrings when special synax found (like
Unish ${MY_ENV_VAR} or NT %MY_ENV_VAR%);
- automatically fill EDL local variables list with evironment variables
(probably with special prefix like ENV_);
- add new keyword in syntax to retrieve environment variable (for example SET
VAR '=' ENV STR SEPARATOR { edl_set_var($2, edl_get_env($5)); edlstring_free
($2); edlstring_free($5);})
Public activity
6 archived notes
Participants are labeled by their role within this record.
EDL parser now determine ${EnvVarName} syntax to automatically retrieve environment variable.
Notice that only simplest syntax is supported (not "text${EnvVar}/${anotherVar}", "$EnvVarName" or so on). However this is should be enough to cover small cases where it is really desired. Usage example:
@set ENV_MYVAR = "${EnvVarName}"
Fix integrated to the Bug branch OCC22613 (products).
Notice that only simplest syntax is supported (not "text${EnvVar}/${anotherVar}", "$EnvVarName" or so on). However this is should be enough to cover small cases where it is really desired. Usage example:
@set ENV_MYVAR = "${EnvVarName}"
Fix integrated to the Bug branch OCC22613 (products).
My remarks:
1. Too many spaces in white spaces, which make revision difficult. Please try to keep white-space and formatting changes in non-modified code minimal
2. In EDL_Interpretor.cxx, the if statement before use of OSD_Environment seems to lack comparison in the last argument:
> if (aValLen > 3 && theValue[0] == '$' && theValue[1] == '{' && theValue[aValLen - 1])
it perhaps should be
> if (aValLen > 3 && theValue[0] == '$' && theValue[1] == '{' && theValue[aValLen - 1] == '}')
1. Too many spaces in white spaces, which make revision difficult. Please try to keep white-space and formatting changes in non-modified code minimal
2. In EDL_Interpretor.cxx, the if statement before use of OSD_Environment seems to lack comparison in the last argument:
> if (aValLen > 3 && theValue[0] == '$' && theValue[1] == '{' && theValue[aValLen - 1])
it perhaps should be
> if (aValLen > 3 && theValue[0] == '$' && theValue[1] == '{' && theValue[aValLen - 1] == '}')
Fixed second remark.
No remarks, please test
Dear Commenter 1,
Workbench KAS:dev:aan-OCC22613-occt was created from SVN trunk
(and aan-OCC22613-products from http://svn/svn/occt-products/branches/OCC22613) and compiled on Linux platform.
There are not regressions in aan-OCC22613-products regarding to KAS:dev:products-20120120-opt
See results in /QADisk/occttests/results/KAS/dev/ aan-OCC22613-products_26012012/lin
See reference results in /QADisk/occttests/results/KAS/dev/products-20120120-opt_20012012/lin
See test cases in /QADisk/occttests/tests/ED
N.B. In order to launch testing case you can make use the following instructions
http://doc/doku.php?id=occt:certification
Workbench KAS:dev:aan-OCC22613-occt was created from SVN trunk
(and aan-OCC22613-products from http://svn/svn/occt-products/branches/OCC22613) and compiled on Linux platform.
There are not regressions in aan-OCC22613-products regarding to KAS:dev:products-20120120-opt
See results in /QADisk/occttests/results/KAS/dev/ aan-OCC22613-products_26012012/lin
See reference results in /QADisk/occttests/results/KAS/dev/products-20120120-opt_20012012/lin
See test cases in /QADisk/occttests/tests/ED
N.B. In order to launch testing case you can make use the following instructions
http://doc/doku.php?id=occt:certification
Integration into trunk of occt-products repository
Date: 2012-01-27 17:08:46 +0400 (Fri, 27 Jan 2012)
New Revision: 18505
Modified:
trunk/src/EDL/EDL_Interpretor.cxx
Date: 2012-01-27 17:08:46 +0400 (Fri, 27 Jan 2012)
New Revision: 18505
Modified:
trunk/src/EDL/EDL_Interpretor.cxx