Added patch to fix compilation with ncurses 6.3__2.13-3 (#3233)

* Added patch to fix compilation with ncurses 6.3__2.13-3

* Update SPECS-EXTENDED/powertop/powertop.spec

Co-authored-by: Pawel Winogrodzki <pawelwi@microsoft.com>

* Update SPECS-EXTENDED/powertop/powertop.spec

Co-authored-by: Pawel Winogrodzki <pawelwi@microsoft.com>

Co-authored-by: Pawel Winogrodzki <pawelwi@microsoft.com>
This commit is contained in:
abadawi591 2022-06-24 12:04:19 -07:00 коммит произвёл GitHub
Родитель c61ee1d81c
Коммит ae4366082e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 58 добавлений и 1 удалений

Просмотреть файл

@ -0,0 +1,51 @@
From 9ef1559a1582f23d599c149601c3a8e06809296c Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Mon, 25 Oct 2021 17:47:23 +0200
Subject: [PATCH] src: fix compatibility with ncurses 6.3
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
src/devices/devfreq.cpp | 2 +-
src/display.cpp | 2 +-
src/lib.cpp | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/devices/devfreq.cpp b/src/devices/devfreq.cpp
index 0509d0f..b194ac4 100644
--- a/src/devices/devfreq.cpp
+++ b/src/devices/devfreq.cpp
@@ -297,7 +297,7 @@ void display_devfreq_devices(void)
df->fill_freq_utilization(j, buf);
strcat(fline, buf);
strcat(fline, "\n");
- wprintw(win, fline);
+ wprintw(win, "%s", fline);
}
wprintw(win, "\n");
}
diff --git a/src/display.cpp b/src/display.cpp
index 7131144..cc03919 100644
--- a/src/display.cpp
+++ b/src/display.cpp
@@ -125,7 +125,7 @@ void show_tab(unsigned int tab)
c = bottom_lines[tab_names[tab]].c_str();
if (c && strlen(c) > 0)
- mvwprintw(bottom_line, 0,0, c);
+ mvwprintw(bottom_line, 0,0, "%s", c);
else
mvwprintw(bottom_line, 0, 0,
"<ESC> %s | <TAB> / <Shift + TAB> %s | ", _("Exit"),
diff --git a/src/lib.cpp b/src/lib.cpp
index 5e48f37..5cd1c4a 100644
--- a/src/lib.cpp
+++ b/src/lib.cpp
@@ -583,7 +583,7 @@ void ui_notify_user_ncurses(const char *frmt, ...)
* buffer */
vsnprintf(notify, UI_NOTIFY_BUFF_SZ - 1, frmt, list);
va_end(list);
- mvprintw(1, 0, notify);
+ mvprintw(1, 0, "%s", notify);
attroff(COLOR_PAIR(1));
}

Просмотреть файл

@ -1,6 +1,6 @@
Name: powertop
Version: 2.13
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Power consumption monitor
License: GPLv2
@ -12,6 +12,7 @@ Source1: powertop.service
# Sent upstream
Patch0: powertop-2.7-always-create-params.patch
Patch1: 0001-ncurses.patch
BuildRequires: gettext-devel, ncurses-devel, pciutils-devel, zlib-devel, libnl3-devel
BuildRequires: automake, libtool, systemd, autoconf-archive
BuildRequires: gcc, gcc-c++
@ -27,6 +28,7 @@ computer use more power than necessary while it is idle.
%prep
%setup -q
%patch0 -p1 -b .always-create-params
%patch1 -p1
echo "v%{version}" > version-long
echo '"v%{version}"' > version-short
@ -69,6 +71,10 @@ touch %{_localstatedir}/cache/powertop/{saved_parameters.powertop,saved_results.
%{_datadir}/bash-completion/completions/powertop
%changelog
* Thu Jun 23 2022 Ahmed Badawi <ahmedbadawi@microsoft.com> - 2.13-3
- Added patch to fix compilation with ncurses 6.3
- License verified
* Fri Oct 15 2021 Pawel Winogrodzki <pawelwi@microsoft.com> - 2.13-2
- Initial CBL-Mariner import from Fedora 32 (license: MIT).