pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

btop-git: Remove modification on CPU string.



Module Name:	pkgsrc-wip
Committed By:	Santhosh Raju <fox%NetBSD.org@localhost>
Pushed By:	fox
Date:		Sat Jan 18 23:15:30 2025 +0100
Changeset:	a34d055bc6d84e2ef68fb4170a35546399b184a5

Modified Files:
	btop-git/distinfo
Added Files:
	btop-git/patches/patch-src_netbsd_btop__collect.cpp

Log Message:
btop-git: Remove modification on CPU string.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=a34d055bc6d84e2ef68fb4170a35546399b184a5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 btop-git/distinfo                                  |  1 +
 .../patches/patch-src_netbsd_btop__collect.cpp     | 47 ++++++++++++++++++++++
 2 files changed, 48 insertions(+)

diffs:
diff --git a/btop-git/distinfo b/btop-git/distinfo
index 0580c1273f..644da735df 100644
--- a/btop-git/distinfo
+++ b/btop-git/distinfo
@@ -1,3 +1,4 @@
 $NetBSD$
 
 SHA1 (patch-Makefile) = 87cd9333e786899109df3a931c6d0e99fbd017de
+SHA1 (patch-src_netbsd_btop__collect.cpp) = fc456e15c11a5e50b8a2ae3ca569d1b27f2141cc
diff --git a/btop-git/patches/patch-src_netbsd_btop__collect.cpp b/btop-git/patches/patch-src_netbsd_btop__collect.cpp
new file mode 100644
index 0000000000..d0a2be2b4e
--- /dev/null
+++ b/btop-git/patches/patch-src_netbsd_btop__collect.cpp
@@ -0,0 +1,47 @@
+$NetBSD$
+
+Disable name prefix detection.
+
+--- src/netbsd/btop_collect.cpp.orig	2025-01-18 21:33:07.766242345 +0000
++++ src/netbsd/btop_collect.cpp
+@@ -215,23 +215,23 @@ namespace Cpu {
+ 
+ 		auto name_vec = ssplit(name);
+ 
+-		if ((s_contains(name, "Xeon"s) or v_contains(name_vec, "Duo"s)) and v_contains(name_vec, "CPU"s)) {
+-			auto cpu_pos = v_index(name_vec, "CPU"s);
+-			if (cpu_pos < name_vec.size() - 1 and not name_vec.at(cpu_pos + 1).ends_with(')'))
+-				name = name_vec.at(cpu_pos + 1);
+-			else
+-				name.clear();
+-		} else if (v_contains(name_vec, "Ryzen"s)) {
+-			auto ryz_pos = v_index(name_vec, "Ryzen"s);
+-			name = "Ryzen" + (ryz_pos < name_vec.size() - 1 ? ' ' + name_vec.at(ryz_pos + 1) : "") + (ryz_pos < name_vec.size() - 2 ? ' ' + name_vec.at(ryz_pos + 2) : "");
+-		} else if (s_contains(name, "Intel"s) and v_contains(name_vec, "CPU"s)) {
+-			auto cpu_pos = v_index(name_vec, "CPU"s);
+-			if (cpu_pos < name_vec.size() - 1 and not name_vec.at(cpu_pos + 1).ends_with(')') and name_vec.at(cpu_pos + 1) != "@")
+-				name = name_vec.at(cpu_pos + 1);
+-			else
+-				name.clear();
+-		} else
+-			name.clear();
++//		if ((s_contains(name, "Xeon"s) or v_contains(name_vec, "Duo"s)) and v_contains(name_vec, "CPU"s)) {
++//			auto cpu_pos = v_index(name_vec, "CPU"s);
++//			if (cpu_pos < name_vec.size() - 1 and not name_vec.at(cpu_pos + 1).ends_with(')'))
++//				name = name_vec.at(cpu_pos + 1);
++//			else
++//				name.clear();
++//		} else if (v_contains(name_vec, "Ryzen"s)) {
++//			auto ryz_pos = v_index(name_vec, "Ryzen"s);
++//			name = "Ryzen" + (ryz_pos < name_vec.size() - 1 ? ' ' + name_vec.at(ryz_pos + 1) : "") + (ryz_pos < name_vec.size() - 2 ? ' ' + name_vec.at(ryz_pos + 2) : "");
++//		} else if (s_contains(name, "Intel"s) and v_contains(name_vec, "CPU"s)) {
++//			auto cpu_pos = v_index(name_vec, "CPU"s);
++//			if (cpu_pos < name_vec.size() - 1 and not name_vec.at(cpu_pos + 1).ends_with(')') and name_vec.at(cpu_pos + 1) != "@")
++//				name = name_vec.at(cpu_pos + 1);
++//			else
++//				name.clear();
++//		} else
++//			name.clear();
+ 
+ 		if (name.empty() and not name_vec.empty()) {
+ 			for (const auto &n : name_vec) {


Home | Main Index | Thread Index | Old Index