aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/fs.py
AgeCommit message (Collapse)AuthorFilesLines
2021-02-04Introduce `fs.read` to read a file as a stringLuke Drummond1-1/+64
Following #7890, this patch introduces the ability to read the contents of a file to the fs module. This patch introduces the ability to read files at configure time, but has some restrictions: - binary files are not supported (I don't think this will prove a problem, and if people are wanting to do something with binary files, they should probably be shelling out to their own script). - Only files outside the build directory allowed. This limitation should prevent build loops. Given that reading an arbitrary file at configure time can affect the configuration in almost arbitrary ways, meson should force a reconfigure when the given file changes. This is non-configurable, but this can easily be changed with a future keyword argument.
2021-01-13Fix misspellsAntonin Décimo1-1/+1
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2020-11-20use real pathlib moduleDylan Baker1-1/+1
We added the _pathlib module to work around defeciencies in python 3.5's implementation, since we now rely on 3.6 lets drop this
2020-10-04pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger1-1/+1
2020-09-08typing: fully annotate fs moduleDaniel Mensinger1-4/+4
2020-02-06add FeatureNewMichael Hirsch, Ph.D1-0/+5
2020-02-06add fs.stem()Michael Hirsch, Ph.D1-2/+11
2020-02-06fs: add expanduser methodMichael Hirsch, Ph.D1-1/+8
this should help users specify leading `~` in various Meson options and variables without refactoring lots of places inside Meson itself.
2020-02-06fs: add methods as_posix, is_absoluteMichael Hirsch, Ph.D1-7/+43
fs: make exception specify method name fs: actually raise exceptions fs: resolve path e.g. /opt/foo/.. => /opt/foo fs: correct behavior of is_symlink
2020-01-08types: import typing as T (fixes #6333)Daniel Mensinger1-13/+13
2019-12-19fs: rename samefile => is_samepathMichael Hirsch, Ph.D1-5/+5
is_samepath better reflects the nature of this function--that files and directories can be compared. Also, instead of raising exceptions, simply return False when one or both .is_samepath(path1, path1) don't exist. This is more intuitive behavior and avoids having an extra if fs.exist() to go with every fs.is_samepath()
2019-12-04Add raise at the start of MesonExceptionMichael Brockus1-7/+7
2019-11-25fs: Add parent() and name() methodsXavier Claessens1-0/+17
2019-11-17fs: make replace_suffix not expand file to absolute path, just manipulate ↵Michael Hirsch, Ph.D1-1/+1
the string
2019-11-17fs: replace_suffixMichael Hirsch, Ph.D1-1/+1
2019-11-17fs: get file sizeMichael Hirsch, Ph.D1-2/+38
fs: add samefile
2019-11-17fs: add hash compute methodMichael Hirsch, Ph.D1-0/+18
2019-11-17add fs.with_suffixMichael Hirsch, Ph.D1-1/+11
2019-11-17fs: improve exception feedbackMichael Hirsch, Ph.D1-1/+1
2019-11-17fs: use expanduserMichael Hirsch, Ph.D1-1/+1
2019-11-17fs: deduplicate functionsMichael Hirsch, Ph.D1-8/+5
2019-11-17fs: use pathlib.Path, add type hint checkMichael Hirsch, Ph.D1-14/+17
2019-11-08Created the filesystem module.Jussi Pakkanen1-0/+59