Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libstorage-ng for openSUSE:Factory checked in at 2023-09-06 18:55:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old) and /work/SRC/openSUSE:Factory/.libstorage-ng.new.1766 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libstorage-ng" Wed Sep 6 18:55:34 2023 rev:237 rq:1109243 version:4.5.139 Changes: -------- --- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes 2023-08-09 17:24:28.965092442 +0200 +++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.1766/libstorage-ng.changes 2023-09-06 18:55:57.082763558 +0200 @@ -1,0 +2,22 @@ +Wed Sep 6 09:47:07 UTC 2023 - aschn...@suse.com + +- merge gh#openSUSE/libstorage-ng#946 +- improved json parse functions to handle string and integer +- 4.5.139 + +-------------------------------------------------------------------- +Mon Sep 4 08:25:46 UTC 2023 - aschn...@suse.com + +- merge gh#openSUSE/libstorage-ng#945 +- fixed parsing of lsscsi version for older lsscsi versions + (bsc#1214814) +- 4.5.138 + +-------------------------------------------------------------------- +Mon Sep 4 07:21:42 UTC 2023 - aschn...@suse.com + +- merge gh#openSUSE/libstorage-ng#944 +- add awk to GitHub action for Tumbleweed +- 4.5.137 + +-------------------------------------------------------------------- Old: ---- libstorage-ng-4.5.136.tar.xz New: ---- libstorage-ng-4.5.139.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage-ng.spec ++++++ --- /var/tmp/diff_new_pack.6jsnqK/_old 2023-09-06 18:55:58.458812611 +0200 +++ /var/tmp/diff_new_pack.6jsnqK/_new 2023-09-06 18:55:58.462812754 +0200 @@ -18,7 +18,7 @@ %define libname %{name}1 Name: libstorage-ng -Version: 4.5.136 +Version: 4.5.139 Release: 0 Summary: Library for storage management License: GPL-2.0-only ++++++ libstorage-ng-4.5.136.tar.xz -> libstorage-ng-4.5.139.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.136/.github/workflows/ci-tumbleweed.yml new/libstorage-ng-4.5.139/.github/workflows/ci-tumbleweed.yml --- old/libstorage-ng-4.5.136/.github/workflows/ci-tumbleweed.yml 2023-08-08 17:15:30.000000000 +0200 +++ new/libstorage-ng-4.5.139/.github/workflows/ci-tumbleweed.yml 2023-09-06 11:47:07.000000000 +0200 @@ -10,7 +10,7 @@ steps: - name: Install additional packages - run: zypper --non-interactive in --no-recommends autoconf automake doxygen gcc-c++ gettext-runtime glibc-locale graphviz libboost_headers-devel libboost_test-devel libjson-c-devel libtool libxml2-devel make python3-devel ruby-devel swig xz + run: zypper --non-interactive in --no-recommends autoconf automake awk doxygen gcc-c++ gettext-runtime glibc-locale graphviz libboost_headers-devel libboost_test-devel libjson-c-devel libtool libxml2-devel make python3-devel ruby-devel swig xz - name: List installed packages run: rpm -qa | sort diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.136/LIBVERSION new/libstorage-ng-4.5.139/LIBVERSION --- old/libstorage-ng-4.5.136/LIBVERSION 2023-08-08 17:15:30.000000000 +0200 +++ new/libstorage-ng-4.5.139/LIBVERSION 2023-09-06 11:47:07.000000000 +0200 @@ -1 +1 @@ -1.91.0 +1.91.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.136/VERSION new/libstorage-ng-4.5.139/VERSION --- old/libstorage-ng-4.5.136/VERSION 2023-08-08 17:15:30.000000000 +0200 +++ new/libstorage-ng-4.5.139/VERSION 2023-09-06 11:47:07.000000000 +0200 @@ -1 +1 @@ -4.5.136 +4.5.139 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.136/storage/SystemInfo/CmdBtrfs.cc new/libstorage-ng-4.5.139/storage/SystemInfo/CmdBtrfs.cc --- old/libstorage-ng-4.5.136/storage/SystemInfo/CmdBtrfs.cc 2023-08-08 17:15:30.000000000 +0200 +++ new/libstorage-ng-4.5.139/storage/SystemInfo/CmdBtrfs.cc 2023-09-06 11:47:07.000000000 +0200 @@ -411,10 +411,10 @@ string tmp3, tmp4; if (!get_child_value(tmp2, "bg-type", tmp3)) - ST_THROW(Exception("\"bg-type\" not found")); + ST_THROW(Exception("\"bg-type\" not found or invalid")); if (!get_child_value(tmp2, "bg-profile", tmp4)) - ST_THROW(Exception("\"bg-profile\" not found")); + ST_THROW(Exception("\"bg-profile\" not found or invalid")); boost::to_upper(tmp4, locale::classic()); @@ -528,19 +528,15 @@ string tmp3; if (!get_child_value(tmp2, "qgroupid", tmp3)) - ST_THROW(Exception("\"qgroupid\" not found")); + ST_THROW(Exception("\"qgroupid\" not found or invalid")); entry.id = BtrfsQgroup::Impl::parse_id(tmp3); - if (!get_child_value(tmp2, "referenced", tmp3)) - ST_THROW(Exception("\"referenced\" not found")); + if (!get_child_value(tmp2, "referenced", entry.referenced)) + ST_THROW(Exception("\"referenced\" not found or invalid")); - tmp3 >> entry.referenced; - - if (!get_child_value(tmp2, "exclusive", tmp3)) - ST_THROW(Exception("\"exclusive\" not found")); - - tmp3 >> entry.exclusive; + if (!get_child_value(tmp2, "exclusive", entry.exclusive)) + ST_THROW(Exception("\"exclusive\" not found or invalid")); if (!get_child_value(tmp2, "max_referenced", tmp3)) ST_THROW(Exception("\"max_referenced\" not found")); @@ -556,7 +552,7 @@ vector<json_object*> tmp4; if (!get_child_nodes(tmp2, "parents", tmp4)) - ST_THROW(Exception("\"parents\" not found")); + ST_THROW(Exception("\"parents\" not found or invalid")); for (json_object* tmp5 : tmp4) entry.parents_id.push_back(BtrfsQgroup::Impl::parse_id(json_object_get_string(tmp5))); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.136/storage/SystemInfo/CmdLsscsi.cc new/libstorage-ng-4.5.139/storage/SystemInfo/CmdLsscsi.cc --- old/libstorage-ng-4.5.136/storage/SystemInfo/CmdLsscsi.cc 2023-08-08 17:15:30.000000000 +0200 +++ new/libstorage-ng-4.5.139/storage/SystemInfo/CmdLsscsi.cc 2023-09-06 11:47:07.000000000 +0200 @@ -147,15 +147,15 @@ void LsscsiVersion::parse_version(const string& version) { - const regex version_rx("release: ([0-9]+)\\.([0-9]+)", regex::extended); + const regex version_rx("(version|release): ([0-9]+)\\.([0-9]+)", regex::extended); smatch match; if (!regex_search(version, match, version_rx)) ST_THROW(Exception("failed to parse lsscsi version '" + version + "'")); - major = stoi(match[1]); - minor = stoi(match[2]); + major = stoi(match[2]); + minor = stoi(match[3]); y2mil("major:" << major << " minor:" << minor); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.5.136/storage/Utils/JsonFile.cc new/libstorage-ng-4.5.139/storage/Utils/JsonFile.cc --- old/libstorage-ng-4.5.136/storage/Utils/JsonFile.cc 2023-08-08 17:15:30.000000000 +0200 +++ new/libstorage-ng-4.5.139/storage/Utils/JsonFile.cc 2023-09-06 11:47:07.000000000 +0200 @@ -24,7 +24,6 @@ #include <sys/stat.h> #include <functional> #include <memory> -#include <sstream> #include "storage/Utils/JsonFile.h" #include "storage/Utils/ExceptionImpl.h" @@ -149,16 +148,21 @@ } + // json_object_get_int and json_object_get_int64 parse strings as integer. + + template<> bool get_child_value(json_object* parent, const char* name, int& value) { + static_assert(sizeof(int) <= 4, "int wider than 32 bit"); + json_object* child; if (!json_object_object_get_ex(parent, name, &child)) return false; - if (!json_object_is_type(child, json_type_int)) + if (!json_object_is_type(child, json_type_int) && !json_object_is_type(child, json_type_string)) return false; value = json_object_get_int(child); @@ -171,12 +175,14 @@ bool get_child_value(json_object* parent, const char* name, unsigned int& value) { + static_assert(sizeof(unsigned int) <= 4, "unsigned int wider than 32 bit"); + json_object* child; if (!json_object_object_get_ex(parent, name, &child)) return false; - if (!json_object_is_type(child, json_type_int)) + if (!json_object_is_type(child, json_type_int) && !json_object_is_type(child, json_type_string)) return false; value = json_object_get_int(child); @@ -189,17 +195,17 @@ bool get_child_value(json_object* parent, const char* name, unsigned long& value) { + static_assert(sizeof(unsigned long) <= 8, "unsigned long wider than 64 bit"); + json_object* child; if (!json_object_object_get_ex(parent, name, &child)) return false; - if (!json_object_is_type(child, json_type_string)) + if (!json_object_is_type(child, json_type_int) && !json_object_is_type(child, json_type_string)) return false; - std::istringstream istr(json_object_get_string(child)); - classic(istr); - istr >> value; + value = json_object_get_int64(child); return true; } @@ -209,17 +215,17 @@ bool get_child_value(json_object* parent, const char* name, unsigned long long& value) { + static_assert(sizeof(unsigned long) <= 8, "unsigned long long wider than 64 bit"); + json_object* child; if (!json_object_object_get_ex(parent, name, &child)) return false; - if (!json_object_is_type(child, json_type_string)) + if (!json_object_is_type(child, json_type_int) && !json_object_is_type(child, json_type_string)) return false; - std::istringstream istr(json_object_get_string(child)); - classic(istr); - istr >> value; + value = json_object_get_int64(child); return true; }