summaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/pycompile.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2024-01-28 00:51:48 -0500
committerEli Schwartz <eschwartz93@gmail.com>2024-01-28 01:03:45 -0500
commit708a108cded4b25928b838483a95aad764622716 (patch)
treef0975fc30384ba0911e46217cad7b1eb0cbda5fe /mesonbuild/scripts/pycompile.py
parent314d9f0c74b34905f1ebb697d1374f078ea32854 (diff)
downloadmeson-708a108cded4b25928b838483a95aad764622716.tar.gz
python module: correct the embedded path for bytecompiled files
In recursive scanning, a script variable was overwritten that caused the logic *intended* to make the embedded path be trimmed based on $DESTDIR, to no longer apply. This resulted in embedding the staging path, but only when install_subdir() was used instead of specifying each file as the argument to install_sources.
Diffstat (limited to 'mesonbuild/scripts/pycompile.py')
-rw-r--r--mesonbuild/scripts/pycompile.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/mesonbuild/scripts/pycompile.py b/mesonbuild/scripts/pycompile.py
index 619398a34..92fad579c 100644
--- a/mesonbuild/scripts/pycompile.py
+++ b/mesonbuild/scripts/pycompile.py
@@ -19,16 +19,16 @@ def compileall(files):
f = f[12:]
ddir = None
- fullpath = os.environ['MESON_INSTALL_DESTDIR_'+key] + f
+ fullpath = absf = os.environ['MESON_INSTALL_DESTDIR_'+key] + f
f = os.environ['MESON_INSTALL_'+key] + f
- if fullpath != f:
+ if absf != f:
ddir = os.path.dirname(f)
- if os.path.isdir(fullpath):
- for root, _, files in os.walk(fullpath):
+ if os.path.isdir(absf):
+ for root, _, files in os.walk(absf):
if ddir is not None:
- ddir = root.replace(fullpath, f, 1)
+ ddir = root.replace(absf, f, 1)
for dirf in files:
if dirf.endswith('.py'):
fullpath = os.path.join(root, dirf)