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 2021-05-23 23:30:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old) and /work/SRC/openSUSE:Factory/.libstorage-ng.new.2988 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libstorage-ng" Sun May 23 23:30:41 2021 rev:116 rq:894829 version:4.4.9 Changes: -------- --- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes 2021-05-20 19:24:36.294054572 +0200 +++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.2988/libstorage-ng.changes 2021-05-23 23:30:47.676690010 +0200 @@ -1,0 +2,7 @@ +Fri May 21 14:52:25 UTC 2021 - aschn...@suse.com + +- merge gh#openSUSE/libstorage-ng#807 +- remove double mount options (see bsc#1186298) +- 4.4.9 + +-------------------------------------------------------------------- Old: ---- libstorage-ng-4.4.8.tar.xz New: ---- libstorage-ng-4.4.9.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libstorage-ng.spec ++++++ --- /var/tmp/diff_new_pack.tSOHwW/_old 2021-05-23 23:30:48.152688036 +0200 +++ /var/tmp/diff_new_pack.tSOHwW/_new 2021-05-23 23:30:48.156688019 +0200 @@ -18,7 +18,7 @@ %define libname %{name}1 Name: libstorage-ng -Version: 4.4.8 +Version: 4.4.9 Release: 0 Summary: Library for storage management License: GPL-2.0-only ++++++ libstorage-ng-4.4.8.tar.xz -> libstorage-ng-4.4.9.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.8/LIBVERSION new/libstorage-ng-4.4.9/LIBVERSION --- old/libstorage-ng-4.4.8/LIBVERSION 2021-05-18 06:59:51.000000000 +0200 +++ new/libstorage-ng-4.4.9/LIBVERSION 2021-05-21 16:52:25.000000000 +0200 @@ -1 +1 @@ -1.53.0 +1.53.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.8/VERSION new/libstorage-ng-4.4.9/VERSION --- old/libstorage-ng-4.4.8/VERSION 2021-05-18 06:59:51.000000000 +0200 +++ new/libstorage-ng-4.4.9/VERSION 2021-05-21 16:52:25.000000000 +0200 @@ -1 +1 @@ -4.4.8 +4.4.9 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.8/storage/EtcFstab.cc new/libstorage-ng-4.4.9/storage/EtcFstab.cc --- old/libstorage-ng-4.4.8/storage/EtcFstab.cc 2021-05-18 06:59:51.000000000 +0200 +++ new/libstorage-ng-4.4.9/storage/EtcFstab.cc 2021-05-21 16:52:25.000000000 +0200 @@ -1,6 +1,6 @@ /* * Copyright (c) [2004-2015] Novell, Inc. - * Copyright (c) [2017-2020] SUSE LLC + * Copyright (c) [2017-2021] SUSE LLC * * All Rights Reserved. * @@ -52,8 +52,7 @@ MountOpts::MountOpts(const vector<string> & opts) : opts(opts) { - while (contains("defaults")) - remove("defaults"); + remove("defaults"); } @@ -138,10 +137,7 @@ void MountOpts::remove( const string & opt ) { - int index = get_index_of( opt ); - - if ( index != -1 ) - remove( index ); + opts.erase(std::remove(opts.begin(), opts.end(), opt), opts.end()); } @@ -178,8 +174,7 @@ boost::is_any_of( "," ), boost::token_compress_on ); - while ( contains( "defaults" ) ) - remove( "defaults" ); + remove("defaults"); return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libstorage-ng-4.4.8/testsuite/mount-opts.cc new/libstorage-ng-4.4.9/testsuite/mount-opts.cc --- old/libstorage-ng-4.4.8/testsuite/mount-opts.cc 2021-05-18 06:59:51.000000000 +0200 +++ new/libstorage-ng-4.4.9/testsuite/mount-opts.cc 2021-05-21 16:52:25.000000000 +0200 @@ -2,12 +2,14 @@ #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE libstorage -#include <boost/test/unit_test.hpp> #include <iostream> +#include <boost/algorithm/string.hpp> +#include <boost/test/unit_test.hpp> #include "storage/EtcFstab.h" #include "storage/Filesystems/FilesystemImpl.h" + using namespace std; using namespace storage; @@ -64,3 +66,40 @@ BOOST_CHECK(mount_opts.has_subvol(262, "home")); BOOST_CHECK(!mount_opts.has_subvol(262, "does-not-exist")); } + + +BOOST_AUTO_TEST_CASE(test_ctor) +{ + BOOST_CHECK(MountOpts("").empty()); + BOOST_CHECK(MountOpts(vector<string>({})).empty()); + + BOOST_CHECK(MountOpts("defaults").empty()); + BOOST_CHECK(MountOpts(vector<string>({ "defaults" })).empty()); + + BOOST_CHECK_EQUAL(boost::join(MountOpts("noauto,user").get_opts(), ","), "noauto,user"); + BOOST_CHECK_EQUAL(boost::join(MountOpts(vector<string>({ "noauto", "user" })).get_opts(), ","), "noauto,user"); +} + + +BOOST_AUTO_TEST_CASE(test_remove) +{ + MountOpts mount_opts("ro,noauto,ro"); + + mount_opts.remove("ro"); + BOOST_CHECK_EQUAL(boost::join(mount_opts.get_opts(), ","), "noauto"); + + mount_opts.remove("noauto"); + BOOST_CHECK_EQUAL(boost::join(mount_opts.get_opts(), ","), ""); +} + + +BOOST_AUTO_TEST_CASE(test_append) +{ + MountOpts mount_opts("ro"); + + mount_opts.append("noauto"); + BOOST_CHECK_EQUAL(boost::join(mount_opts.get_opts(), ","), "ro,noauto"); + + mount_opts << "ro"; + BOOST_CHECK_EQUAL(boost::join(mount_opts.get_opts(), ","), "ro,noauto,ro"); +}