summaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/depfixer.py
Commit message (Collapse)AuthorAgeFilesLines
* Close files reliably.Jussi Pakkanen2017-07-181-0/+5
|
* Use sys.exit rather than plain exit.Jussi Pakkanen2017-07-161-1/+1
|
* Whitespace tweaks to reduce Flake8 warningsAlistair Thomas2017-05-291-1/+1
|
* Use American English: behaviour -> behaviorPeter Hutterer2017-05-041-1/+1
|
* Don't use len() to test emptiness vs not emptinessDylan Baker2017-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Meson has a common pattern of using 'if len(foo) == 0:' or 'if len(foo) != 0:', however, this is a common anti-pattern in python. Instead tests for emptiness/non-emptiness should be done with a simple 'if foo:' or 'if not foo:' Consider the following: >>> import timeit >>> timeit.timeit('if len([]) == 0: pass') 0.10730923599840025 >>> timeit.timeit('if not []: pass') 0.030033907998586074 >>> timeit.timeit('if len(['a', 'b', 'c', 'd']) == 0: pass') 0.1154778649979562 >>> timeit.timeit("if not ['a', 'b', 'c', 'd']: pass") 0.08259823200205574 >>> timeit.timeit('if len("") == 0: pass') 0.089759664999292 >>> timeit.timeit('if not "": pass') 0.02340641999762738 >>> timeit.timeit('if len("foo") == 0: pass') 0.08848102600313723 >>> timeit.timeit('if not "foo": pass') 0.04032287199879647 And for the one additional case of 'if len(foo.strip()) == 0', which can be replaced with 'if not foo.isspace()' >>> timeit.timeit('if len(" ".strip()) == 0: pass') 0.15294511600222904 >>> timeit.timeit('if " ".isspace(): pass') 0.09413968399894657 >>> timeit.timeit('if len(" abc".strip()) == 0: pass') 0.2023209120015963 >>> timeit.timeit('if " abc".isspace(): pass') 0.09571301700270851 In other words, it's always a win to not use len(), when you don't actually want to check the length.
* Do not obliterate old rpath because it might be used due to read only data ↵Jussi Pakkanen2017-04-171-3/+12
| | | | sharing. Closes #1619.
* cleanup: Remove redundant parenthesesMike Sinkovsky2017-01-181-2/+2
|
* fix 'unreachable code' warningsMike Sinkovsky2017-01-031-1/+1
|
* style: fix E703 violationsIgor Gnatenko2017-01-011-7/+7
| | | | | | E703: statement ends with a semicolon Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* style: fix E265 violationsIgor Gnatenko2017-01-011-9/+9
| | | | | | E265: block comment should start with '# ' Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* style: fix E226 violationsIgor Gnatenko2017-01-011-12/+12
| | | | | | E226: missing whitespace around arithmetic operator Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* Fix installation of statically linked executable for ELF binary.Matthieu Gautier2016-12-211-0/+7
| | | | | | | At installation, if the executable is a ELF file, we try to fix the dependencies in the binary section. If a executable has been compiled with the --static flag, there is no .dynamic section in the ELF binary and so we need to handle this case.
* remove shebangs from scriptsIgor Gnatenko2016-12-181-2/+0
| | | | | | | | | | | | | | | | | meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/regen_checker.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_test.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_benchmark.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_exe.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/symbolextractor.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/commandrunner.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/gtkdochelper.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_install.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/depfixer.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/dirchanger.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/delwithsuffix.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/vcstagger.py 644 /usr/bin/python3 Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* Fix depfixer on MIPS.Aurelien Jarno2016-10-241-0/+6
|
* Remove shebangs on files that are not runnable and add execute bits to those ↵Jussi Pakkanen2016-10-071-0/+0
| | | | that are.
* Convert depfixer.Elf class into a context manager.Elliott Sales de Andrade2016-08-271-12/+22
| | | | This allows for automatic closing of its internal file handle.
* Handle both DT_RPATH as well as DT_RUNPATH when fixing rpath settings.Jussi Pakkanen2016-08-041-7/+23
|
* Invoke depfixer in-process to make it faster. Closes #480.Jussi Pakkanen2016-03-301-10/+13
|
* Renamed meson package to mesonbuild so that we can have a script named meson ↵Jussi Pakkanen2016-01-161-0/+302
in the same toplevel dir.