commit:     a4ae230be03c2f8ab6ed0e2d53f431d5bd649dbb
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 10 04:57:16 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Nov 10 05:09:21 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4ae230b

app-admin/procinfo-ng: fix build w/ clang, -Wformat-security

It's a lazy fix but upstream is dead and surprisingly other
distros still package this. Fix -Wformat-security while at it.

Closes: https://bugs.gentoo.org/719790
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/procinfo-ng-2.0.304-wformat-security.patch    | 11 +++++++++++
 ...-2.0.304-r1.ebuild => procinfo-ng-2.0.304-r2.ebuild} | 17 +++++++++++++----
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git 
a/app-admin/procinfo-ng/files/procinfo-ng-2.0.304-wformat-security.patch 
b/app-admin/procinfo-ng/files/procinfo-ng-2.0.304-wformat-security.patch
new file mode 100644
index 000000000000..315983c9af30
--- /dev/null
+++ b/app-admin/procinfo-ng/files/procinfo-ng-2.0.304-wformat-security.patch
@@ -0,0 +1,11 @@
+--- a/procinfo.cpp
++++ b/procinfo.cpp
+@@ -211,7 +211,7 @@ int mainLoop(bool perSecond, bool showTotals, bool 
showTotalsMem, bool fullScree
+       try {
+               rows = getNetStats(perSecond, showTotals, skipIfaces, elapsed);
+       } catch (string exceptionMessage) {
+-              print(exceptionMessage.c_str());
++              print("%s", exceptionMessage.c_str());
+       }
+       print("\n");
+       prettyPrint(rows, rowWidth, true);

diff --git a/app-admin/procinfo-ng/procinfo-ng-2.0.304-r1.ebuild 
b/app-admin/procinfo-ng/procinfo-ng-2.0.304-r2.ebuild
similarity index 70%
rename from app-admin/procinfo-ng/procinfo-ng-2.0.304-r1.ebuild
rename to app-admin/procinfo-ng/procinfo-ng-2.0.304-r2.ebuild
index c1fe7c224965..d9384bee0dd8 100644
--- a/app-admin/procinfo-ng/procinfo-ng-2.0.304-r1.ebuild
+++ b/app-admin/procinfo-ng/procinfo-ng-2.0.304-r2.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
-inherit autotools
+inherit autotools flag-o-matic
 
 DESCRIPTION="Completely rewrite of the old system monitoring app procinfo"
 HOMEPAGE="https://sourceforge.net/projects/procinfo-ng/";
@@ -13,17 +13,26 @@ LICENSE="|| ( GPL-2 LGPL-2.1 )"
 SLOT="0"
 KEYWORDS="amd64 ~hppa x86"
 
-RDEPEND="sys-libs/ncurses:0="
+RDEPEND="sys-libs/ncurses:="
 DEPEND="${RDEPEND}"
 BDEPEND="virtual/pkgconfig"
 
 PATCHES=(
        "${FILESDIR}"/${P}-autotools.patch
        "${FILESDIR}"/${P}-man.patch
+       "${FILESDIR}"/${P}-wformat-security.patch
 )
 
 src_prepare() {
        default
+
        mv configure.{in,ac} || die
        eautoreconf
 }
+
+src_configure() {
+       # bug #719790
+       append-cxxflags -std=c++03
+
+       default
+}

Reply via email to