From a13bde821f53919fe6eb0ca14c4463afc08e5a27 Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Tue, 25 Apr 2017 19:32:44 +0300 Subject: wrap: initialize submodules when updating MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After an initial checkout, submodules aren’t initialized and thus trying to update them fails. Partially fixes #1679 Signed-off-by: Ernestas Kulik --- mesonbuild/wrap/wrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index 67e4700..9e5910b 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -159,7 +159,7 @@ class Resolver: return False # Submodule has not been added, add it if out.startswith(b'-'): - if subprocess.call(['git', 'submodule', 'update', dirname]) != 0: + if subprocess.call(['git', 'submodule', 'update', '--init', dirname]) != 0: return False # Submodule was added already, but it wasn't populated. Do a checkout. elif out.startswith(b' '): -- cgit v1.1 From 8d720527b7ec3ab4285da49843bf15585cf83238 Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Tue, 25 Apr 2017 19:33:29 +0300 Subject: wrap: pass -C to git when resolving submodules Using Meson from outside a git repo results in an error when trying to resolve submodule subprojects. Running git from inside subproject root should be enough to fix it. Partially fixes #1679 Signed-off-by: Ernestas Kulik --- mesonbuild/wrap/wrap.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index 9e5910b..713d685 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -38,8 +38,9 @@ def build_ssl_context(): ctx.load_default_certs() return ctx -def quiet_git(cmd): - pc = subprocess.Popen(['git'] + cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) +def quiet_git(cmd, workingdir): + pc = subprocess.Popen(['git', '-C', workingdir] + cmd, + stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = pc.communicate() if pc.returncode != 0: return False, err @@ -150,16 +151,16 @@ class Resolver: def resolve_git_submodule(self, dirname): # Are we in a git repository? - ret, out = quiet_git(['rev-parse']) + ret, out = quiet_git(['rev-parse'], self.subdir_root) if not ret: return False # Is `dirname` a submodule? - ret, out = quiet_git(['submodule', 'status', dirname]) + ret, out = quiet_git(['submodule', 'status', dirname], self.subdir_root) if not ret: return False # Submodule has not been added, add it if out.startswith(b'-'): - if subprocess.call(['git', 'submodule', 'update', '--init', dirname]) != 0: + if subprocess.call(['git', '-C', self.subdir_root, 'submodule', 'update', '--init', dirname]) != 0: return False # Submodule was added already, but it wasn't populated. Do a checkout. elif out.startswith(b' '): -- cgit v1.1 From 4104db5f07551dc811d40a7cefb4f04246953a1c Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Thu, 27 Apr 2017 18:34:34 +0300 Subject: authors.txt: add self --- authors.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/authors.txt b/authors.txt index 9b2ea72..91473a1 100644 --- a/authors.txt +++ b/authors.txt @@ -81,3 +81,4 @@ Wade Berrier Richard Hughes Rafael Fontenelle Michael Olbrich +Ernestas Kulik -- cgit v1.1