summaryrefslogtreecommitdiff
path: root/build.py
diff options
context:
space:
mode:
author Abhishek Pandit-Subedi <abhishekpandit@google.com> 2021-11-17 17:27:31 -0800
committer Abhishek Pandit-Subedi <abhishekpandit@google.com> 2021-11-23 15:06:16 -0800
commitb987eb6880aa9253c6457800cb741502245b0e84 (patch)
treeff93f6896693571fdfd4094fcd085a996987762e /build.py
parente923d43e6e917c09d3bc357564dd474f6cf25856 (diff)
floss: Update symlinks when re-running --run-bootstrap
If re-running --run-bootstrap multiple times, do everything except git clone on re-runs. This makes it possible to switch between multiple repos when developing while sharing the staging directory at ~/.floss. Bug: 207009162 Tag: #floss Test: ./build.py --run-bootstrap Change-Id: Iba7324a3ab88ae47cf275e1492395508135ff76d
Diffstat (limited to 'build.py')
-rwxr-xr-xbuild.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/build.py b/build.py
index 3fcb2fb14a..3297c20260 100755
--- a/build.py
+++ b/build.py
@@ -511,19 +511,18 @@ class Bootstrap():
This will check out all the git repos and symlink everything correctly.
"""
- # If already set up, exit early
- if os.path.isfile(self.dir_setup_complete):
- print('{} already set-up. Updating instead.'.format(self.base_dir))
- self._update_platform2()
- return
-
# Create all directories we will need to use
for dirpath in [self.git_dir, self.staging_dir, self.output_dir, self.external_dir]:
- os.makedirs(dirpath)
+ os.makedirs(dirpath, exist_ok=True)
- # Check out all repos in git directory
- for repo in BOOTSTRAP_GIT_REPOS.values():
- subprocess.check_call(['git', 'clone', repo], cwd=self.git_dir)
+ # If already set up, only update platform2
+ if os.path.isfile(self.dir_setup_complete):
+ print('{} already set-up. Updating instead.'.format(self.base_dir))
+ self._update_platform2()
+ else:
+ # Check out all repos in git directory
+ for repo in BOOTSTRAP_GIT_REPOS.values():
+ subprocess.check_call(['git', 'clone', repo], cwd=self.git_dir)
# Symlink things
symlinks = [
@@ -537,6 +536,7 @@ class Bootstrap():
# Create symlinks
for pairs in symlinks:
(src, dst) = pairs
+ os.unlink(dst)
os.symlink(src, dst)
# Write to setup complete file so we don't repeat this step