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 2026-05-14 21:42:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old)
 and      /work/SRC/openSUSE:Factory/.libstorage-ng.new.1966 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libstorage-ng"

Thu May 14 21:42:18 2026 rev:337 rq:1353066 version:4.5.316

Changes:
--------
--- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes      
2026-04-23 17:03:19.585568033 +0200
+++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.1966/libstorage-ng.changes    
2026-05-14 21:42:59.370679877 +0200
@@ -1,0 +2,18 @@
+Wed May 13 16:49:39 UTC 2026 - [email protected]
+
+- merge gh#openSUSE/libstorage-ng#1071
+- improved xml parser
+- coding style
+- 4.5.316
+
+--------------------------------------------------------------------
+Wed May 13 09:53:00 UTC 2026 - [email protected]
+
+- merge gh#openSUSE/libstorage-ng#1070
+- fixed test
+- added tests
+- use modern C++
+- minor improvements
+- 4.5.315
+
+--------------------------------------------------------------------

Old:
----
  libstorage-ng-4.5.314.tar.xz

New:
----
  libstorage-ng-4.5.316.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libstorage-ng.spec ++++++
--- /var/tmp/diff_new_pack.YuePrT/_old  2026-05-14 21:43:02.206796215 +0200
+++ /var/tmp/diff_new_pack.YuePrT/_new  2026-05-14 21:43:02.226797036 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package libstorage-ng
 #
-# Copyright (c) 2026 SUSE LLC
+# Copyright (c) 2026 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %define libname %{name}1
 Name:           libstorage-ng
-Version:        4.5.314
+Version:        4.5.316
 Release:        0
 Summary:        Library for storage management
 License:        GPL-2.0-only

++++++ libstorage-ng-4.5.314.tar.xz -> libstorage-ng-4.5.316.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.314/VERSION 
new/libstorage-ng-4.5.316/VERSION
--- old/libstorage-ng-4.5.314/VERSION   2026-04-21 12:57:35.000000000 +0200
+++ new/libstorage-ng-4.5.316/VERSION   2026-05-13 18:49:39.000000000 +0200
@@ -1 +1 @@
-4.5.314
+4.5.316
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.314/storage/Utils/LockImpl.cc 
new/libstorage-ng-4.5.316/storage/Utils/LockImpl.cc
--- old/libstorage-ng-4.5.314/storage/Utils/LockImpl.cc 2026-04-21 
12:57:35.000000000 +0200
+++ new/libstorage-ng-4.5.316/storage/Utils/LockImpl.cc 2026-05-13 
18:49:39.000000000 +0200
@@ -21,11 +21,10 @@
  */
 
 
-#include <stdio.h>
+#include <cstdio>
 #include <unistd.h>
 #include <fcntl.h>
-#include <string.h>
-#include <errno.h>
+#include <cerrno>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <stdlib.h>
@@ -75,10 +74,10 @@
                ST_THROW(LockException(0));
            }
 
-           struct flock lock;
-           memset(&lock, 0, sizeof(lock));
+           struct flock lock {};
            lock.l_type = (read_only ? F_RDLCK : F_WRLCK);
            lock.l_whence = SEEK_SET;
+
            if (fcntl(fd, F_SETLK, &lock) < 0)
            {
                switch (errno)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.314/storage/Utils/XmlFile.cc 
new/libstorage-ng-4.5.316/storage/Utils/XmlFile.cc
--- old/libstorage-ng-4.5.314/storage/Utils/XmlFile.cc  2026-04-21 
12:57:35.000000000 +0200
+++ new/libstorage-ng-4.5.316/storage/Utils/XmlFile.cc  2026-05-13 
18:49:39.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2010-2014] Novell, Inc.
- * Copyright (c) 2019 SUSE LLC
+ * Copyright (c) [2019-2026] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -21,7 +21,7 @@
  */
 
 
-#include <string.h>
+#include <cstring>
 #include <libxml/parser.h>
 
 #include "storage/Utils/XmlFile.h"
@@ -121,8 +121,7 @@
            if (cur_node->type == XML_ELEMENT_NODE &&
                strcmp(name, (const char*) cur_node->name) == 0)
            {
-               if (cur_node->children)
-                   ret.push_back(cur_node->children);
+               ret.push_back(cur_node->children);
            }
        }
 
@@ -139,8 +138,7 @@
        {
            if (cur_node->type == XML_ELEMENT_NODE)
            {
-               if (cur_node->children)
-                   ret.push_back(cur_node->children);
+               ret.push_back(cur_node->children);
            }
        }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.314/storage/Utils/XmlFile.h 
new/libstorage-ng-4.5.316/storage/Utils/XmlFile.h
--- old/libstorage-ng-4.5.314/storage/Utils/XmlFile.h   2026-04-21 
12:57:35.000000000 +0200
+++ new/libstorage-ng-4.5.316/storage/Utils/XmlFile.h   2026-05-13 
18:49:39.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2010-2014] Novell, Inc.
- * Copyright (c) [2019-2021] SUSE LLC
+ * Copyright (c) [2019-2026] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -106,7 +106,12 @@
        vector<const xmlNode*> children = getChildNodes(node, name);
 
        for (const xmlNode*& child : children)
-           values.push_back((const char*) child->content);
+       {
+           if (child && child->content)
+               values.push_back((const char*) child->content);
+           else
+               values.push_back(Type {});
+       }
 
        return !children.empty();
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.314/testsuite/SystemInfo/dmsetup-info.cc 
new/libstorage-ng-4.5.316/testsuite/SystemInfo/dmsetup-info.cc
--- old/libstorage-ng-4.5.314/testsuite/SystemInfo/dmsetup-info.cc      
2026-04-21 12:57:35.000000000 +0200
+++ new/libstorage-ng-4.5.316/testsuite/SystemInfo/dmsetup-info.cc      
2026-05-13 18:49:39.000000000 +0200
@@ -22,11 +22,11 @@
     Mockup::set_command(DMSETUP_BIN " --columns --separator / --noheadings -o 
name,major,minor,"
                        "segments,subsystem,uuid info", input);
 
-    CmdDmsetupInfo cmddmsetupinfo;
+    CmdDmsetupInfo cmd_dmsetup_info;
 
     ostringstream parsed;
     parsed.setf(std::ios::boolalpha);
-    parsed << cmddmsetupinfo;
+    parsed << cmd_dmsetup_info;
 
     string lhs = parsed.str();
     string rhs = boost::join(output, "\n") + "\n";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.314/testsuite/SystemInfo/dmsetup-table.cc 
new/libstorage-ng-4.5.316/testsuite/SystemInfo/dmsetup-table.cc
--- old/libstorage-ng-4.5.314/testsuite/SystemInfo/dmsetup-table.cc     
2026-04-21 12:57:35.000000000 +0200
+++ new/libstorage-ng-4.5.316/testsuite/SystemInfo/dmsetup-table.cc     
2026-05-13 18:49:39.000000000 +0200
@@ -21,11 +21,11 @@
     Mockup::set_mode(Mockup::Mode::PLAYBACK);
     Mockup::set_command(DMSETUP_BIN " table", input);
 
-    CmdDmsetupTable cmddmsetuptable;
+    CmdDmsetupTable cmd_dmsetup_table;
 
     ostringstream parsed;
     parsed.setf(std::ios::boolalpha);
-    parsed << cmddmsetuptable;
+    parsed << cmd_dmsetup_table;
 
     string lhs = parsed.str();
     string rhs = output.empty() ? "" : boost::join(output, "\n") + "\n";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libstorage-ng-4.5.314/testsuite/SystemInfo/proc-mdstat.cc 
new/libstorage-ng-4.5.316/testsuite/SystemInfo/proc-mdstat.cc
--- old/libstorage-ng-4.5.314/testsuite/SystemInfo/proc-mdstat.cc       
2026-04-21 12:57:35.000000000 +0200
+++ new/libstorage-ng-4.5.316/testsuite/SystemInfo/proc-mdstat.cc       
2026-05-13 18:49:39.000000000 +0200
@@ -2,6 +2,7 @@
 #define BOOST_TEST_DYN_LINK
 #define BOOST_TEST_MODULE libstorage
 
+#include <numeric>
 #include <boost/test/unit_test.hpp>
 #include <boost/algorithm/string.hpp>
 
@@ -19,14 +20,15 @@
     Mockup::set_mode(Mockup::Mode::PLAYBACK);
     Mockup::set_file("/proc/mdstat", input);
 
-    ProcMdstat procmdstat;
+    ProcMdstat proc_mdstat;
 
     ostringstream parsed;
     parsed.setf(std::ios::boolalpha);
-    parsed << procmdstat;
+    parsed << proc_mdstat;
 
     string lhs = parsed.str();
-    string rhs = boost::join(output, "\n") + "\n";
+    string rhs = accumulate(output.begin(), output.end(), ""s,
+                           [](auto a, auto b) { return a + b + "\n"; });
 
     BOOST_CHECK_EQUAL(lhs, rhs);
 }
@@ -127,7 +129,7 @@
     vector<string> input = {
        "Personalities : [raid1] [raid0] ",
        "md_test : active raid0 sda1[1] sdb1[0]",
-       "      8000512 blocks super 1.2 512k chunks"
+       "      8000512 blocks super 1.2 512k chunks",
        "      ",
        "unused devices: <none>"
     };
@@ -197,4 +199,30 @@
     };
 
     check(input, output);
+}
+
+
+BOOST_AUTO_TEST_CASE(parse_empty1)
+{
+    vector<string> input = {
+    };
+
+    vector<string> output = {
+    };
+
+    check(input, output);
+}
+
+
+BOOST_AUTO_TEST_CASE(parse_empty2)
+{
+    vector<string> input = {
+       "Personalities : [raid0] ",
+       "unused devices: <none>"
+    };
+
+    vector<string> output = {
+    };
+
+    check(input, output);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.314/testsuite/Utils/Makefile.am 
new/libstorage-ng-4.5.316/testsuite/Utils/Makefile.am
--- old/libstorage-ng-4.5.314/testsuite/Utils/Makefile.am       2026-04-21 
12:57:35.000000000 +0200
+++ new/libstorage-ng-4.5.316/testsuite/Utils/Makefile.am       2026-05-13 
18:49:39.000000000 +0200
@@ -10,7 +10,7 @@
        exception.test topology.test alignment.test math.test systemcmd.test    
\
        dirname.test basename.test algorithm.test format.test join.test         
\
        regex.test sort-by.test jsonfile.test rootprefix.test                   
\
-       udev-filters.test dm-encoding.test
+       udev-filters.test dm-encoding.test xml.test
 
 AM_DEFAULT_SOURCE_EXT = .cc
 
@@ -18,3 +18,4 @@
 
 AM_TESTS_ENVIRONMENT = BOOST_TEST_CATCH_SYSTEM_ERRORS=no
 
+EXTRA_DIST = xml.xml
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.314/testsuite/Utils/xml.cc 
new/libstorage-ng-4.5.316/testsuite/Utils/xml.cc
--- old/libstorage-ng-4.5.314/testsuite/Utils/xml.cc    1970-01-01 
01:00:00.000000000 +0100
+++ new/libstorage-ng-4.5.316/testsuite/Utils/xml.cc    2026-05-13 
18:49:39.000000000 +0200
@@ -0,0 +1,34 @@
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_MODULE libstorage
+
+#include <boost/test/unit_test.hpp>
+
+#include "storage/Utils/XmlFile.h"
+
+
+using namespace storage;
+
+
+BOOST_AUTO_TEST_CASE(load1)
+{
+    XmlFile xml("xml.xml");
+
+    const xmlNode* root_node = xml.getRootElement();
+    BOOST_CHECK(root_node);
+
+    const xmlNode* a_node = getChildNode(root_node, "a");
+    BOOST_CHECK(a_node);
+
+    BOOST_CHECK_EQUAL(getChildNodes(a_node).size(), 5);
+    BOOST_CHECK_EQUAL(getChildNodes(a_node, "b").size(), 4);
+    BOOST_CHECK_EQUAL(getChildNodes(a_node, "c").size(), 1);
+
+    vector<string> bs;
+    getChildValue(a_node, "b", bs);
+    BOOST_CHECK_EQUAL(bs.size(), 4);
+    BOOST_CHECK_EQUAL(bs[0], "one");
+    BOOST_CHECK_EQUAL(bs[1], "");
+    BOOST_CHECK_EQUAL(bs[2], "two");
+    BOOST_CHECK_EQUAL(bs[3], "");
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.314/testsuite/Utils/xml.xml 
new/libstorage-ng-4.5.316/testsuite/Utils/xml.xml
--- old/libstorage-ng-4.5.314/testsuite/Utils/xml.xml   1970-01-01 
01:00:00.000000000 +0100
+++ new/libstorage-ng-4.5.316/testsuite/Utils/xml.xml   2026-05-13 
18:49:39.000000000 +0200
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<a>
+  <b>one</b>
+  <b></b>
+  <b>two</b>
+  <b></b>
+  <c>three</c>
+</a>

Reply via email to