cros_workon info: Better handling of CROS_WORKON_PROJECT.

We currently have a problem with -9999 ebuilds with multiple values in
CROS_WORKON_PROJECT are causing cros_workon to output errors. This is
fixed as follows:

- CROS_WORKON_PROJECT assignments are extracted more precisely,
  including arrays.

- Multiple values are concatenated into comma-separated strings.

- When no project value(s) were found, output a dash ('-').

- When an error occurs we do not attempt to dump information for that

This would still print an error if some assignment failed to evaluate
correctly, making the problem evident (and allowing us to further adjust
the parsing logic as needed).

TEST='cros_workon info' parses all ebuilds correctly.
TEST=cros_workon info system_api shows complete list of projects.

Change-Id: I2045a80d30b1ff41b12e0b36812f1ed21e6b4fe7
Reviewed-by: David James <>
Tested-by: Gilad Arnold <>
Commit-Queue: Gilad Arnold <>
1 file changed