[arch-commits] Commit in nvtop/repos/community-x86_64 (3 files)
Felix Yan
felixonmars at gemini.archlinux.org
Fri Aug 26 18:03:05 UTC 2022
Date: Friday, August 26, 2022 @ 18:03:04
Author: felixonmars
Revision: 1283486
archrelease: copy trunk to community-x86_64
Added:
nvtop/repos/community-x86_64/PKGBUILD
(from rev 1283485, nvtop/trunk/PKGBUILD)
nvtop/repos/community-x86_64/format-security.patch
(from rev 1283485, nvtop/trunk/format-security.patch)
Deleted:
nvtop/repos/community-x86_64/PKGBUILD
-----------------------+
PKGBUILD | 60 +++++++++++++++++---------------
format-security.patch | 90 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 123 insertions(+), 27 deletions(-)
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2022-08-26 18:02:43 UTC (rev 1283485)
+++ PKGBUILD 2022-08-26 18:03:04 UTC (rev 1283486)
@@ -1,27 +0,0 @@
-# Maintainer: Felix Yan <felixonmars at archlinux.org>
-# Contributor: Maxime Schmitt <maxime.schmitt91 at gmail.com>
-
-pkgname=nvtop
-pkgver=2.0.2
-pkgrel=1
-pkgdesc="An htop like monitoring tool for AMD and NVIDIA GPUs"
-arch=('x86_64')
-url="https://github.com/Syllo/nvtop"
-license=('GPL3')
-depends=('ncurses')
-makedepends=('cmake' 'libdrm')
-source=("https://github.com/Syllo/nvtop/archive/$pkgver/$pkgname-$pkgver.tar.gz")
-sha512sums=('8cc4859ae26428b8b4835d5205be4533c38ab90f5a369261b2650200bab16f7953c4d012dba375be5d1c793ca5031775c64b18f1629cae381d6f1e3b29992cb5')
-
-build() {
- cd $pkgname-$pkgver
-
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DNVIDIA_SUPPORT=ON -DAMDGPU_SUPPORT=ON .
- make
-}
-
-package() {
- cd $pkgname-$pkgver
-
- make DESTDIR="$pkgdir/" install
-}
Copied: nvtop/repos/community-x86_64/PKGBUILD (from rev 1283485, nvtop/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2022-08-26 18:03:04 UTC (rev 1283486)
@@ -0,0 +1,33 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Maxime Schmitt <maxime.schmitt91 at gmail.com>
+
+pkgname=nvtop
+pkgver=2.0.3
+pkgrel=1
+pkgdesc="An htop like monitoring tool for AMD and NVIDIA GPUs"
+arch=('x86_64')
+url="https://github.com/Syllo/nvtop"
+license=('GPL3')
+depends=('ncurses')
+makedepends=('cmake' 'libdrm')
+source=("https://github.com/Syllo/nvtop/archive/$pkgver/$pkgname-$pkgver.tar.gz"
+ format-security.patch)
+sha512sums=('ffd9d88898b7c6365d8bcff3c7b187760bc0036fba80ab6a0e3a586217ebf48b3377cdbe84f2fbbe10fb650f96de108973f95ccd29766e45da3901ee5d45f63c'
+ 'a388de418586c8569d119dbd6845e2257160a81e370ed75ba60a9823afb90267cb5522200a06925db9ce3ca39b8d589dd02b7ade47de712abe830b02fbd2bd6e')
+
+prepare() {
+ patch -d $pkgname-$pkgver -p1 < format-security.patch
+}
+
+build() {
+ cd $pkgname-$pkgver
+
+ cmake -DCMAKE_INSTALL_PREFIX=/usr -DNVIDIA_SUPPORT=ON -DAMDGPU_SUPPORT=ON .
+ make
+}
+
+package() {
+ cd $pkgname-$pkgver
+
+ make DESTDIR="$pkgdir/" install
+}
Copied: nvtop/repos/community-x86_64/format-security.patch (from rev 1283485, nvtop/trunk/format-security.patch)
===================================================================
--- format-security.patch (rev 0)
+++ format-security.patch 2022-08-26 18:03:04 UTC (rev 1283486)
@@ -0,0 +1,90 @@
+commit 663a69f1c9038eabdfc3155112fb9b8d662578aa
+Author: Felix Yan <felixonmars at archlinux.org>
+Date: Fri Aug 26 21:00:38 2022 +0300
+
+ Fix format-security warnings
+
+ nvtop 2.0.3 fails to build on Arch Linux with `-Werror=format-security` enabled. Let's fix it.
+
+diff --git a/src/interface.c b/src/interface.c
+index 28bc2b2..3628e62 100644
+--- a/src/interface.c
++++ b/src/interface.c
+@@ -256,35 +256,35 @@ static void initialize_gpu_mem_plot(struct plot_window *plot, struct window_posi
+ char *zeroSec = "0s";
+ if (options->plot_left_to_right) {
+ char *toPrint = zeroSec;
+- mvwprintw(plot->win, position->sizeY - 1, 4, toPrint);
++ mvwprintw(plot->win, position->sizeY - 1, 4, "%s", toPrint);
+
+ int retval = snprintf(elapsedSeconds, 5, "%ds", options->update_interval * cols / 4 / column_divisor / 1000);
+ if (retval > 4)
+ toPrint = err;
+ else
+ toPrint = elapsedSeconds;
+- mvwprintw(plot->win, position->sizeY - 1, 4 + cols / 4 - strlen(toPrint) / 2, toPrint);
++ mvwprintw(plot->win, position->sizeY - 1, 4 + cols / 4 - strlen(toPrint) / 2, "%s", toPrint);
+
+ retval = snprintf(elapsedSeconds, 5, "%ds", options->update_interval * cols / 2 / column_divisor / 1000);
+ if (retval > 4)
+ toPrint = err;
+ else
+ toPrint = elapsedSeconds;
+- mvwprintw(plot->win, position->sizeY - 1, 4 + cols / 2 - strlen(toPrint) / 2, toPrint);
++ mvwprintw(plot->win, position->sizeY - 1, 4 + cols / 2 - strlen(toPrint) / 2, "%s", toPrint);
+
+ retval = snprintf(elapsedSeconds, 5, "%ds", options->update_interval * cols * 3 / 4 / column_divisor / 1000);
+ if (retval > 4)
+ toPrint = err;
+ else
+ toPrint = elapsedSeconds;
+- mvwprintw(plot->win, position->sizeY - 1, 4 + cols * 3 / 4 - strlen(toPrint) / 2, toPrint);
++ mvwprintw(plot->win, position->sizeY - 1, 4 + cols * 3 / 4 - strlen(toPrint) / 2, "%s", toPrint);
+
+ retval = snprintf(elapsedSeconds, 5, "%ds", options->update_interval * cols / column_divisor / 1000);
+ if (retval > 4)
+ toPrint = err;
+ else
+ toPrint = elapsedSeconds;
+- mvwprintw(plot->win, position->sizeY - 1, 4 + cols - strlen(toPrint), toPrint);
++ mvwprintw(plot->win, position->sizeY - 1, 4 + cols - strlen(toPrint), "%s", toPrint);
+ } else {
+ char *toPrint;
+ int retval = snprintf(elapsedSeconds, 5, "%ds", options->update_interval * cols / column_divisor / 1000);
+@@ -292,31 +292,31 @@ static void initialize_gpu_mem_plot(struct plot_window *plot, struct window_posi
+ toPrint = err;
+ else
+ toPrint = elapsedSeconds;
+- mvwprintw(plot->win, position->sizeY - 1, 4, toPrint);
++ mvwprintw(plot->win, position->sizeY - 1, 4, "%s", toPrint);
+
+ retval = snprintf(elapsedSeconds, 5, "%ds", options->update_interval * cols * 3 / 4 / column_divisor / 1000);
+ if (retval > 4)
+ toPrint = err;
+ else
+ toPrint = elapsedSeconds;
+- mvwprintw(plot->win, position->sizeY - 1, 4 + cols / 4 - strlen(toPrint) / 2, toPrint);
++ mvwprintw(plot->win, position->sizeY - 1, 4 + cols / 4 - strlen(toPrint) / 2, "%s", toPrint);
+
+ retval = snprintf(elapsedSeconds, 5, "%ds", options->update_interval * cols / 2 / column_divisor / 1000);
+ if (retval > 4)
+ toPrint = err;
+ else
+ toPrint = elapsedSeconds;
+- mvwprintw(plot->win, position->sizeY - 1, 4 + cols / 2 - strlen(toPrint) / 2, toPrint);
++ mvwprintw(plot->win, position->sizeY - 1, 4 + cols / 2 - strlen(toPrint) / 2, "%s", toPrint);
+
+ retval = snprintf(elapsedSeconds, 5, "%ds", options->update_interval * cols / 4 / column_divisor / 1000);
+ if (retval > 4)
+ toPrint = err;
+ else
+ toPrint = elapsedSeconds;
+- mvwprintw(plot->win, position->sizeY - 1, 4 + cols * 3 / 4 - strlen(toPrint) / 2, toPrint);
++ mvwprintw(plot->win, position->sizeY - 1, 4 + cols * 3 / 4 - strlen(toPrint) / 2, "%s", toPrint);
+
+ toPrint = zeroSec;
+- mvwprintw(plot->win, position->sizeY - 1, 4 + cols - strlen(toPrint), toPrint);
++ mvwprintw(plot->win, position->sizeY - 1, 4 + cols - strlen(toPrint), "%s", toPrint);
+ }
+ wnoutrefresh(plot->win);
+ }
More information about the arch-commits
mailing list