File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646from cfbs .cfbs_config import CFBSConfig , CFBSReturnWithoutCommit
4747from cfbs .validate import validate_config
4848from cfbs .internal_file_management import (
49+ clone_url_repo ,
4950 fetch_archive ,
5051 get_download_path ,
5152 local_module_copy ,
@@ -660,6 +661,16 @@ def _update_variable(input_def, input_data):
660661 return changes_made
661662
662663
664+ def update_module_from_url (module ):
665+ _ , latest_commit = clone_url_repo (module .get ("url" ))
666+
667+ changes_made = module ["commit" ] != latest_commit
668+ if changes_made :
669+ module ["commit" ] = latest_commit
670+
671+ return changes_made
672+
673+
663674@cfbs_command ("update" )
664675@commit_after_command ("Updated module%s" , [PLURAL_S ])
665676def update_command (to_update ):
@@ -707,10 +718,11 @@ def update_command(to_update):
707718 continue
708719
709720 if "version" not in module :
710- log .warning (
711- "Module '%s' not updatable. Skipping its update." % module ["name" ]
712- )
713721 log .debug ("Module '%s' has no version attribute." % module ["name" ])
722+
723+ changes_made = update_module_from_url (module )
724+ if not changes_made :
725+ print ("Module '%s' already up to date" % module ["name" ])
714726 continue
715727 old_version = module ["version" ]
716728
You can’t perform that action at this time.
0 commit comments