Refactor bashrc scripts sourcing

Creates two new helper functions __try_source and __source_env_files to simplify
__source_all_bashrcs.

(cherry picked from commit 60ee4deefb701d532fdd279caa989e7a6f4b8400)

Change-Id: Iafd66157ec3f29211b51ff1411b05c04622fd9c9
Reviewed-on: https://chromium-review.googlesource.com/225511
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Bertrand Simonnet <bsimonnet@chromium.org>
2 files changed