This logic is used in the various build-related REPL commands and is factored out to make it easier to write the handlers for each build-related REPL commands. Change-Id: Iaa18df489db75495b12924e9a76b3fff1975eb64 Signed-off-by: Raito Bezarius <raito@lix.systems>