Update macros

This commit is contained in:
2026-01-09 14:37:36 +08:00
parent a1c5ee9c5e
commit 0e513940aa
2 changed files with 7 additions and 4 deletions

View File

@@ -5,7 +5,7 @@
%__install -d %{buildroot}%{go_sys_gopath}/%{go_import_path} ; \\\
%__cp -a . %{buildroot}%{go_sys_gopath}/%{go_import_path} \\\
}
%buildsystem_golangmodules_check() %{expand:\\\
%buildsystem_golangmodules_check(-) %{expand:\\\
%{go_common} \\\
%__mkdir -p %{_builddir}/go/src/%{go_import_path} ; \\\
%__cp -a . %{_builddir}/go/src/%{go_import_path} ; \\\
@@ -94,10 +94,13 @@
exit 0 ; \\\
fi ; \\\
\\\
set -- %** ; \\\
[ "$1" = "--" ] && shift ; \\\
\\\
# Ignore Tests failed: Define %{go_test_ignore_failure} or export GO_TEST_IGNORE_FAILURE=1 \\\
if [ -n "%{?go_test_ignore_failure}" ] || [ -n "${GO_TEST_IGNORE_FAILURE:-}" ]; then \\\
%__go test %{shrink:%{go_test_flags_default} %*} $_go_pkgs || : ; \\\
%__go test %{go_test_flags_default} "$@" $_go_pkgs || : ; \\\
else \\\
%__go test %{shrink:%{go_test_flags_default} %*} $_go_pkgs ; \\\
%__go test %{go_test_flags_default} "$@" $_go_pkgs ; \\\
fi \\\
}

View File

@@ -23,7 +23,7 @@
#
%go_test_flags_default -v
# TODO: It's broken, will append annoying "--".
%go_test_flags() %{expand:%{shrink:%{go_test_flags_default} %{?**}}}
%go_test_flags(-) %{expand:%{shrink:%{go_test_flags_default} %**}}
#
# BuildSystem flags