aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Foley <Alexandre.foley@usherbrooke.ca>2016-12-06 12:32:39 -0500
committerAlexandre Foley <Alexandre.foley@usherbrooke.ca>2016-12-06 12:32:39 -0500
commit27cd8c1e28f310891fa671976a0f3b4231ceb4b0 (patch)
tree3b8cb5036d1fd771089c6a18fbf21ced877fe42c
parent61d5934e63af65536cd22ef16127b4920c21c4f3 (diff)
downloadmeson-27cd8c1e28f310891fa671976a0f3b4231ceb4b0.zip
meson-27cd8c1e28f310891fa671976a0f3b4231ceb4b0.tar.gz
meson-27cd8c1e28f310891fa671976a0f3b4231ceb4b0.tar.bz2
The “directory present and not empty” return condition was necessary for subproject to work without a wrap file. Put it back with that added condition that there mustn’t be a wrap file present for returning the package immediately.
-rw-r--r--mesonbuild/wrap/wrap.py7
1 files changed, 6 insertions, 1 deletions
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)