From 004575874ffdb77ee997f9c19e0a041d144994d6 Mon Sep 17 00:00:00 2001 From: Daniel Carson Date: Mon, 27 Jun 2022 16:04:48 -0400 Subject: 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. --- mesonbuild/msubprojects.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'mesonbuild/msubprojects.py') 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) -- cgit v1.1