summaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorArsen Arsenović <arsen@aarsen.me>2022-07-12 15:26:22 +0200
committerEli Schwartz <eschwartz93@gmail.com>2023-09-13 21:44:40 -0400
commit0af126fec798d6dbb0d1ad52168cc1f3f1758acd (patch)
tree41e4a51789de1e92881b29e7a7d9f13e5f369f8f /mesonbuild/backend/backends.py
parent56ef698426bb58b7ffd32b0711e064b54166e10f (diff)
downloadmeson-0af126fec798d6dbb0d1ad52168cc1f3f1758acd.tar.gz
install_{data,headers,subdir}: implement follow_symlinks
This permits users who rely on following symlinks to stay on the old default of following them.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 62cf16296..1d2283f30 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -172,6 +172,7 @@ class InstallDataBase:
subproject: str
tag: T.Optional[str] = None
data_type: T.Optional[str] = None
+ follow_symlinks: T.Optional[bool] = None
@dataclass(eq=False)
class InstallSymlinkData:
@@ -186,8 +187,9 @@ class InstallSymlinkData:
class SubdirInstallData(InstallDataBase):
def __init__(self, path: str, install_path: str, install_path_name: str,
install_mode: 'FileMode', exclude: T.Tuple[T.Set[str], T.Set[str]],
- subproject: str, tag: T.Optional[str] = None, data_type: T.Optional[str] = None):
- super().__init__(path, install_path, install_path_name, install_mode, subproject, tag, data_type)
+ subproject: str, tag: T.Optional[str] = None, data_type: T.Optional[str] = None,
+ follow_symlinks: T.Optional[bool] = None):
+ super().__init__(path, install_path, install_path_name, install_mode, subproject, tag, data_type, follow_symlinks)
self.exclude = exclude
@@ -1832,7 +1834,7 @@ class Backend:
if not isinstance(f, File):
raise MesonException(f'Invalid header type {f!r} can\'t be installed')
abspath = f.absolute_path(srcdir, builddir)
- i = InstallDataBase(abspath, outdir, outdir_name, h.get_custom_install_mode(), h.subproject, tag='devel')
+ i = InstallDataBase(abspath, outdir, outdir_name, h.get_custom_install_mode(), h.subproject, tag='devel', follow_symlinks=h.follow_symlinks)
d.headers.append(i)
def generate_man_install(self, d: InstallData) -> None:
@@ -1877,7 +1879,8 @@ class Backend:
dstdir_name = os.path.join(subdir_name, dst_name)
tag = de.install_tag or self.guess_install_tag(dst_abs)
i = InstallDataBase(src_file.absolute_path(srcdir, builddir), dst_abs, dstdir_name,
- de.install_mode, de.subproject, tag=tag, data_type=de.data_type)
+ de.install_mode, de.subproject, tag=tag, data_type=de.data_type,
+ follow_symlinks=de.follow_symlinks)
d.data.append(i)
def generate_symlink_install(self, d: InstallData) -> None:
@@ -1908,7 +1911,8 @@ class Backend:
dst_dir = os.path.join(dst_dir, os.path.basename(src_dir))
dst_name = os.path.join(dst_name, os.path.basename(src_dir))
tag = sd.install_tag or self.guess_install_tag(os.path.join(sd.install_dir, 'dummy'))
- i = SubdirInstallData(src_dir, dst_dir, dst_name, sd.install_mode, sd.exclude, sd.subproject, tag)
+ i = SubdirInstallData(src_dir, dst_dir, dst_name, sd.install_mode, sd.exclude, sd.subproject, tag,
+ follow_symlinks=sd.follow_symlinks)
d.install_subdirs.append(i)
def get_introspection_data(self, target_id: str, target: build.Target) -> T.List['TargetIntrospectionData']: