Refix the failure of building with cppcheck>=2.11 by using upstream patch
(cherry picked from commit 3c72d76aa0d3f86e778e5e9367791a08090ac7f9)
This commit is contained in:
parent
036e8ea764
commit
196c9ff535
33
backport-Prevent-cppcheck-from-defining-CHECK_DIR.patch
Normal file
33
backport-Prevent-cppcheck-from-defining-CHECK_DIR.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
From 2a49df86007becae89f335025e549bdbd26a24d2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ondrej Mosnacek <omosnace@redhat.com>
|
||||||
|
Date: Wed, 26 Jul 2023 10:32:34 +0200
|
||||||
|
Subject: [PATCH] Prevent cppcheck from defining CHECK_DIR
|
||||||
|
|
||||||
|
Recent versions of cppcheck fail with a syntax error when they check
|
||||||
|
apps/kcapi-hasher.c with CHECK_DIR defined (probably they now define it
|
||||||
|
to 1 instead of an empty value). To fix it, instruct cppcheck to only
|
||||||
|
check with CHECK_DIR left undefined.
|
||||||
|
|
||||||
|
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2225970
|
||||||
|
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
|
||||||
|
Signed-off-by: Stephan Mueller <smueller@chronox.de>
|
||||||
|
---
|
||||||
|
Makefile.am | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/Makefile.am b/Makefile.am
|
||||||
|
index 0a6ff26..0189848 100644
|
||||||
|
--- a/Makefile.am
|
||||||
|
+++ b/Makefile.am
|
||||||
|
@@ -241,7 +241,7 @@ endif
|
||||||
|
|
||||||
|
if HAVE_CPPCHECK
|
||||||
|
cppcheck:
|
||||||
|
- $(CPPCHECK) --error-exitcode=42 --enable=performance,warning,portability $(sort $(SCAN_FILES))
|
||||||
|
+ $(CPPCHECK) -U CHECK_DIR --error-exitcode=42 --enable=performance,warning,portability $(sort $(SCAN_FILES))
|
||||||
|
endif
|
||||||
|
|
||||||
|
if HAVE_MKTEMP
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
@ -8,9 +8,6 @@
|
|||||||
%define enable_docbook_pdf 0
|
%define enable_docbook_pdf 0
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# check failed with cppcheck >= 2.11
|
|
||||||
%define min_cppcheck %pkg_version_cmp cppcheck 2.11
|
|
||||||
|
|
||||||
# Calculate hmac file after installing for binary
|
# Calculate hmac file after installing for binary
|
||||||
%define __spec_install_post \
|
%define __spec_install_post \
|
||||||
%{?__debug_package:%{__debug_install_post}} \
|
%{?__debug_package:%{__debug_install_post}} \
|
||||||
@ -29,7 +26,7 @@ ln -s libkcapi.so.%{version}.hmac %{buildroot}/%{_lib}/fipscheck/libkcapi.so.
|
|||||||
|
|
||||||
Name: libkcapi
|
Name: libkcapi
|
||||||
Version: 1.4.0
|
Version: 1.4.0
|
||||||
Release: 4
|
Release: 5
|
||||||
Summary: libkcapi - Linux Kernel Crypto API User Space Interface Library
|
Summary: libkcapi - Linux Kernel Crypto API User Space Interface Library
|
||||||
|
|
||||||
License: BSD or GPLv2
|
License: BSD or GPLv2
|
||||||
@ -39,6 +36,7 @@ Source1: http://www.chronox.de/%{name}/%{name}-%{version}.tar.xz.asc
|
|||||||
|
|
||||||
Patch0: libkcapi-1.1.1-lib_Fix_kcapi_handle_destroy_closing_FD_0.patch
|
Patch0: libkcapi-1.1.1-lib_Fix_kcapi_handle_destroy_closing_FD_0.patch
|
||||||
Patch1: backport-Append-newline-to-stdout.patch
|
Patch1: backport-Append-newline-to-stdout.patch
|
||||||
|
Patch2: backport-Prevent-cppcheck-from-defining-CHECK_DIR.patch
|
||||||
|
|
||||||
BuildRequires: clang coreutils cppcheck gcc hardlink
|
BuildRequires: clang coreutils cppcheck gcc hardlink
|
||||||
BuildRequires: libtool openssl perl systemd xmlto kernel-headers >= 4.10.0
|
BuildRequires: libtool openssl perl systemd xmlto kernel-headers >= 4.10.0
|
||||||
@ -178,10 +176,6 @@ done
|
|||||||
%ldconfig_scriptlets
|
%ldconfig_scriptlets
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%if %{min_cppcheck} >= 0
|
|
||||||
# add -UCHECK_DIR to cppcheck with cppcheck >= 2.11
|
|
||||||
sed -i 's/\$(CPPCHECK)/\$(CPPCHECK) -UCHECK_DIR/' Makefile
|
|
||||||
%endif
|
|
||||||
for t in cppcheck scan;do
|
for t in cppcheck scan;do
|
||||||
%make_build $t
|
%make_build $t
|
||||||
done
|
done
|
||||||
@ -227,6 +221,12 @@ popd
|
|||||||
%{_mandir}/man3/kcapi_*.3.*
|
%{_mandir}/man3/kcapi_*.3.*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Aug 16 2023 yixiangzhike <yixiangzhike007@163.com> - 1.4.0-5
|
||||||
|
- Type:bugfix
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:refix the failure of building with cppcheck>=2.11 by using upstream patch
|
||||||
|
|
||||||
* Tue Aug 15 2023 yixiangzhike <yixiangzhike007@163.com> - 1.4.0-4
|
* Tue Aug 15 2023 yixiangzhike <yixiangzhike007@163.com> - 1.4.0-4
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user