Try to cleanup repositories in case of build failure

Change-Id: I45f1ff4298eb9588ed383dc2a492219a3c3b2a83
Only execute .profile if it exists

Change-Id: Ib2d3fcf8d844c1e1ca5200232418e51bf0a4fbd4
Fix error message checks

Change-Id: I6029ca17c36646cd330ed830b6fa41c1a2b111f5
Make the bulid targets a return seperated file

Change-Id: I6e6226b71198f989b5f7ab31898e7291353bbc60