From 27cd8c1e28f310891fa671976a0f3b4231ceb4b0 Mon Sep 17 00:00:00 2001 From: Alexandre Foley Date: Tue, 6 Dec 2016 12:32:39 -0500 Subject: =?UTF-8?q?The=20=E2=80=9Cdirectory=20present=20and=20not=20empty?= =?UTF-8?q?=E2=80=9D=20return=20condition=20was=20necessary=20for=20subpro?= =?UTF-8?q?ject=20to=20work=20without=20a=20wrap=20file.=20Put=20it=20back?= =?UTF-8?q?=20with=20that=20added=20condition=20that=20there=20mustn?= =?UTF-8?q?=E2=80=99t=20be=20a=20wrap=20file=20present=20for=20returning?= =?UTF-8?q?=20the=20package=20immediately.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mesonbuild/wrap/wrap.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index 57c7353..12536fe 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -94,7 +94,12 @@ class Resolver: fname = os.path.join(self.subdir_root, packagename + '.wrap') dirname = os.path.join(self.subdir_root, packagename) try: - if not os.listdir(dirname): + if os.listdir(dirname): + if not os.path.isfile(fname) : + # The directory is there, not empty and there isn't a wrap file? + # Great, use it. + return packagename + else: mlog.warning('Subproject directory %s is empty, removing to' ' ensure clean download' % dirname) os.rmdir(dirname) -- cgit v1.1