[jhbuild] meson: Fix error when reconfiguring existing project



commit 3902e8b9642cc1f9105d3fd795d8057b60a192df
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Oct 9 09:34:14 2016 -0500

    meson: Fix error when reconfiguring existing project
    
    It's not allowed to reconfigure a project inside an existing build
    directory, we have to wipe the build directory

 jhbuild/modtypes/meson.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/jhbuild/modtypes/meson.py b/jhbuild/modtypes/meson.py
index e678d5d..6e648cf 100644
--- a/jhbuild/modtypes/meson.py
+++ b/jhbuild/modtypes/meson.py
@@ -20,12 +20,14 @@
 __metaclass__ = type
 
 import os
+import shutil
 
 from jhbuild.errors import BuildStateError, CommandError
 from jhbuild.modtypes import \
      Package, DownloadableModule, register_module_type, MakeModule
 from jhbuild.modtypes.autotools import collect_args
 from jhbuild.commands.sanitycheck import inpath
+from jhbuild.utils import fileutils
 
 __all__ = [ 'MesonModule' ]
 
@@ -90,8 +92,11 @@ class MesonModule(MakeModule, DownloadableModule):
         buildscript.set_action(_('Configuring'), self)
         srcdir = self.get_srcdir(buildscript)
         builddir = self.get_builddir(buildscript)
-        if not os.path.exists(builddir):
-            os.makedirs(builddir)
+        # meson does not allow configuring if the builddir already exists,
+        # so we'll need to get rid of it and start over to configure again.
+        if os.path.exists(builddir):
+            shutil.rmtree(builddir)
+        os.makedirs(builddir)
         prefix = os.path.expanduser(buildscript.config.prefix)
         if not inpath('meson', os.environ['PATH'].split(os.pathsep)):
             raise CommandError(_('%s not found') % 'meson')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]