Update to 2.6

- Remove the following patch, which is not needed anymore in 2.6:
  cppcheck-2.5-fix_failed_to_load_translation_for_English.patch
- Remove -DNO_UNIX_SIGNAL_HANDLING to CXXFLAGS, due to new upstream
  fix: https://github.com/danmar/cppcheck/commit/8869ee3
- Restore execute permission of python files.
  Fixes rpmlint errors (8x): E: non-executable-script
This commit is contained in:
Wolfgang Stöggl 2021-10-02 21:05:33 +02:00
parent 6f85fa2223
commit c0747da1f3
4 changed files with 9 additions and 43 deletions

1
.gitignore vendored
View File

@ -46,3 +46,4 @@ cppcheck-1.44.tar.bz2
/cppcheck-2.2.tar.gz /cppcheck-2.2.tar.gz
/cppcheck-2.3.tar.gz /cppcheck-2.3.tar.gz
/cppcheck-2.5.tar.gz /cppcheck-2.5.tar.gz
/cppcheck-2.6.tar.gz

View File

@ -1,33 +0,0 @@
From 8d5249e3b6cd892b283eba0369b33ec302c8fbe0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= <c72578@yahoo.de>
Date: Fri, 23 Jul 2021 19:27:53 +0200
Subject: [PATCH] Fix Failed to load translation for English (#3351)
Upon the first start of cppcheck-gui, the following message appears,
if the language of the OS is English:
Failed to load the user interface language:
Failed to load translation for language English from file
cppcheck_en.qm
The user interface language has been reset to English.
- Update translationhandler.cpp and check if the language code starts
with "en". The code can be e.g. "en_US"
---
gui/translationhandler.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gui/translationhandler.cpp b/gui/translationhandler.cpp
index e00829e2008..5c27eb4ec0c 100644
--- a/gui/translationhandler.cpp
+++ b/gui/translationhandler.cpp
@@ -86,8 +86,8 @@ bool TranslationHandler::setLanguage(const QString &code)
bool failure = false;
QString error;
- //If English is the language
- if (code == "en") {
+ //If English is the language. Code can be e.g. en_US
+ if (code.indexOf("en") == 0) {
//Just remove all extra translators
if (mTranslator) {
qApp->removeTranslator(mTranslator);

View File

@ -1,8 +1,8 @@
%undefine __cmake_in_source_build %undefine __cmake_in_source_build
Name: cppcheck Name: cppcheck
Version: 2.5 Version: 2.6
Release: 3%{?dist} Release: 1%{?dist}
Summary: Tool for static C/C++ code analysis Summary: Tool for static C/C++ code analysis
License: GPLv3+ License: GPLv3+
URL: http://cppcheck.wiki.sourceforge.net/ URL: http://cppcheck.wiki.sourceforge.net/
@ -15,9 +15,6 @@ Patch1: cppcheck-1.88-htmlreport-python3.patch
# Disable one test, which fails under 32-bit archs i686 and armv7hl # Disable one test, which fails under 32-bit archs i686 and armv7hl
# https://trac.cppcheck.net/ticket/10282 # https://trac.cppcheck.net/ticket/10282
Patch2: cppcheck-2.5-disable-test-testexprengine-array7.patch Patch2: cppcheck-2.5-disable-test-testexprengine-array7.patch
# Fix Failed to load translation for English (#1983599)
# https://github.com/danmar/cppcheck/commit/8d5249e3b6cd892b283eba0369b33ec302c8fbe0
Patch3: cppcheck-2.5-fix_failed_to_load_translation_for_English.patch
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: pcre-devel BuildRequires: pcre-devel
@ -65,7 +62,6 @@ from xml files first generated using cppcheck.
%patch0 -p1 -b .translations %patch0 -p1 -b .translations
%patch1 -p1 -b .python3 %patch1 -p1 -b .python3
%patch2 -p1 -b .array7 %patch2 -p1 -b .array7
%patch3 -p1 -b .en
# Make sure bundled tinyxml2 is not used # Make sure bundled tinyxml2 is not used
rm -r externals/tinyxml2 rm -r externals/tinyxml2
# Generate the Qt online-help file # Generate the Qt online-help file
@ -79,8 +75,6 @@ pandoc man/manual.md -o man/manual.html -s --number-sections --toc
pandoc man/reference-cfg-format.md -o man/reference-cfg-format.html -s --number-sections --toc pandoc man/reference-cfg-format.md -o man/reference-cfg-format.html -s --number-sections --toc
# Binaries # Binaries
# https://github.com/danmar/cppcheck/pull/3179#issuecomment-804365812
export CXXFLAGS="$RPM_OPT_FLAGS -DNO_UNIX_SIGNAL_HANDLING"
# Upstream doesn't support shared libraries (unversioned solib) # Upstream doesn't support shared libraries (unversioned solib)
%cmake -DCMAKE_BUILD_TYPE=Release -DUSE_MATCHCOMPILER=yes -DUSE_Z3=yes -DHAVE_RULES=yes -DBUILD_GUI=1 -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTS=yes -DFILESDIR=%{_datadir}/Cppcheck -DUSE_BUNDLED_TINYXML2=OFF -DENABLE_OSS_FUZZ=OFF %cmake -DCMAKE_BUILD_TYPE=Release -DUSE_MATCHCOMPILER=yes -DUSE_Z3=yes -DHAVE_RULES=yes -DBUILD_GUI=1 -DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_TESTS=yes -DFILESDIR=%{_datadir}/Cppcheck -DUSE_BUNDLED_TINYXML2=OFF -DENABLE_OSS_FUZZ=OFF
%cmake_build %cmake_build
@ -96,9 +90,10 @@ install -D -p -m 644 gui/cppcheck-gui.png %{buildroot}%{_datadir}/pixmaps/cppche
# Install the Qt online-help file # Install the Qt online-help file
install -D -p -m 644 gui/help/online-help.qhc %{buildroot}%{_datadir}/Cppcheck/help/online-help.qhc install -D -p -m 644 gui/help/online-help.qhc %{buildroot}%{_datadir}/Cppcheck/help/online-help.qhc
install -D -p -m 644 gui/help/online-help.qch %{buildroot}%{_datadir}/Cppcheck/help/online-help.qch install -D -p -m 644 gui/help/online-help.qch %{buildroot}%{_datadir}/Cppcheck/help/online-help.qch
# Install htmlreport # Install htmlreport
install -D -p -m 755 htmlreport/cppcheck-htmlreport %{buildroot}%{_bindir}/cppcheck-htmlreport install -D -p -m 755 htmlreport/cppcheck-htmlreport %{buildroot}%{_bindir}/cppcheck-htmlreport
# Restore execute permission of python files
grep -l "#\!/usr/bin/env python3" %{buildroot}%{_datadir}/Cppcheck/addons/*.py | xargs chmod +x
%check %check
cd %{_vpath_builddir}/bin cd %{_vpath_builddir}/bin
@ -122,6 +117,9 @@ cd %{_vpath_builddir}/bin
%{_bindir}/cppcheck-htmlreport %{_bindir}/cppcheck-htmlreport
%changelog %changelog
* Sat Oct 02 2021 Wolfgang Stöggl <c72578@yahoo.de> - 2.6-1
- Update to 2.6.
* Fri Jul 23 2021 Wolfgang Stöggl <c72578@yahoo.de> - 2.5-3 * Fri Jul 23 2021 Wolfgang Stöggl <c72578@yahoo.de> - 2.5-3
- Fix Failed to load translation for English (#1983599) - Fix Failed to load translation for English (#1983599)

View File

@ -1 +1 @@
SHA512 (cppcheck-2.5.tar.gz) = 21f78eb1beca0c4c2e37aad09caedaa5d9aa98d7947329c089f5bf15eff56cc11f5fdf540fa07fdd666af1d1543fbd3cea5286e8478efbc3e4694954236f9035 SHA512 (cppcheck-2.6.tar.gz) = 6abe518cb9d80c4d0fcc5d47a317f45f177a30372846008f5c65352db91e7de74e6ec6d500d1d18b8cd29a91e3974df125efb35c14c7814c9640741b3827fc2a