summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDarryl Green <darryl.green@arm.com>2019-03-08 11:12:19 +0000
committerDarryl Green <darryl.green@arm.com>2019-04-18 11:47:28 +0100
commit3f742987b86a7c9146c5980ac916a851763995fc (patch)
tree69053cdac95c30e364ac2f143ca4cb126d5aca91 /scripts
parent88bfbc2deb78847679b1385a1eecb14ce2f00d01 (diff)
Fetch the remote crypto branch, rather than cloning it
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/abi_check.py40
1 files changed, 21 insertions, 19 deletions
diff --git a/scripts/abi_check.py b/scripts/abi_check.py
index 19316915..d23b038e 100755
--- a/scripts/abi_check.py
+++ b/scripts/abi_check.py
@@ -151,29 +151,31 @@ class AbiChecker(object):
return
if version.crypto_repository:
- shutil.rmtree(os.path.join(git_worktree_path, "crypto"))
- clone_process = subprocess.Popen(
- [self.git_command, "clone", version.crypto_repository,
- "--branch", version.crypto_revision, "crypto"],
- cwd=git_worktree_path,
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT
- )
- clone_output, _ = clone_process.communicate()
- self.log.info(clone_output.decode("utf-8"))
- if clone_process.returncode != 0:
- raise Exception("git clone failed, aborting")
- else:
- checkout_process = subprocess.Popen(
- [self.git_command, "checkout", version.crypto_revision],
+ fetch_process = subprocess.Popen(
+ [self.git_command, "fetch", version.crypto_repository,
+ version.crypto_revision],
cwd=os.path.join(git_worktree_path, "crypto"),
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
- checkout_output, _ = checkout_process.communicate()
- self.log.info(checkout_output.decode("utf-8"))
- if checkout_process.returncode != 0:
- raise Exception("git checkout failed, aborting")
+ fetch_output, _ = fetch_process.communicate()
+ self.log.info(fetch_output.decode("utf-8"))
+ if fetch_process.returncode != 0:
+ raise Exception("git fetch failed, aborting")
+ crypto_rev = "FETCH_HEAD"
+ else:
+ crypto_rev = version.crypto_revision
+
+ checkout_process = subprocess.Popen(
+ [self.git_command, "checkout", crypto_rev],
+ cwd=os.path.join(git_worktree_path, "crypto"),
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT
+ )
+ checkout_output, _ = checkout_process.communicate()
+ self.log.info(checkout_output.decode("utf-8"))
+ if checkout_process.returncode != 0:
+ raise Exception("git checkout failed, aborting")
def _build_shared_libraries(self, git_worktree_path, version):
"""Build the shared libraries in the specified worktree."""