Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package btop for openSUSE:Factory checked in at 2021-10-29 22:34:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/btop (Old) and /work/SRC/openSUSE:Factory/.btop.new.1890 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "btop" Fri Oct 29 22:34:09 2021 rev:5 rq:928023 version:1.0.20 Changes: -------- --- /work/SRC/openSUSE:Factory/btop/btop.changes 2021-10-23 00:52:28.877161230 +0200 +++ /work/SRC/openSUSE:Factory/.btop.new.1890/btop.changes 2021-10-29 22:35:14.331704911 +0200 @@ -1,0 +2,9 @@ +Wed Oct 27 15:15:27 UTC 2021 - Scott Bradnick <scott.bradn...@suse.com> - 1.0.20 + +- Update to upstream release 1.0.20: + * Added: Improved cpu sensor detection for Ryzen Mobile, by @adnanpri + * Changed: Updated makefile + * Changed: Regex for Fx::uncolor() changed to string search and replace + * Changed: Removed all use of regex with dedicated string functions + +------------------------------------------------------------------- Old: ---- v1.0.19.tar.gz New: ---- v1.0.20.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ btop.spec ++++++ --- /var/tmp/diff_new_pack.NrSnXh/_old 2021-10-29 22:35:14.807705090 +0200 +++ /var/tmp/diff_new_pack.NrSnXh/_new 2021-10-29 22:35:14.807705090 +0200 @@ -17,7 +17,7 @@ Name: btop -Version: 1.0.19 +Version: 1.0.20 Release: 0 Summary: Usage and stats for processor, memory, disks, network and processes License: Apache-2.0 ++++++ v1.0.19.tar.gz -> v1.0.20.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.0.19/CHANGELOG.md new/btop-1.0.20/CHANGELOG.md --- old/btop-1.0.19/CHANGELOG.md 2021-10-21 16:54:18.000000000 +0200 +++ new/btop-1.0.20/CHANGELOG.md 2021-10-26 23:41:40.000000000 +0200 @@ -1,3 +1,13 @@ +## v1.0.20 + +* Added: Improved cpu sensor detection for Ryzen Mobile, by @adnanpri + +* Changed: Updated makefile + +* Changed: Regex for Fx::uncolor() changed to string search and replace + +* Changed: Removed all use of regex with dedicated string functions + ## v1.0.19 * Fixed: Makefile now tests compiler flag compatibility diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.0.19/Makefile new/btop-1.0.20/Makefile --- old/btop-1.0.19/Makefile 2021-10-21 16:54:18.000000000 +0200 +++ new/btop-1.0.20/Makefile 2021-10-26 23:41:40.000000000 +0200 @@ -24,14 +24,14 @@ override PLATFORM_LC := $(shell echo $(PLATFORM) | tr '[:upper:]' '[:lower:]') #? Any flags added to TESTFLAGS must not contain whitespace for the testing to work -override TESTFLAGS := -fexceptions -fcf-protection -fstack-protector -fstack-clash-protection -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS +override TESTFLAGS := -fexceptions -fcf-protection -fstack-protector -fstack-clash-protection ifeq ($(STATIC),true) - override TESTFLAGS += -DSTATIC_BUILD -static -static-libgcc -static-libstdc++ -Wl,--fatal-warnings + override ADDFLAGS += -DSTATIC_BUILD -static -static-libgcc -static-libstdc++ -Wl,--fatal-warnings endif ifeq ($(STRIP),true) - override TESTFLAGS += -s + override ADDFLAGS += -s endif #? Compiler and Linker @@ -84,8 +84,8 @@ #? Flags, Libraries and Includes override REQFLAGS := -std=c++20 WARNFLAGS := -Wall -Wextra -pedantic -OPTFLAGS ?= -O2 -ftree-loop-vectorize -flto=$(THREADS) -LDCXXFLAGS := -pthread $(GOODFLAGS) $(ADDFLAGS) +OPTFLAGS := -O2 -ftree-loop-vectorize -flto=$(THREADS) +LDCXXFLAGS := -pthread -D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS $(GOODFLAGS) $(ADDFLAGS) override CXXFLAGS += $(REQFLAGS) $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS) override LDFLAGS += $(LDCXXFLAGS) $(OPTFLAGS) $(WARNFLAGS) INC := -I$(INCDIR) -I$(SRCDIR) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.0.19/src/btop.cpp new/btop-1.0.20/src/btop.cpp --- old/btop-1.0.19/src/btop.cpp 2021-10-21 16:54:18.000000000 +0200 +++ new/btop-1.0.20/src/btop.cpp 2021-10-26 23:41:40.000000000 +0200 @@ -53,7 +53,7 @@ {"#801414", "???????????????????????? ????????? ???????????????????????????????????? ????????? ?????????"}, {"#000000", "????????????????????? ????????? ????????????????????? ?????????"}, }; - const string Version = "1.0.19"; + const string Version = "1.0.20"; int coreCount; string overlay; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.0.19/src/btop_tools.cpp new/btop-1.0.20/src/btop_tools.cpp --- old/btop-1.0.19/src/btop_tools.cpp 2021-10-21 16:54:18.000000000 +0200 +++ new/btop-1.0.20/src/btop_tools.cpp 2021-10-26 23:41:40.000000000 +0200 @@ -46,7 +46,6 @@ atomic<int> width = 0; atomic<int> height = 0; string current_tty; - char* custombuf; namespace { struct termios initial_settings; @@ -122,9 +121,6 @@ linebuffered(false); refresh(); - //? Set 1MB buffer for cout - std::cout.rdbuf()->pubsetbuf(custombuf, 1048576); - cout << alt_screen << hide_cursor << mouse_on << flush; Global::resized = false; } @@ -143,6 +139,25 @@ //? --------------------------------------------------- FUNCTIONS ----------------------------------------------------- +namespace Fx { + string uncolor(const string& s) { + string out = s; + for (size_t offset = 0, start_pos = 0, end_pos = 0, next_pos = 0;;) { + if ((start_pos = next_pos > 0 ? next_pos : out.find('\x1b', offset)) == string::npos) + break; + offset = ++start_pos; + if ((end_pos = out.find('m', offset)) == string::npos) + break; + else if (next_pos = out.find('\x1b', offset); not isdigit(out[end_pos - 1]) or end_pos - start_pos > next_pos - start_pos) + continue; + out.replace(start_pos, end_pos - start_pos, ""); + next_pos = 0; + } + out.shrink_to_fit(); + return out; + } +} + namespace Tools { atomic<int> active_locks (0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.0.19/src/btop_tools.hpp new/btop-1.0.20/src/btop_tools.hpp --- old/btop-1.0.19/src/btop_tools.hpp 2021-10-21 16:54:18.000000000 +0200 +++ new/btop-1.0.20/src/btop_tools.hpp 2021-10-26 23:41:40.000000000 +0200 @@ -21,7 +21,6 @@ #include <string> #include <vector> #include <array> -#include <regex> #include <atomic> #include <filesystem> #include <ranges> @@ -30,7 +29,7 @@ #include <tuple> #include <pthread.h> -using std::string, std::vector, std::atomic, std::to_string, std::regex, std::tuple, std::array; +using std::string, std::vector, std::atomic, std::to_string, std::tuple, std::array; //? ------------------------------------------------- NAMESPACES ------------------------------------------------------ @@ -57,14 +56,8 @@ //* Reset text effects and restore theme foregrund and background color extern string reset; - //* Regex for matching color, style and cursor move escape sequences - const regex escape_regex("\033\\[\\d+;?\\d?;?\\d*;?\\d*;?\\d*(m|f|s|u|C|D|A|B){1}"); - - //* Regex for matching only color and style escape sequences - const regex color_regex("\033\\[\\d+;?\\d?;?\\d*;?\\d*;?\\d*(m){1}"); - //* Return a string with all colors and text styling removed - inline string uncolor(const string& s) { return regex_replace(s, color_regex, ""); } + string uncolor(const string& s); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.0.19/src/linux/btop_collect.cpp new/btop-1.0.20/src/linux/btop_collect.cpp --- old/btop-1.0.19/src/linux/btop_collect.cpp 2021-10-21 16:54:18.000000000 +0200 +++ new/btop-1.0.20/src/linux/btop_collect.cpp 2021-10-26 23:41:40.000000000 +0200 @@ -21,7 +21,6 @@ #include <cmath> #include <unistd.h> #include <numeric> -#include <regex> #include <sys/statvfs.h> #include <netdb.h> #include <ifaddrs.h> @@ -217,9 +216,8 @@ name += n + ' '; } name.pop_back(); - for (const auto& reg : {regex("Processor"), regex("CPU"), regex("\\(R\\)"), regex("\\(TM\\)"), regex("Intel"), - regex("AMD"), regex("Core"), regex("\\d?\\.?\\d+[mMgG][hH][zZ]")}) { - name = std::regex_replace(name, reg, ""); + for (const auto& replace : {"Processor", "CPU", "(R)", "(TM)", "Intel", "AMD", "Core"}) { + name = s_replace(name, replace, ""); } name = trim(name); } @@ -313,7 +311,7 @@ if (not got_coretemp or core_sensors.empty()) cpu_temp_only = true; if (cpu_sensor.empty() and not found_sensors.empty()) { for (const auto& [name, sensor] : found_sensors) { - if (s_contains(str_to_lower(name), "cpu")) { + if (s_contains(str_to_lower(name), "cpu") or s_contains(str_to_lower(name), "k10temp")) { cpu_sensor = name; break; }