@@ -199,11 +199,57 @@ def _update_tcltk(dry_run):
199199 break
200200
201201
202+ def _update_git_lfs (dry_run ):
203+ file = PROJECT_ROOT / "docker" / "build_scripts" / "install-git-lfs.sh"
204+ lines = file .read_text ().splitlines ()
205+ re_ = re .compile (r"^GIT_LFS_VERSION=(?P<version>\S+)$" )
206+ for i in range (len (lines )):
207+ match = re_ .match (lines [i ])
208+ if match is None :
209+ continue
210+ current_version = Version (match ["version" ])
211+ latest_version = latest ("git-lfs" )
212+ if latest_version > current_version :
213+ lines [i ] = f"GIT_LFS_VERSION={ latest_version } "
214+ message = f"Bump git-lfs { current_version } → { latest_version } "
215+ print (message )
216+ if not dry_run :
217+ file .write_text ("\n " .join (lines ) + "\n " )
218+ subprocess .check_call (["git" , "commit" , "-am" , message ])
219+ break
220+
221+
222+ def _update_image (tool , dry_run ):
223+ repo = {
224+ "clang" : "mayeut/static-clang-images" ,
225+ "cosign" : "sigstore/cosign" ,
226+ }
227+ lines = DOCKERFILE .read_text ().splitlines ()
228+ re_ = re .compile (rf"^ARG MANYLINUX_{ tool .upper ()} _VERSION=(?P<version>\S+)$" )
229+ for i in range (len (lines )):
230+ match = re_ .match (lines [i ])
231+ if match is None :
232+ continue
233+ current_version = Version (match ["version" ])
234+ latest_version = latest (repo .get (tool , tool ))
235+ if latest_version > current_version :
236+ lines [i ] = f"ARG MANYLINUX_{ tool .upper ()} _VERSION={ latest_version } "
237+ message = f"Bump { tool } { current_version } → { latest_version } "
238+ print (message )
239+ if not dry_run :
240+ DOCKERFILE .write_text ("\n " .join (lines ) + "\n " )
241+ subprocess .check_call (["git" , "commit" , "-am" , message ])
242+ break
243+
244+
202245def main ():
203246 parser = argparse .ArgumentParser ()
204247 parser .add_argument ("--dry-run" , dest = "dry_run" , action = "store_true" , help = "dry run" )
205248 args = parser .parse_args ()
249+ _update_image ("clang" , args .dry_run )
250+ _update_image ("cosign" , args .dry_run )
206251 _update_cpython (args .dry_run )
252+ _update_git_lfs (args .dry_run )
207253 _update_sqlite (args .dry_run )
208254 _update_tcltk (args .dry_run )
209255 for tool in ["autoconf" , "automake" , "libtool" , "git" , "openssl" , "curl" ]:
0 commit comments