Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package btop for openSUSE:Factory checked in at 2022-02-15 23:57:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/btop (Old) and /work/SRC/openSUSE:Factory/.btop.new.1956 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "btop" Tue Feb 15 23:57:47 2022 rev:14 rq:955097 version:1.2.3 Changes: -------- --- /work/SRC/openSUSE:Factory/btop/btop.changes 2022-02-13 00:15:27.736127532 +0100 +++ /work/SRC/openSUSE:Factory/.btop.new.1956/btop.changes 2022-02-15 23:58:15.240373839 +0100 @@ -1,0 +2,18 @@ +Tue Feb 15 18:31:34 UTC 2022 - Scott Bradnick <scott.bradn...@suse.com> - 1.2.3 + +- Update to upstream release 1.2.3: + * Changed: floating_humanizer() now show fractions when shortened and value + is < 10 + * Fixed: Process tree not redrawing properly + * Fixed: string to wstring conversion crash when string is too big + +------------------------------------------------------------------- +Mon Feb 14 20:32:36 UTC 2022 - Scott Bradnick <scott.bradn...@suse.com> - 1.2.2 + +- Update to upstream release 1.2.2: + * Changed: Reverted uncolor() back to using regex to fix delay in opening + menu when compiled with musl + * Added: Toggle for showing free disk space for privileged or normal users + * Added: Clarification on signal screen that number can be manually entered + +------------------------------------------------------------------- Old: ---- v1.2.1.tar.gz New: ---- v1.2.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ btop.spec ++++++ --- /var/tmp/diff_new_pack.Lx7exB/_old 2022-02-15 23:58:15.732375197 +0100 +++ /var/tmp/diff_new_pack.Lx7exB/_new 2022-02-15 23:58:15.736375208 +0100 @@ -17,7 +17,7 @@ Name: btop -Version: 1.2.1 +Version: 1.2.3 Release: 0 Summary: Usage and stats for processor, memory, disks, network and processes License: Apache-2.0 ++++++ v1.2.1.tar.gz -> v1.2.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.2.1/CHANGELOG.md new/btop-1.2.3/CHANGELOG.md --- old/btop-1.2.1/CHANGELOG.md 2022-02-11 20:02:21.000000000 +0100 +++ new/btop-1.2.3/CHANGELOG.md 2022-02-15 18:39:36.000000000 +0100 @@ -1,3 +1,19 @@ +## v1.2.3 + +* Changed: floating_humanizer() now show fractions when shortened and value is < 10 + +* Fixed: Process tree not redrawing properly + +* Fixed: string to wstring conversion crash when string is too big + +## v1.2.2 + +* Changed: Reverted uncolor() back to using regex to fix delay in opening menu when compiled with musl + +* Added: Toggle for showing free disk space for privileged or normal users + +* Added: Clarification on signal screen that number can be manually entered + ## v1.2.1 * Added: Arrow only after use of "f" when filtering processes, by @NavigationHazard diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.2.1/Makefile new/btop-1.2.3/Makefile --- old/btop-1.2.1/Makefile 2022-02-11 20:02:21.000000000 +0100 +++ new/btop-1.2.3/Makefile 2022-02-15 18:39:36.000000000 +0100 @@ -4,6 +4,7 @@ override BTOP_VERSION := $(shell head -n100 src/btop.cpp 2>/dev/null | grep "Version =" | cut -f2 -d"\"" || echo " unknown") override TIMESTAMP := $(shell date +%s 2>/dev/null || echo "0") +override DATESTAMP := $(shell date '+%Y-%m-%d %H:%M:%S' || echo "5 minutes ago") ifeq ($(shell command -v gdate >/dev/null; echo $$?),0) DATE_CMD := gdate else @@ -129,15 +130,27 @@ override OPTFLAGS := -O0 -g endif -SOURCES := $(shell find $(SRCDIR) -maxdepth 1 -type f -name *.$(SRCEXT)) +SOURCES := $(sort $(shell find $(SRCDIR) -maxdepth 1 -type f -name *.$(SRCEXT))) -SOURCES += $(shell find $(SRCDIR)/$(PLATFORM_DIR) -type f -name *.$(SRCEXT)) +SOURCES += $(sort $(shell find $(SRCDIR)/$(PLATFORM_DIR) -type f -name *.$(SRCEXT))) +#? Setup percentage progress SOURCE_COUNT := $(words $(SOURCES)) OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.$(OBJEXT))) -PROGRESS = expr $$(find $(BUILDDIR) -maxdepth 2 -type f -name *.o | wc -l) '*' 90 / $(SOURCE_COUNT) +ifeq ($(shell find $(BUILDDIR) -type f -newermt "$(DATESTAMP)" -name *.o >/dev/null 2>&1; echo $$?),0) + ifneq ($(wildcard $(BUILDDIR)/.*),) + SKIPPED_SOURCES := $(foreach fname,$(SOURCES),$(shell find $(BUILDDIR) -type f -newer $(fname) -name *.o | grep "$(basename $(notdir $(fname))).o" 2>/dev/null)) + override SOURCE_COUNT := $(shell expr $(SOURCE_COUNT) - $(words $(SKIPPED_SOURCES))) + ifeq ($(SOURCE_COUNT),0) + override SOURCE_COUNT = $(words $(SOURCES)) + endif + endif + PROGRESS = expr $$(find $(BUILDDIR) -type f -newermt "$(DATESTAMP)" -name *.o | wc -l || echo 1) '*' 90 / $(SOURCE_COUNT) | cut -c1-2 +else + PROGRESS = expr $$(find $(BUILDDIR) -type f -name *.o | wc -l || echo 1) '*' 90 / $(SOURCE_COUNT) | cut -c1-2 +endif P := %% diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.2.1/README.md new/btop-1.2.3/README.md --- old/btop-1.2.1/README.md 2022-02-11 20:02:21.000000000 +0100 +++ new/btop-1.2.3/README.md 2022-02-15 18:39:36.000000000 +0100 @@ -557,7 +557,7 @@ ``` sudo snap install btop --edge ``` - + * **Connect the interface** ```bash @@ -570,17 +570,17 @@ All options changeable from within UI. Config and log files stored in `$XDG_CONFIG_HOME/btop` or `$HOME/.config/btop` folder -#### btop.cfg: (auto generated if not found) +#### btop.conf: (auto generated if not found) ```bash -#? Config file for btop v. 0.1.0 +#? Config file for btop v. 1.2.2 #* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. #* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" color_theme = "Default" #* If the theme set background should be shown, set to False if you want terminal background transparency. -theme_background = False +theme_background = True #* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false. truecolor = True @@ -595,6 +595,10 @@ #* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty" presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty" +#* Set to True to enable "h,j,k,l" keys for directional control in lists. +#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift. +vim_keys = False + #* Rounded corners on boxes, is ignored if TTY mode is ON. rounded_corners = True @@ -618,10 +622,10 @@ graph_symbol_proc = "default" #* Manually set which boxes to show. Available values are "cpu mem net proc", separate values with whitespace. -shown_boxes = "cpu mem net proc" +shown_boxes = "proc cpu mem net" #* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs. -update_ms = 2000 +update_ms = 1500 #* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu responsive", #* "cpu lazy" sorts top process over time (easier to follow), "cpu responsive" updates top process directly. @@ -689,6 +693,9 @@ #* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine". temp_scale = "celsius" +#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024. +base_10_sizes = False + #* Show CPU frequency. show_cpu_freq = True @@ -727,6 +734,9 @@ #* Read disks list from /etc/fstab. This also disables only_physical. use_fstab = False +#* Set to true to show available disk space for privileged users. +disk_free_priv = False + #* Toggles if io activity % (disk busy time) should be shown in regular disk usage view. show_io_stat = True @@ -757,6 +767,9 @@ #* Show battery stats in top right if battery is present. show_battery = True +#* Which battery to use if multiple are present. "Auto" for auto detection. +selected_battery = "Auto" + #* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG". #* The level set includes all lower levels, i.e. "DEBUG" will show all logging info. log_level = "DEBUG" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.2.1/src/btop.cpp new/btop-1.2.3/src/btop.cpp --- old/btop-1.2.1/src/btop.cpp 2022-02-11 20:02:21.000000000 +0100 +++ new/btop-1.2.3/src/btop.cpp 2022-02-15 18:39:36.000000000 +0100 @@ -60,7 +60,7 @@ {"#801414", "???????????????????????? ????????? ???????????????????????????????????? ????????? ?????????"}, {"#000000", "????????????????????? ????????? ????????????????????? ?????????"}, }; - const string Version = "1.2.1"; + const string Version = "1.2.3"; int coreCount; string overlay; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.2.1/src/btop_config.cpp new/btop-1.2.3/src/btop_config.cpp --- old/btop-1.2.1/src/btop_config.cpp 2022-02-11 20:02:21.000000000 +0100 +++ new/btop-1.2.3/src/btop_config.cpp 2022-02-15 18:39:36.000000000 +0100 @@ -151,6 +151,8 @@ {"use_fstab", "#* Read disks list from /etc/fstab. This also disables only_physical."}, + {"disk_free_priv", "#* Set to true to show available disk space for privileged users."}, + {"show_io_stat", "#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view."}, {"io_mode", "#* Toggles io mode for disks, showing big graphs for disk read/write speeds."}, @@ -242,6 +244,7 @@ {"show_battery", true}, {"vim_keys", false}, {"tty_mode", false}, + {"disk_free_priv", false}, {"force_tty", false}, {"lowcolor", false}, {"show_detailed", false}, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.2.1/src/btop_draw.cpp new/btop-1.2.3/src/btop_draw.cpp --- old/btop-1.2.1/src/btop_draw.cpp 2022-02-11 20:02:21.000000000 +0100 +++ new/btop-1.2.3/src/btop_draw.cpp 2022-02-15 18:39:36.000000000 +0100 @@ -1412,10 +1412,10 @@ width_left -= (ulen(p.name) + 1); } if (width_left > 7 and p.short_cmd != p.name) { - out += g_color + '(' + uresize(p.short_cmd, width_left - 3, true) + ')'; + out += g_color + '(' + uresize(p.short_cmd, width_left - 3, true) + ") "; width_left -= (ulen(p.short_cmd, true) + 3); } - out += Mv::to(y+2+lc, x+2+tree_size); + out += string(max(0, width_left), ' ') + Mv::to(y+2+lc, x+2+tree_size); } //? Common end of line string cpu_str = to_string(p.cpu_p); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.2.1/src/btop_menu.cpp new/btop-1.2.3/src/btop_menu.cpp --- old/btop-1.2.1/src/btop_menu.cpp 2022-02-11 20:02:21.000000000 +0100 +++ new/btop-1.2.3/src/btop_menu.cpp 2022-02-15 18:39:36.000000000 +0100 @@ -464,12 +464,19 @@ "", "True or False."}, {"use_fstab", - "Read disks list from /etc/fstab.", - "(Has no effect on macOS X)", + "(Linux) Read disks list from /etc/fstab.", "", "This also disables only_physical.", "", "True or False."}, + {"disk_free_priv", + "(Linux) Type of available disk space.", + "", + "Set to true to show how much disk space is", + "available for privileged users.", + "", + "Set to false to show available for normal", + "users."}, {"disks_filter", "Optional filter for shown disks.", "", @@ -687,7 +694,7 @@ if (redraw) { x = Term::width/2 - 40; y = Term::height/2 - 9; - bg = Draw::createBox(x + 2, y, 78, 18, Theme::c("hi_fg"), true, "signals"); + bg = Draw::createBox(x + 2, y, 78, 19, Theme::c("hi_fg"), true, "signals"); bg += Mv::to(y+2, x+3) + Theme::c("title") + Fx::b + cjust("Send signal to PID " + to_string(s_pid) + " (" + uresize((s_pid == Config::getI("detailed_pid") ? Proc::detailed.entry.name : Config::getS("selected_name")), 30) + ")", 76); } @@ -769,11 +776,12 @@ } cy++; - out += Mv::to(++cy, x+3) + Fx::b + Theme::c("hi_fg") + rjust("ENTER", 38) + Theme::c("main_fg") + Fx::ub + " | To send signal."; - mouse_mappings["enter"] = {cy, x, 1, 78}; - out += Mv::to(++cy, x+3) + Fx::b + Theme::c("hi_fg") + rjust( "??? ??? ??? ???", 38, true) + Theme::c("main_fg") + Fx::ub + " | To choose signal."; - out += Mv::to(++cy, x+3) + Fx::b + Theme::c("hi_fg") + rjust("ESC or \"q\"", 38) + Theme::c("main_fg") + Fx::ub + " | To abort."; - mouse_mappings["escape"] = {cy, x, 1, 78}; + out += Mv::to(++cy, x+3) + Fx::b + Theme::c("hi_fg") + rjust( "??? ??? ??? ???", 33, true) + Theme::c("main_fg") + Fx::ub + " | To choose signal."; + out += Mv::to(++cy, x+3) + Fx::b + Theme::c("hi_fg") + rjust("0-9", 33) + Theme::c("main_fg") + Fx::ub + " | Enter manually."; + out += Mv::to(++cy, x+3) + Fx::b + Theme::c("hi_fg") + rjust("ENTER", 33) + Theme::c("main_fg") + Fx::ub + " | To send signal."; + mouse_mappings["enter"] = {cy, x, 1, 73}; + out += Mv::to(++cy, x+3) + Fx::b + Theme::c("hi_fg") + rjust("ESC or \"q\"", 33) + Theme::c("main_fg") + Fx::ub + " | To abort."; + mouse_mappings["escape"] = {cy, x, 1, 73}; out += Fx::reset; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.2.1/src/btop_tools.cpp new/btop-1.2.3/src/btop_tools.cpp --- old/btop-1.2.1/src/btop_tools.cpp 2022-02-11 20:02:21.000000000 +0100 +++ new/btop-1.2.3/src/btop_tools.cpp 2022-02-15 18:39:36.000000000 +0100 @@ -141,36 +141,37 @@ //? --------------------------------------------------- FUNCTIONS ----------------------------------------------------- -namespace Fx { - string uncolor(const string& s) { - string out = s; - for (size_t offset = 0, start_pos = 0, end_pos = 0;;) { - start_pos = (offset == 0) ? out.find('\x1b') : offset; - if (start_pos == string::npos) - break; - offset = start_pos + 1; - end_pos = out.find('m', offset); - if (end_pos == string::npos) - break; - else if (auto next_pos = out.find('\x1b', offset); not isdigit(out[end_pos - 1]) or end_pos > next_pos) { - offset = next_pos; - continue; - } - - out.erase(start_pos, (end_pos - start_pos)+1); - offset = 0; - } - out.shrink_to_fit(); - return out; - } -} +// ! Dsiabled due to issue when compiling with musl, reverted back to using regex +// namespace Fx { +// string uncolor(const string& s) { +// string out = s; +// for (size_t offset = 0, start_pos = 0, end_pos = 0;;) { +// start_pos = (offset == 0) ? out.find('\x1b') : offset; +// if (start_pos == string::npos) +// break; +// offset = start_pos + 1; +// end_pos = out.find('m', offset); +// if (end_pos == string::npos) +// break; +// else if (auto next_pos = out.find('\x1b', offset); not isdigit(out[end_pos - 1]) or end_pos > next_pos) { +// offset = next_pos; +// continue; +// } + +// out.erase(start_pos, (end_pos - start_pos)+1); +// offset = 0; +// } +// out.shrink_to_fit(); +// return out; +// } +// } namespace Tools { size_t wide_ulen(const string& str) { unsigned int chars = 0; std::wstring_convert<std::codecvt_utf8<wchar_t>> conv; - auto w_str = conv.from_bytes(str.c_str()); + auto w_str = conv.from_bytes((str.size() > 10000 ? str.substr(0, 10000).c_str() : str.c_str())); for (auto c : w_str) { chars += utf8::wcwidth(c); @@ -193,7 +194,7 @@ if (len < 1 or str.empty()) return ""; if (wide) { std::wstring_convert<std::codecvt_utf8<wchar_t>> conv; - auto w_str = conv.from_bytes(str.c_str()); + auto w_str = conv.from_bytes((str.size() > 10000 ? str.substr(0, 10000).c_str() : str.c_str())); while (wide_ulen(w_str) > len) w_str.pop_back(); str = conv.to_bytes(w_str); @@ -359,7 +360,9 @@ else if (out.size() >= 2) out.resize(out.size() - 2); } if (shorten) { - if (out.find('.') != string::npos) out = to_string((int)round(stof(out))); + auto f_pos = out.find('.'); + if (f_pos == 1 and out.size() > 3) out = out.substr(0,2) + to_string((int)round(stof(out.substr(2)) / 10)); + else if (f_pos != string::npos) out = to_string((int)round(stof(out))); if (out.size() > 3) { out = to_string((int)(out[0] - '0') + 1); start++;} out.push_back(units[start][0]); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.2.1/src/btop_tools.hpp new/btop-1.2.3/src/btop_tools.hpp --- old/btop-1.2.1/src/btop_tools.hpp 2022-02-11 20:02:21.000000000 +0100 +++ new/btop-1.2.3/src/btop_tools.hpp 2022-02-15 18:39:36.000000000 +0100 @@ -22,6 +22,7 @@ #include <vector> #include <array> #include <atomic> +#include <regex> #include <filesystem> #include <ranges> #include <chrono> @@ -64,8 +65,15 @@ //* Reset text effects and restore theme foregrund and background color extern string reset; + //* Regex for matching color, style and cursor move escape sequences + const std::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 std::regex color_regex("\033\\[\\d+;?\\d?;?\\d*;?\\d*;?\\d*(m){1}"); + //* Return a string with all colors and text styling removed - string uncolor(const string& s); + inline string uncolor(const string& s) { return std::regex_replace(s, color_regex, ""); } + // string uncolor(const string& s); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.2.1/src/linux/btop_collect.cpp new/btop-1.2.3/src/linux/btop_collect.cpp --- old/btop-1.2.1/src/linux/btop_collect.cpp 2022-02-11 20:02:21.000000000 +0100 +++ new/btop-1.2.3/src/linux/btop_collect.cpp 2022-02-15 18:39:36.000000000 +0100 @@ -817,6 +817,7 @@ //? Get disks stats if (show_disks) { double uptime = system_uptime(); + auto free_priv = Config::getB("disk_free_priv"); try { auto& disks_filter = Config::getS("disks_filter"); bool filter_exclude = false; @@ -943,7 +944,7 @@ continue; } disk.total = vfs.f_blocks * vfs.f_frsize; - disk.free = vfs.f_bfree * vfs.f_frsize; + disk.free = (free_priv ? vfs.f_bfree : vfs.f_bavail) * vfs.f_frsize; disk.used = disk.total - disk.free; disk.used_percent = round((double)disk.used * 100 / disk.total); disk.free_percent = 100 - disk.used_percent; @@ -1492,7 +1493,13 @@ pread.open(d.path() / "cmdline"); if (not pread.good()) continue; long_string.clear(); - while(getline(pread, long_string, '\0')) new_proc.cmd += long_string + ' '; + while(getline(pread, long_string, '\0')) { + new_proc.cmd += long_string + ' '; + if (new_proc.cmd.size() > 1000) { + new_proc.cmd.resize(1000); + break; + } + } pread.close(); if (not new_proc.cmd.empty()) new_proc.cmd.pop_back();