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
  ebuild.

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).

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

Change-Id: I2045a80d30b1ff41b12e0b36812f1ed21e6b4fe7
Reviewed-on: https://chromium-review.googlesource.com/254640
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
1 file changed