From 6fb17372d85e379d0728bdf858af3a2b773e6a37 Mon Sep 17 00:00:00 2001 From: Ruslan Shymkevych Date: Thu, 22 Feb 2024 19:41:23 +0200 Subject: [PATCH] Do not use full path with `moulin` in the `build.ninja` Now we have full path to the moulin used inside build.ninja. Like this: ``` rule regenerate command = /home/rsm/.local/bin/moulin ... ... rule yocto_build command = bash -c "/home/rsm/.local/bin/moulin ... ``` and this prefix dosn't look aligned with other tools used inside `build.ninja`. So, this commit removes path before moulin script. As result we have ``` rule regenerate command = moulin ... ... rule yocto_build command = bash -c "moulin ... ``` Signed-off-by: Ruslan Shymkevych Reviewed-by: Volodymyr Babchuk --- moulin/build_generator.py | 2 +- moulin/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/moulin/build_generator.py b/moulin/build_generator.py index e6dcab4..49984df 100644 --- a/moulin/build_generator.py +++ b/moulin/build_generator.py @@ -100,7 +100,7 @@ def generate_fetcher_dyndep(conf: MoulinConfiguration, component: str): def _gen_regenerate(conf_file_name, generator: ninja_syntax.Writer): - this_script = os.path.abspath(sys.argv[0]) + this_script = os.path.basename(sys.argv[0]) args = " ".join(sys.argv[1:]) generator.rule("regenerate", command=f"{this_script} {args}", generator=1) generator.newline() diff --git a/moulin/utils.py b/moulin/utils.py index 189fe92..10684cf 100644 --- a/moulin/utils.py +++ b/moulin/utils.py @@ -16,7 +16,7 @@ def create_stamp_name(*args): def construct_fetcher_dep_cmd() -> str: "Generate command line to generate fetcher dependency file" - this_script = os.path.abspath(sys.argv[0]) + this_script = os.path.basename(sys.argv[0]) args = " ".join(sys.argv[1:]) return f"{this_script} {args} --fetcherdep $name"