From 86d0aae3481695222ab8cacf22465d12cf66015b Mon Sep 17 00:00:00 2001 From: Marcos Paulo de Souza Date: Feb 27 2023 14:49:53 +0000 Subject: scripts/osc_wrapper: Assign spec with *.spec file when building Commit 270fc6884c5b ("scripts/osc_wrapper: Pass more options to osc"), decided that only the last argument of osc_wrapper can be the spec file. But on commit 30f26fbbe86c ("scripts/osc_wrapper: Accept --ibs | --obs as the first parameter"), it swaps the order of arguments, leaving --ibs/--obs as the last ones. This creates a problem when running osc_wrapper with --ibs kernel-default.spec, since it'll add the specfile in osc_args, and letting spec variable empty. Later on, if spec if empty, the find_spec function is called, setting the spec automatically. The end result is messy: $ ./scripts/osc_wrapper --ibs kernel-source/kernel-default.spec osc -A https://api.suse.de build --no-service --local-package --alternative-project=Devel:Kernel:SLE15-SP4 \ kernel-source/kernel-default.spec \ \ --define klp_symbols 1 standard kernel-source/kernel-default.spec The osc command contains two spec definitions, which is wrong. The first one is wrongly assumed to be an argument to be used for osc or osc_wrapper. The fix is to respect the argument of *.spec and assign it to spec variable, and let other options to be handled by the code that is currently present. Signed-off-by: Marcos Paulo de Souza Reviewed-by: Michal Koutný --- diff --git a/scripts/osc_wrapper b/scripts/osc_wrapper index 83f98c1..1869e6c 100755 --- a/scripts/osc_wrapper +++ b/scripts/osc_wrapper @@ -251,11 +251,7 @@ do_build() shift ;; *.spec) - if test $# -eq 1; then - spec=$1 - else - osc_args=("${osc_args[@]}" "$1") - fi + spec=$1 shift ;; *)