From 685cf431a337dd0da986f8b5e22602d657375388 Mon Sep 17 00:00:00 2001 From: Alex Pyrgiotis Date: Mon, 20 Jan 2025 12:28:34 +0200 Subject: [PATCH] FIXUP: Handle diffoci updates appropriately --- dev_scripts/reproduce.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dev_scripts/reproduce.py b/dev_scripts/reproduce.py index 9013e79..6480cf3 100755 --- a/dev_scripts/reproduce.py +++ b/dev_scripts/reproduce.py @@ -47,8 +47,13 @@ def diffoci_hash_matches(diffoci): return diffoci_checksum == DIFFOCI_CHECKSUM -def diffoci_exists(): - """Check if the diffoci helper exists, and if the hash matches.""" +def diffoci_is_installed(): + """Determine if diffoci has been installed. + + Determine if diffoci has been installed, by checking if the binary exists, and if + its hash is the expected one. If the binary exists but the hash is different, then + this is a sign that we need to update the local diffoci binary. + """ if not DIFFOCI_PATH.exists(): return False return diffoci_hash_matches(DIFFOCI_PATH.open().read()) @@ -134,7 +139,7 @@ def main(): commit = git_commit_get() git_verify(commit, args.source) - if diffoci_exists(): + if not diffoci_is_installed(): logger.info(f"Downloading diffoci helper from {DIFFOCI_URL}") diffoci_download()