diff options
| author | Tristan Partin <tristan@partin.io> | 2023-08-18 01:50:24 -0500 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2024-02-23 13:31:08 -0500 |
| commit | 1b40fb1089090b4d23d46a10239e1bfea7ba53a8 (patch) | |
| tree | b5c443c91c4edd805df6201a11195d3de7a74dde | |
| parent | e7f20efc8bd123bfc2c325198866850694612a23 (diff) | |
| download | meson-1b40fb1089090b4d23d46a10239e1bfea7ba53a8.tar.gz | |
Add location nodes to FeatureNews in the fs module
| -rw-r--r-- | mesonbuild/modules/fs.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/mesonbuild/modules/fs.py b/mesonbuild/modules/fs.py index d3f37dcb9..c76e744ab 100644 --- a/mesonbuild/modules/fs.py +++ b/mesonbuild/modules/fs.py @@ -97,7 +97,7 @@ class FSModule(ExtensionModule): @typed_pos_args('fs.is_absolute', (str, File)) def is_absolute(self, state: 'ModuleState', args: T.Tuple['FileOrString'], kwargs: T.Dict[str, T.Any]) -> bool: if isinstance(args[0], File): - FeatureNew('fs.is_absolute_file', '0.59.0').use(state.subproject) + FeatureNew('fs.is_absolute_file', '0.59.0').use(state.subproject, location=state.current_node) return PurePath(str(args[0])).is_absolute() @noKwargs @@ -119,7 +119,7 @@ class FSModule(ExtensionModule): @typed_pos_args('fs.is_symlink', (str, File)) def is_symlink(self, state: 'ModuleState', args: T.Tuple['FileOrString'], kwargs: T.Dict[str, T.Any]) -> bool: if isinstance(args[0], File): - FeatureNew('fs.is_symlink_file', '0.59.0').use(state.subproject) + FeatureNew('fs.is_symlink_file', '0.59.0').use(state.subproject, location=state.current_node) return self._absolute_dir(state, args[0]).is_symlink() @noKwargs @@ -136,7 +136,7 @@ class FSModule(ExtensionModule): @typed_pos_args('fs.hash', (str, File), str) def hash(self, state: 'ModuleState', args: T.Tuple['FileOrString', str], kwargs: T.Dict[str, T.Any]) -> str: if isinstance(args[0], File): - FeatureNew('fs.hash_file', '0.59.0').use(state.subproject) + FeatureNew('fs.hash_file', '0.59.0').use(state.subproject, location=state.current_node) file = self._resolve_dir(state, args[0]) if not file.is_file(): raise MesonException(f'{file} is not a file and therefore cannot be hashed') @@ -152,7 +152,7 @@ class FSModule(ExtensionModule): @typed_pos_args('fs.size', (str, File)) def size(self, state: 'ModuleState', args: T.Tuple['FileOrString'], kwargs: T.Dict[str, T.Any]) -> int: if isinstance(args[0], File): - FeatureNew('fs.size_file', '0.59.0').use(state.subproject) + FeatureNew('fs.size_file', '0.59.0').use(state.subproject, location=state.current_node) file = self._resolve_dir(state, args[0]) if not file.is_file(): raise MesonException(f'{file} is not a file and therefore cannot be sized') @@ -165,7 +165,7 @@ class FSModule(ExtensionModule): @typed_pos_args('fs.is_samepath', (str, File), (str, File)) def is_samepath(self, state: 'ModuleState', args: T.Tuple['FileOrString', 'FileOrString'], kwargs: T.Dict[str, T.Any]) -> bool: if isinstance(args[0], File) or isinstance(args[1], File): - FeatureNew('fs.is_samepath_file', '0.59.0').use(state.subproject) + FeatureNew('fs.is_samepath_file', '0.59.0').use(state.subproject, location=state.current_node) file1 = self._resolve_dir(state, args[0]) file2 = self._resolve_dir(state, args[1]) if not file1.exists(): @@ -181,7 +181,7 @@ class FSModule(ExtensionModule): @typed_pos_args('fs.replace_suffix', (str, File), str) def replace_suffix(self, state: 'ModuleState', args: T.Tuple['FileOrString', str], kwargs: T.Dict[str, T.Any]) -> str: if isinstance(args[0], File): - FeatureNew('fs.replace_suffix_file', '0.59.0').use(state.subproject) + FeatureNew('fs.replace_suffix_file', '0.59.0').use(state.subproject, location=state.current_node) original = PurePath(str(args[0])) new = original.with_suffix(args[1]) return str(new) @@ -190,7 +190,7 @@ class FSModule(ExtensionModule): @typed_pos_args('fs.parent', (str, File)) def parent(self, state: 'ModuleState', args: T.Tuple['FileOrString'], kwargs: T.Dict[str, T.Any]) -> str: if isinstance(args[0], File): - FeatureNew('fs.parent_file', '0.59.0').use(state.subproject) + FeatureNew('fs.parent_file', '0.59.0').use(state.subproject, location=state.current_node) original = PurePath(str(args[0])) new = original.parent return str(new) @@ -199,7 +199,7 @@ class FSModule(ExtensionModule): @typed_pos_args('fs.name', (str, File)) def name(self, state: 'ModuleState', args: T.Tuple['FileOrString'], kwargs: T.Dict[str, T.Any]) -> str: if isinstance(args[0], File): - FeatureNew('fs.name_file', '0.59.0').use(state.subproject) + FeatureNew('fs.name_file', '0.59.0').use(state.subproject, location=state.current_node) original = PurePath(str(args[0])) new = original.name return str(new) @@ -209,7 +209,7 @@ class FSModule(ExtensionModule): @FeatureNew('fs.stem', '0.54.0') def stem(self, state: 'ModuleState', args: T.Tuple['FileOrString'], kwargs: T.Dict[str, T.Any]) -> str: if isinstance(args[0], File): - FeatureNew('fs.stem_file', '0.59.0').use(state.subproject) + FeatureNew('fs.stem_file', '0.59.0').use(state.subproject, location=state.current_node) original = PurePath(str(args[0])) new = original.stem return str(new) |
