minstall: always track meson-created directories

If a custom_target output is a directory, we install it as a directory,
not as a file. And, we try to track subdirectories which are created so
uninstalling works. But one directory creation did not go through
DirMaker, in the case where the output directory does not have any
further subdirectories.

Consolidate on makedirs, since I don't see much point in using os.mkdir
right here.
pull/8555/head
Eli Schwartz 4 years ago
parent 3990754bf5
commit 0ad870f3dc
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 6
      mesonbuild/minstall.py

@ -292,10 +292,6 @@ class Installer:
# ['sub1', ...] means skip only those.
self.skip_subprojects = [i.strip() for i in options.skip_subprojects.split(',')]
def mkdir(self, *args: T.Any, **kwargs: T.Any) -> None:
if not self.dry_run:
os.mkdir(*args, **kwargs)
def remove(self, *args: T.Any, **kwargs: T.Any) -> None:
if not self.dry_run:
os.remove(*args, **kwargs)
@ -479,7 +475,7 @@ class Installer:
sys.exit(1)
parent_dir = os.path.dirname(abs_dst)
if not os.path.isdir(parent_dir):
self.mkdir(parent_dir)
dm.makedirs(parent_dir)
self.copystat(os.path.dirname(abs_src), parent_dir)
# FIXME: what about symlinks?
self.do_copyfile(abs_src, abs_dst)

Loading…
Cancel
Save