scripts/meson-dist.py: Get builddir from env too

When meson runs a dist script it sets both MESON_BUILD_ROOT and
MESON_DIST_ROOT envvars [1]. But for some reason, we took the
former as an argument and obtained the latter via env. Well,
obtain both via env.

1: https://mesonbuild.com/Reference-manual_builtin_meson.html#mesonadd_dist_script
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2024-04-29 09:49:17 +02:00
parent c95cc67efb
commit bc70aa1df3
2 changed files with 4 additions and 4 deletions

View File

@ -2195,8 +2195,8 @@ if git
foreach file : dist_files foreach file : dist_files
meson.add_dist_script( meson.add_dist_script(
meson_python_prog.full_path(), python3_prog.full_path(), meson_dist_prog.full_path(), meson_python_prog.full_path(), python3_prog.full_path(),
meson.project_build_root(), file meson_dist_prog.full_path(), file
) )
endforeach endforeach
endif endif

View File

@ -4,9 +4,9 @@ import os
import shutil import shutil
import sys import sys
meson_build_root = sys.argv[1] file_name = sys.argv[1]
file_name = sys.argv[2]
meson_build_root = os.environ['MESON_BUILD_ROOT']
meson_dist_root = os.environ['MESON_DIST_ROOT'] meson_dist_root = os.environ['MESON_DIST_ROOT']
shutil.copy(os.path.join(meson_build_root, file_name), shutil.copy(os.path.join(meson_build_root, file_name),