summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Partin <tristan@partin.io>2024-02-23 12:43:42 -0600
committerDylan Baker <dylan@pnwbakers.com>2024-02-24 13:09:24 -0800
commit35c605272378def120e3499b3f59bbcbdf72fef5 (patch)
tree86a600eeb99055038de399b303bceb103240dfa1
parent9cb44c9c5848c151d4f355757d33e5808311deba (diff)
downloadmeson-35c605272378def120e3499b3f59bbcbdf72fef5.tar.gz
Fix fs module FeatureNew prefixes to match the function name
They were appending _file to the function name when they were meant to suggest that the function now supports file objects.
-rw-r--r--mesonbuild/modules/fs.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/mesonbuild/modules/fs.py b/mesonbuild/modules/fs.py
index a666d6efe..1f670d373 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, location=state.current_node)
+ FeatureNew('fs.is_absolute with 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, location=state.current_node)
+ FeatureNew('fs.is_symlink with 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, location=state.current_node)
+ FeatureNew('fs.hash with 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, location=state.current_node)
+ FeatureNew('fs.size with 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, location=state.current_node)
+ FeatureNew('fs.is_samepath with 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, location=state.current_node)
+ FeatureNew('fs.replace_suffix with 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)
@@ -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, location=state.current_node)
+ FeatureNew('fs.name with 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, location=state.current_node)
+ FeatureNew('fs.stem with file', '0.59.0').use(state.subproject, location=state.current_node)
original = PurePath(str(args[0]))
new = original.stem
return str(new)