wrap: Ignore directories that have a .wrap with the same name

If we update e.g. glib.wrap from wrap-git with directory=glib to
wrap-file with directory=glib-2.70 we could still have the glib
directory that is not referenced by any .wrap file any more. We should
still ignore that directory otherwise it overrides the glib.wrap we
parsed.
pull/10357/head
Xavier Claessens 3 years ago
parent 46acd6cd4a
commit 312bede496
  1. 6
      mesonbuild/wrap/wrap.py

@ -283,17 +283,17 @@ class Resolver:
if not os.path.isdir(self.subdir_root):
return
root, dirs, files = next(os.walk(self.subdir_root))
ignore_dirs = {'packagecache', 'packagefiles'}
for i in files:
if not i.endswith('.wrap'):
continue
fname = os.path.join(self.subdir_root, i)
wrap = PackageDefinition(fname, self.subproject)
self.wraps[wrap.name] = wrap
if wrap.directory in dirs:
dirs.remove(wrap.directory)
ignore_dirs |= {wrap.directory, wrap.name}
# Add dummy package definition for directories not associated with a wrap file.
for i in dirs:
if i in ['packagecache', 'packagefiles']:
if i in ignore_dirs:
continue
fname = os.path.join(self.subdir_root, i)
wrap = PackageDefinition(fname, self.subproject)

Loading…
Cancel
Save