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-11-30 23:16:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/btop (Old) and /work/SRC/openSUSE:Factory/.btop.new.31177 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "btop" Tue Nov 30 23:16:08 2021 rev:9 rq:934744 version:1.1.2 Changes: -------- --- /work/SRC/openSUSE:Factory/btop/btop.changes 2021-11-17 01:15:46.578192161 +0100 +++ /work/SRC/openSUSE:Factory/.btop.new.31177/btop.changes 2021-12-02 02:10:37.739509057 +0100 @@ -1,0 +2,11 @@ +Sun Nov 28 21:25:30 UTC 2021 - Scott Bradnick <scott.bradn...@suse.com> - 1.1.2 + +- Update to upstream release 1.1.2: + * Fixed: SISEGV on macos Mojave, by @mgradowski + * Fixed: Small optimizations and fixes to Mem::collect() and Input::get() + * Fixed: Wrong unit for net_upload and net_download in config menu + * Fixed: UTF-8 detection on macos + * Fixed: coretemp iteration due to missing tempX_input, by @KFilipek + * Fixed: coretemp ordering + +------------------------------------------------------------------- Old: ---- v1.1.1.tar.gz New: ---- v1.1.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ btop.spec ++++++ --- /var/tmp/diff_new_pack.ZYZNHu/_old 2021-12-02 02:10:38.403507031 +0100 +++ /var/tmp/diff_new_pack.ZYZNHu/_new 2021-12-02 02:10:38.403507031 +0100 @@ -17,7 +17,7 @@ Name: btop -Version: 1.1.1 +Version: 1.1.2 Release: 0 Summary: Usage and stats for processor, memory, disks, network and processes License: Apache-2.0 ++++++ v1.1.1.tar.gz -> v1.1.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.1.1/.github/workflows/continuous-build-linux.yml new/btop-1.1.2/.github/workflows/continuous-build-linux.yml --- old/btop-1.1.1/.github/workflows/continuous-build-linux.yml 2021-11-16 08:41:16.000000000 +0100 +++ new/btop-1.1.2/.github/workflows/continuous-build-linux.yml 2021-11-27 18:52:10.000000000 +0100 @@ -52,7 +52,6 @@ - mipsel-linux-musln32 - mipsel-linux-musln32sf - mipsel-linux-muslsf - - or1k-linux-musl - powerpc-linux-musl - powerpc-linux-muslsf - powerpc64-linux-musl @@ -62,15 +61,17 @@ - riscv32-linux-musl - riscv64-linux-musl - s390x-linux-musl - - sh2-linux-musl - - sh2-linux-muslfdpic - - sh2eb-linux-musl - - sh2eb-linux-muslfdpic - - sh4-linux-musl - - sh4eb-linux-musl - x86_64-linux-musl - x86_64-linux-muslx32 + # - or1k-linux-musl + # - sh2-linux-musl + # - sh2-linux-muslfdpic + # - sh2eb-linux-musl + # - sh2eb-linux-muslfdpic + # - sh4-linux-musl + # - sh4eb-linux-musl + runs-on: ubuntu-latest container: muslcc/x86_64:${{ matrix.toolchain }} @@ -85,7 +86,7 @@ run: git init # [fix Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).] - name: Build - run: make STATIC=true STRIP=true QUIET=true + run: make STATIC=true STRIP=true - name: Make executable run: chmod +x bin/* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.1.1/CHANGELOG.md new/btop-1.1.2/CHANGELOG.md --- old/btop-1.1.1/CHANGELOG.md 2021-11-16 08:41:16.000000000 +0100 +++ new/btop-1.1.2/CHANGELOG.md 2021-11-27 18:52:10.000000000 +0100 @@ -1,3 +1,17 @@ +## v1.1.2 + +* Fixed: SISEGV on macos Mojave, by @mgradowski + +* Fixed: Small optimizations and fixes to Mem::collect() and Input::get() + +* Fixed: Wrong unit for net_upload and net_download in config menu + +* Fixed: UTF-8 detection on macos + +* Fixed: coretemp iteration due to missing tempX_input, by @KFilipek + +* Fixed: coretemp ordering + ## v1.1.1 * Added: Partial static build (libgcc, libstdc++) for macos diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.1.1/src/btop.cpp new/btop-1.1.2/src/btop.cpp --- old/btop-1.1.1/src/btop.cpp 2021-11-16 08:41:16.000000000 +0100 +++ new/btop-1.1.2/src/btop.cpp 2021-11-27 18:52:10.000000000 +0100 @@ -28,6 +28,9 @@ #include <tuple> #include <regex> #include <chrono> +#ifdef __APPLE__ + #include <CoreFoundation/CoreFoundation.h> +#endif #include <btop_shared.hpp> #include <btop_tools.hpp> @@ -53,7 +56,7 @@ {"#801414", "???????????????????????? ????????? ???????????????????????????????????? ????????? ?????????"}, {"#000000", "????????????????????? ????????? ????????????????????? ?????????"}, }; - const string Version = "1.1.1"; + const string Version = "1.1.2"; int coreCount; string overlay; @@ -764,12 +767,34 @@ } } + #ifdef __APPLE__ + if (found.empty()) { + CFLocaleRef cflocale = CFLocaleCopyCurrent(); + CFStringRef id_value = (CFStringRef)CFLocaleGetValue(cflocale, kCFLocaleIdentifier); + auto loc_id = CFStringGetCStringPtr(id_value, kCFStringEncodingUTF8); + CFRelease(cflocale); + std::string cur_locale = (loc_id != nullptr ? loc_id : ""); + if (cur_locale.empty()) { + Logger::warning("No UTF-8 locale detected! Some symbols might not display correctly."); + } + else if (std::setlocale(LC_ALL, string(cur_locale + ".UTF-8").c_str()) != NULL) { + Logger::debug("Setting LC_ALL=" + cur_locale + ".UTF-8"); + } + else if(std::setlocale(LC_ALL, "en_US.UTF-8") != NULL) { + Logger::debug("Setting LC_ALL=en_US.UTF-8"); + } + else { + Logger::warning("Failed to set macos locale, continuing anyway."); + } + } + #else if (found.empty() and Global::utf_force) Logger::warning("No UTF-8 locale detected! Forcing start with --utf-force argument."); else if (found.empty()) { Global::exit_error_msg = "No UTF-8 locale detected!\nUse --utf-force argument to force start if you're sure your terminal can handle it."; clean_quit(1); } + #endif else if (not set_failure) Logger::debug("Setting LC_ALL=" + found); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.1.1/src/btop_input.cpp new/btop-1.1.2/src/btop_input.cpp --- old/btop-1.1.1/src/btop_input.cpp 2021-11-16 08:41:16.000000000 +0100 +++ new/btop-1.1.2/src/btop_input.cpp 2021-11-27 18:52:10.000000000 +0100 @@ -105,14 +105,14 @@ if (key.starts_with("[<")) { std::string_view key_view = key; string mouse_event; - if (key_view.starts_with("[<0;") and key_view.ends_with('M')) { + if (key_view.starts_with("[<0;") and key_view.find('M') != std::string_view::npos) { mouse_event = "mouse_click"; key_view.remove_prefix(4); } - else if (key_view.starts_with("[<0;") and key_view.ends_with('m')) { - mouse_event = "mouse_release"; - key_view.remove_prefix(4); - } + // else if (key_view.starts_with("[<0;") and key_view.ends_with('m')) { + // mouse_event = "mouse_release"; + // key_view.remove_prefix(4); + // } else if (key_view.starts_with("[<64;")) { mouse_event = "mouse_scroll_up"; key_view.remove_prefix(5); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.1.1/src/btop_menu.cpp new/btop-1.1.2/src/btop_menu.cpp --- old/btop-1.1.1/src/btop_menu.cpp 2021-11-16 08:41:16.000000000 +0100 +++ new/btop-1.1.2/src/btop_menu.cpp 2021-11-27 18:52:10.000000000 +0100 @@ -486,13 +486,13 @@ {"net_download", "Fixed network graph download value.", "", - "Value in Mebibytes, default \"100\".", + "Value in Mebibits, default \"100\".", "", "Can be toggled with auto button."}, {"net_upload", "Fixed network graph upload value.", "", - "Value in Mebibytes, default \"100\".", + "Value in Mebibits, default \"100\".", "", "Can be toggled with auto button."}, {"net_auto", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.1.1/src/linux/btop_collect.cpp new/btop-1.1.2/src/linux/btop_collect.cpp --- old/btop-1.1.1/src/linux/btop_collect.cpp 2021-11-16 08:41:16.000000000 +0100 +++ new/btop-1.1.2/src/linux/btop_collect.cpp 2021-11-27 18:52:10.000000000 +0100 @@ -240,20 +240,36 @@ if (s_contains(add_path, "coretemp")) got_coretemp = true; - if (fs::exists(add_path / "temp1_input")) { - search_paths.push_back(add_path); + for (const auto & file : fs::directory_iterator(add_path)) { + if (string(file.path().filename()) == "device") { + for (const auto & dev_file : fs::directory_iterator(file.path())) { + string dev_filename = dev_file.path().filename(); + if (dev_filename.starts_with("temp") and dev_filename.ends_with("_input")) { + search_paths.push_back(file.path()); + break; + } + } + } + + string filename = file.path().filename(); + if (filename.starts_with("temp") and filename.ends_with("_input")) { + search_paths.push_back(add_path); + break; + } } - else if (fs::exists(add_path / "device/temp1_input")) - search_paths.push_back(add_path / "device"); } } if (not got_coretemp and fs::exists(fs::path("/sys/devices/platform/coretemp.0/hwmon"))) { for (auto& d : fs::directory_iterator(fs::path("/sys/devices/platform/coretemp.0/hwmon"))) { fs::path add_path = fs::canonical(d.path()); - if (fs::exists(d.path() / "temp1_input") and not v_contains(search_paths, add_path)) { - search_paths.push_back(add_path); - got_coretemp = true; + for (const auto & file : fs::directory_iterator(add_path)) { + string filename = file.path().filename(); + if (filename.starts_with("temp") and filename.ends_with("_input") and not v_contains(search_paths, add_path)) { + search_paths.push_back(add_path); + got_coretemp = true; + break; + } } } } @@ -261,9 +277,17 @@ if (not search_paths.empty()) { for (const auto& path : search_paths) { const string pname = readfile(path / "name", path.filename()); - for (int i = 1; fs::exists(path / string("temp" + to_string(i) + "_input")); i++) { - const string basepath = path / string("temp" + to_string(i) + "_"); - const string label = readfile(fs::path(basepath + "label"), "temp" + to_string(i)); + for (const auto & file : fs::directory_iterator(path)) { + const string file_suffix = "input"; + const int file_id = atoi(file.path().filename().c_str() + 4); // skip "temp" prefix + string file_path = file.path(); + + if (!s_contains(file_path, file_suffix)) { + continue; + } + + const string basepath = file_path.erase(file_path.find(file_suffix), file_suffix.length()); + const string label = readfile(fs::path(basepath + "label"), "temp" + to_string(file_id)); const string sensor_name = pname + "/" + label; const int64_t temp = stol(readfile(fs::path(basepath + "input"), "0")) / 1000; const int64_t high = stol(readfile(fs::path(basepath + "max"), "80000")) / 1000; @@ -309,7 +333,16 @@ } catch (...) {} - if (not got_coretemp or core_sensors.empty()) cpu_temp_only = true; + if (not got_coretemp or core_sensors.empty()) { + cpu_temp_only = true; + } + else { + rng::sort(core_sensors, rng::less{}); + rng::stable_sort(core_sensors, [](const auto& a, const auto& b){ + return a.size() < b.size(); + }); + } + if (cpu_sensor.empty() and not found_sensors.empty()) { for (const auto& [name, sensor] : found_sensors) { if (s_contains(str_to_lower(name), "cpu") or s_contains(str_to_lower(name), "k10temp")) { @@ -730,7 +763,7 @@ ifstream meminfo(Shared::procPath / "meminfo"); if (meminfo.good()) { bool got_avail = false; - for (string label; meminfo >> label;) { + for (string label; meminfo.peek() != 'D' and meminfo >> label;) { if (label == "MemFree:") { meminfo >> mem.stats.at("free"); mem.stats.at("free") <<= 10; @@ -1707,4 +1740,4 @@ } throw std::runtime_error("Failed get uptime from from " + (string)Shared::procPath + "/uptime"); } -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/btop-1.1.1/src/osx/sensors.cpp new/btop-1.1.2/src/osx/sensors.cpp --- old/btop-1.1.1/src/osx/sensors.cpp 2021-11-16 08:41:16.000000000 +0100 +++ new/btop-1.1.2/src/osx/sensors.cpp 2021-11-27 18:52:10.000000000 +0100 @@ -37,7 +37,8 @@ nums[1] = CFNumberCreate(0, kCFNumberSInt32Type, &usage); CFDictionaryRef dict = CFDictionaryCreate(0, (const void **)keys, (const void **)nums, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); - CFRelease(keys); + CFRelease(keys[0]); + CFRelease(keys[1]); return dict; }