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 2022-07-22 19:20:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libstorage-ng (Old)
 and      /work/SRC/openSUSE:Factory/.libstorage-ng.new.21925 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libstorage-ng"

Fri Jul 22 19:20:19 2022 rev:176 rq:990509 version:4.5.30

Changes:
--------
--- /work/SRC/openSUSE:Factory/libstorage-ng/libstorage-ng.changes      
2022-07-18 18:32:56.945673146 +0200
+++ /work/SRC/openSUSE:Factory/.libstorage-ng.new.21925/libstorage-ng.changes   
2022-07-22 19:20:21.176570609 +0200
@@ -1,0 +2,15 @@
+Thu Jul 21 08:04:51 UTC 2022 - aschn...@suse.com
+
+- merge gh#openSUSE/libstorage-ng#890
+- allow to set rootprefix via environment
+- 4.5.30
+
+--------------------------------------------------------------------
+Wed Jul 20 08:08:19 UTC 2022 - aschn...@suse.com
+
+- merge gh#openSUSE/libstorage-ng#889
+- allow to prepend path for lock file
+- coding style
+- 4.5.29
+
+--------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ libstorage-ng.spec ++++++
--- /var/tmp/diff_new_pack.Y75dbd/_old  2022-07-22 19:20:21.616571364 +0200
+++ /var/tmp/diff_new_pack.Y75dbd/_new  2022-07-22 19:20:21.620571371 +0200
@@ -18,7 +18,7 @@
 
 %define libname %{name}1
 Name:           libstorage-ng
-Version:        4.5.28
+Version:        4.5.30
 Release:        0
 Summary:        Library for storage management
 License:        GPL-2.0-only

++++++ libstorage-ng-4.5.28.tar.xz -> libstorage-ng-4.5.30.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.28/LIBVERSION 
new/libstorage-ng-4.5.30/LIBVERSION
--- old/libstorage-ng-4.5.28/LIBVERSION 2022-07-14 09:19:37.000000000 +0200
+++ new/libstorage-ng-4.5.30/LIBVERSION 2022-07-21 10:04:51.000000000 +0200
@@ -1 +1 @@
-1.79.0
+1.79.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.28/VERSION 
new/libstorage-ng-4.5.30/VERSION
--- old/libstorage-ng-4.5.28/VERSION    2022-07-14 09:19:37.000000000 +0200
+++ new/libstorage-ng-4.5.30/VERSION    2022-07-21 10:04:51.000000000 +0200
@@ -1 +1 @@
-4.5.28
+4.5.30
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.28/storage/EnvironmentImpl.cc 
new/libstorage-ng-4.5.30/storage/EnvironmentImpl.cc
--- old/libstorage-ng-4.5.28/storage/EnvironmentImpl.cc 2022-07-14 
09:19:37.000000000 +0200
+++ new/libstorage-ng-4.5.30/storage/EnvironmentImpl.cc 2022-07-21 
10:04:51.000000000 +0200
@@ -34,34 +34,13 @@
     Environment::Impl::Impl(bool read_only, ProbeMode probe_mode, TargetMode 
target_mode)
        : read_only(read_only), probe_mode(probe_mode), target_mode(target_mode)
     {
-    }
-
-
-    void
-    Environment::Impl::set_rootprefix(const string& rootprefix)
-    {
-       Impl::rootprefix = rootprefix;
-    }
-
-
-    void
-    Environment::Impl::set_devicegraph_filename(const string& 
devicegraph_filename)
-    {
-       Impl::devicegraph_filename = devicegraph_filename;
-    }
-
-
-    void
-    Environment::Impl::set_arch_filename(const string& arch_filename)
-    {
-       Impl::arch_filename = arch_filename;
-    }
-
-
-    void
-    Environment::Impl::set_mockup_filename(const string& mockup_filename)
-    {
-       Impl::mockup_filename = mockup_filename;
+       const char* p1 = getenv("LIBSTORAGE_ROOTPREFIX");
+       if (p1)
+           rootprefix = p1;
+
+       const char* p2 = getenv("LIBSTORAGE_LOCKFILE_ROOT");
+       if (p2)
+           lockfile_root = p2;
     }
 
 
@@ -88,10 +67,17 @@
     std::ostream&
     operator<<(std::ostream& out, const Environment::Impl& environment)
     {
-       return out << "read-only:" << environment.read_only << " probe-mode:"
-                  << toString(environment.probe_mode) << " target-mode:"
-                  << toString(environment.target_mode) << " rootprefix:"
-                  << environment.rootprefix;
+       out << "read-only:" << environment.read_only << " probe-mode:"
+           << toString(environment.probe_mode) << " target-mode:"
+           << toString(environment.target_mode);
+
+       if (!environment.rootprefix.empty())
+           out << " rootprefix:" << environment.rootprefix;
+
+       if (!environment.lockfile_root.empty())
+           out << " lockfile-root:" << environment.lockfile_root;
+
+       return out;
     }
 
 
@@ -170,6 +156,8 @@
            "LIBSTORAGE_PFSOEMS",
            "LIBSTORAGE_BTRFS_SNAPSHOT_RELATIONS",
            "LIBSTORAGE_DEVELOPER_MODE",
+           "LIBSTORAGE_ROOTPREFIX",
+           "LIBSTORAGE_LOCKFILE_ROOT",
        };
 
        for (const char* env_var : env_vars)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.28/storage/EnvironmentImpl.h 
new/libstorage-ng-4.5.30/storage/EnvironmentImpl.h
--- old/libstorage-ng-4.5.28/storage/EnvironmentImpl.h  2022-07-14 
09:19:37.000000000 +0200
+++ new/libstorage-ng-4.5.30/storage/EnvironmentImpl.h  2022-07-21 
10:04:51.000000000 +0200
@@ -47,16 +47,20 @@
        TargetMode get_target_mode() const { return target_mode; }
 
        const string& get_rootprefix() const { return rootprefix; }
-       void set_rootprefix(const string& rootprefix);
+       void set_rootprefix(const string& rootprefix) { Impl::rootprefix = 
rootprefix; }
+
+       const string& get_lockfile_root() const { return lockfile_root; }
+       void set_lockfile_root(const string& lock_dir_root) { 
Impl::lockfile_root = lockfile_root; }
 
        const string& get_devicegraph_filename() const { return 
devicegraph_filename; }
-       void set_devicegraph_filename(const string& devicegraph_filename);
+       void set_devicegraph_filename(const string& devicegraph_filename)
+           { Impl::devicegraph_filename = devicegraph_filename; }
 
        const string& get_arch_filename() const { return arch_filename; }
-       void set_arch_filename(const string& arch_filename);
+       void set_arch_filename(const string& arch_filename) { 
Impl::arch_filename = arch_filename; }
 
        const string& get_mockup_filename() const { return mockup_filename; }
-       void set_mockup_filename(const string& mockup_filename);
+       void set_mockup_filename(const string& mockup_filename) { 
Impl::mockup_filename = mockup_filename; }
 
        bool is_debug_credentials() const { return false; }
 
@@ -73,6 +77,7 @@
        const TargetMode target_mode;
 
        string rootprefix;
+       string lockfile_root;
        string devicegraph_filename;
        string arch_filename;
        string mockup_filename;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.28/storage/StorageImpl.cc 
new/libstorage-ng-4.5.30/storage/StorageImpl.cc
--- old/libstorage-ng-4.5.28/storage/StorageImpl.cc     2022-07-14 
09:19:37.000000000 +0200
+++ new/libstorage-ng-4.5.30/storage/StorageImpl.cc     2022-07-21 
10:04:51.000000000 +0200
@@ -51,7 +51,8 @@
 
     Storage::Impl::Impl(Storage& storage, const Environment& environment)
        : storage(storage), environment(environment), arch(false),
-         lock(environment.is_read_only(), 
!environment.get_impl().is_do_lock()),
+         lock(environment.is_read_only(), !environment.get_impl().is_do_lock(),
+              environment.get_impl().get_lockfile_root()),
          default_mount_by(MountByType::UUID), 
rootprefix(environment.get_rootprefix()),
          tmp_dir("libstorage-XXXXXX")
     {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.28/storage/Utils/LockImpl.cc 
new/libstorage-ng-4.5.30/storage/Utils/LockImpl.cc
--- old/libstorage-ng-4.5.28/storage/Utils/LockImpl.cc  2022-07-14 
09:19:37.000000000 +0200
+++ new/libstorage-ng-4.5.30/storage/Utils/LockImpl.cc  2022-07-21 
10:04:51.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2004-2009] Novell, Inc.
- * Copyright (c) 2018 SUSE LLC
+ * Copyright (c) [2018-2022] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -34,9 +34,7 @@
 #include "storage/Utils/LockImpl.h"
 #include "storage/Utils/ExceptionImpl.h"
 #include "storage/Utils/StorageTmpl.h"
-
-
-#define LOCK_DIR "/run/libstorage-ng"
+#include "storage/Utils/StorageDefines.h"
 
 
 namespace storage
@@ -48,7 +46,7 @@
     int Lock::fd = -1;
 
 
-    Lock::Lock(bool read_only, bool disable)
+    Lock::Lock(bool read_only, bool disable, const string& lockfile_root)
        : read_only(read_only), disabled(disable)
     {
        if (disabled)
@@ -61,12 +59,15 @@
            // If there are no locks within the same process try to take the
            // system-wide lock.
 
-           if (mkdir(LOCK_DIR, 0755) == -1 && errno != EEXIST)
+           string lockfile_dir = lockfile_root + LOCKFILE_DIR;
+           y2mil("lockfile-dir:" << lockfile_dir);
+
+           if (mkdir(lockfile_dir.c_str(), 0755) == -1 && errno != EEXIST)
            {
                y2err("creating directory for lock-file failed: " << 
stringerror(errno));
            }
 
-           fd = open(LOCK_DIR "/lock", (read_only ? O_RDONLY : O_WRONLY) | 
O_CREAT | O_CLOEXEC, 0600);
+           fd = open((lockfile_dir + "/lock").c_str(), (read_only ? O_RDONLY : 
O_WRONLY) | O_CREAT | O_CLOEXEC, 0600);
            if (fd < 0)
            {
                // Opening lock-file failed.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.28/storage/Utils/LockImpl.h 
new/libstorage-ng-4.5.30/storage/Utils/LockImpl.h
--- old/libstorage-ng-4.5.28/storage/Utils/LockImpl.h   2022-07-14 
09:19:37.000000000 +0200
+++ new/libstorage-ng-4.5.30/storage/Utils/LockImpl.h   2022-07-21 
10:04:51.000000000 +0200
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2004-2009] Novell, Inc.
- * Copyright (c) 2018 SUSE LLC
+ * Copyright (c) [2018-2022] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -52,7 +52,7 @@
 
     public:
 
-       Lock(bool read_only, bool disable = false);
+       Lock(bool read_only, bool disable = false, const string& lockfile_root 
= "");
 
        ~Lock() noexcept;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libstorage-ng-4.5.28/storage/Utils/StorageDefines.h 
new/libstorage-ng-4.5.30/storage/Utils/StorageDefines.h
--- old/libstorage-ng-4.5.28/storage/Utils/StorageDefines.h     2022-07-14 
09:19:37.000000000 +0200
+++ new/libstorage-ng-4.5.30/storage/Utils/StorageDefines.h     2022-07-21 
10:04:51.000000000 +0200
@@ -41,6 +41,8 @@
 
 #define EFIVARS_DIR SYSFS_DIR "/firmware/efi/efivars"
 
+#define LOCKFILE_DIR "/run/libstorage-ng"
+
 
 // files
 

Reply via email to