diff options
author | Daniel Carson <danielcarson271@gmail.com> | 2022-06-27 16:04:48 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-09-18 22:48:50 -0400 |
commit | 004575874ffdb77ee997f9c19e0a041d144994d6 (patch) | |
tree | 939353cff137c4718bbf19d7756f0c040c9bc5a9 /mesonbuild/msubprojects.py | |
parent | 97f248db24fe88495dbe35bbae6eafd643c0c94b (diff) | |
download | meson-004575874ffdb77ee997f9c19e0a041d144994d6.zip meson-004575874ffdb77ee997f9c19e0a041d144994d6.tar.gz meson-004575874ffdb77ee997f9c19e0a041d144994d6.tar.bz2 |
Warn if wrap file changes
Save off the hash of the wrap file when first configuring a subproject.
When reconfiguring a subproject, check the hash of the wrap file
against the stored hash. If they don't match then warn the user.
Diffstat (limited to 'mesonbuild/msubprojects.py')
-rwxr-xr-x | mesonbuild/msubprojects.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/mesonbuild/msubprojects.py b/mesonbuild/msubprojects.py index 21f0853..f8c0b92 100755 --- a/mesonbuild/msubprojects.py +++ b/mesonbuild/msubprojects.py @@ -394,19 +394,22 @@ class Runner: def update(self) -> bool: self.log(f'Updating {self.wrap.name}...') + success = False if self.wrap.type == 'file': - return self.update_file() + success = self.update_file() elif self.wrap.type == 'git': - return self.update_git() + success = self.update_git() elif self.wrap.type == 'hg': - return self.update_hg() + success = self.update_hg() elif self.wrap.type == 'svn': - return self.update_svn() + success = self.update_svn() elif self.wrap.type is None: self.log(' -> Cannot update subproject with no wrap file') else: self.log(' -> Cannot update', self.wrap.type, 'subproject') - return True + if success: + self.wrap.update_hash_cache(self.wrap_resolver.dirname) + return success def checkout(self) -> bool: options = T.cast('CheckoutArguments', self.options) |