Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b987eb68 authored by Abhishek Pandit-Subedi's avatar Abhishek Pandit-Subedi
Browse files

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
parent e923d43e
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -511,16 +511,15 @@ 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)

        # 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)
@@ -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