From: Ralf Jung Date: Sun, 29 Jul 2012 21:07:41 +0000 (+0200) Subject: Make auto-debuild configuration idempotent X-Git-Url: https://git.ralfj.de/mass-build.git/commitdiff_plain/d8db4c363bdec84a2f0b2a53ec176ac8f2419342?ds=sidebyside Make auto-debuild configuration idempotent --- diff --git a/build_system.py b/build_system.py index 6e72e71..979a47a 100644 --- a/build_system.py +++ b/build_system.py @@ -68,6 +68,7 @@ try: self.autoDebuildConfig[dstName] = src[name] def configure(self, force=False): # force is ignored + if self.configured: return # do not configure twice self.autoDebuildConfig['version'] = self.vcs.version() # by now, data has been fetched, so this is possible if self.autoDebuildConfig['version'] is None: raise Exception("VCS did not provide us with a proper version, please fix this") @@ -77,12 +78,12 @@ try: self.configured = True def build(self): - if not self.configured: self.configure() + self.configure() # make sure we are configured (this call is idempotent) os.chdir(self.sourceFolder) auto_debuild.buildDebianPackage(self.autoDebuildConfig) def install(self): - if not self.configured: self.configure() + self.configure() # make sure we are configured (this call is idempotent) os.chdir(self.sourceFolder) subprocess.check_call(['sudo', 'dpkg', '--install'] + self.files) except ImportError: