Parse ``text`` and return a tuple of (variables, errors) where variables is a list of bashparse.ShellVariables with a name listed in the ``names`` set.
(text)
| 274 | |
| 275 | |
| 276 | def get_apkbuild_variables(text): |
| 277 | """ |
| 278 | Parse ``text`` and return a tuple of (variables, errors) where variables is |
| 279 | a list of bashparse.ShellVariables with a name listed in the ``names`` set. |
| 280 | """ |
| 281 | fixed_text = fix_apkbuild(text) |
| 282 | |
| 283 | variables, errors = bashparse.collect_shell_variables_from_text( |
| 284 | text=fixed_text, |
| 285 | resolve=True, |
| 286 | needed_variables=APKBUILD_VARIABLES, |
| 287 | ) |
| 288 | return variables, errors |
| 289 | |
| 290 | |
| 291 | def replace_fix(text, source, target, *args): |
no test coverage detected