Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yast2-firstboot for openSUSE:Factory 
checked in at 2021-11-15 15:24:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-firstboot (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-firstboot.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-firstboot"

Mon Nov 15 15:24:55 2021 rev:109 rq:931496 version:4.4.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-firstboot/yast2-firstboot.changes  
2021-09-26 21:48:57.670797412 +0200
+++ 
/work/SRC/openSUSE:Factory/.yast2-firstboot.new.1890/yast2-firstboot.changes    
    2021-11-15 15:26:03.073817631 +0100
@@ -1,0 +2,6 @@
+Wed Sep 29 12:43:04 UTC 2021 - Jos?? Iv??n L??pez Gonz??lez <jlo...@suse.com>
+
+- Adap clients to changes in Y2Users API (related to jsc#SLE-20592)
+- 4.4.6
+
+-------------------------------------------------------------------

Old:
----
  yast2-firstboot-4.4.5.tar.bz2

New:
----
  yast2-firstboot-4.4.6.tar.bz2

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

Other differences:
------------------
++++++ yast2-firstboot.spec ++++++
--- /var/tmp/diff_new_pack.C7YyWY/_old  2021-11-15 15:26:03.745817819 +0100
+++ /var/tmp/diff_new_pack.C7YyWY/_new  2021-11-15 15:26:03.749817821 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-firstboot
-Version:        4.4.5
+Version:        4.4.6
 Release:        0
 Summary:        YaST2 - Initial System Configuration
 License:        GPL-2.0-only

++++++ yast2-firstboot-4.4.5.tar.bz2 -> yast2-firstboot-4.4.6.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-firstboot-4.4.5/.github/workflows/ci.yml 
new/yast2-firstboot-4.4.6/.github/workflows/ci.yml
--- old/yast2-firstboot-4.4.5/.github/workflows/ci.yml  2021-09-22 
16:52:42.000000000 +0200
+++ new/yast2-firstboot-4.4.6/.github/workflows/ci.yml  2021-11-15 
10:07:10.000000000 +0100
@@ -8,7 +8,8 @@
 jobs:
   Tests:
     runs-on: ubuntu-latest
-    container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+    container:
+      image: registry.opensuse.org/yast/head/containers/yast-ruby:latest
 
     steps:
 
@@ -36,7 +37,8 @@
 
   Rubocop:
     runs-on: ubuntu-latest
-    container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+    container:
+      image: registry.opensuse.org/yast/head/containers/yast-ruby:latest
 
     steps:
 
@@ -48,7 +50,8 @@
 
   Package:
     runs-on: ubuntu-latest
-    container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+    container:
+      image: registry.opensuse.org/yast/head/containers/yast-ruby:latest
 
     steps:
 
@@ -67,7 +70,8 @@
 
   Yardoc:
     runs-on: ubuntu-latest
-    container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+    container:
+      image: registry.opensuse.org/yast/head/containers/yast-ruby:latest
 
     steps:
 
@@ -81,7 +85,8 @@
   # checks into one job avoids that overhead
   Checks:
     runs-on: ubuntu-latest
-    container: registry.opensuse.org/yast/head/containers/yast-ruby:latest
+    container:
+      image: registry.opensuse.org/yast/head/containers/yast-ruby:latest
 
     steps:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-firstboot-4.4.5/package/yast2-firstboot.changes 
new/yast2-firstboot-4.4.6/package/yast2-firstboot.changes
--- old/yast2-firstboot-4.4.5/package/yast2-firstboot.changes   2021-09-22 
16:52:42.000000000 +0200
+++ new/yast2-firstboot-4.4.6/package/yast2-firstboot.changes   2021-11-15 
10:07:10.000000000 +0100
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Wed Sep 29 12:43:04 UTC 2021 - Jos?? Iv??n L??pez Gonz??lez <jlo...@suse.com>
+
+- Adap clients to changes in Y2Users API (related to jsc#SLE-20592)
+- 4.4.6
+
+-------------------------------------------------------------------
 Tue Sep 22 14:07:55 UTC 2021 - Scott Bradnick <sbradn...@suse.com>
 
 - Adding check for WSL so that 'systemd start syslog.socket' isn't run
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-firstboot-4.4.5/package/yast2-firstboot.spec 
new/yast2-firstboot-4.4.6/package/yast2-firstboot.spec
--- old/yast2-firstboot-4.4.5/package/yast2-firstboot.spec      2021-09-22 
16:52:42.000000000 +0200
+++ new/yast2-firstboot-4.4.6/package/yast2-firstboot.spec      2021-11-15 
10:07:10.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-firstboot
-Version:        4.4.5
+Version:        4.4.6
 Release:        0
 Summary:        YaST2 - Initial System Configuration
 License:        GPL-2.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-firstboot-4.4.5/src/lib/y2firstboot/clients/user.rb 
new/yast2-firstboot-4.4.6/src/lib/y2firstboot/clients/user.rb
--- old/yast2-firstboot-4.4.5/src/lib/y2firstboot/clients/user.rb       
2021-09-22 16:52:42.000000000 +0200
+++ new/yast2-firstboot-4.4.6/src/lib/y2firstboot/clients/user.rb       
2021-11-15 10:07:10.000000000 +0100
@@ -21,6 +21,8 @@
 require "y2users/password"
 require "y2users/linux/writer"
 require "y2users/config_manager"
+require "y2users/commit_config_collection"
+require "y2users/commit_config"
 require "users/dialogs/inst_user_first"
 require "pathname"
 
@@ -63,7 +65,6 @@
         result = Yast::InstUserFirstDialog.new(config, user: user).run
 
         if result == :next
-          update_user
           write_config
           save_values
         end
@@ -73,22 +74,12 @@
 
     private
 
-      # Updates user values, if needed
-      #
-      # For example, the home directory is modified to keep it on sync with 
the user name.
-      def update_user
-        home_path = Pathname.new(user.home || "")
-
-        return if user.home.nil? || user.name == home_path.basename.to_s
-
-        user.home = home_path.dirname.join(user.name).to_s
-      end
-
       # Writes config to the system
       def write_config
         writer = Y2Users::Linux::Writer.new(
           config,
-          Y2Users::ConfigManager.instance.system
+          Y2Users::ConfigManager.instance.system,
+          commit_configs
         )
 
         writer.write
@@ -156,6 +147,36 @@
         @root_user ||= config.users.root
       end
 
+      # Builds the commit configs to use when writing users
+      #
+      # @return [Y2Users::CommitConfigCollection]
+      def commit_configs
+        Y2Users::CommitConfigCollection.new.tap do |collection|
+          # Configure the actions to perform when committing a user.
+          #
+          #   - If the user is being created, its home should content the skel 
files
+          #   (#home_without_skel).
+          #   - In case of editing a user and its home path has changed (i.e., 
because the user
+          #   name was modified), then the current home content should be 
moved to the new path
+          #   (#move_home option). Additionally, if the new home path already 
exists, then the user
+          #   should be set as owner of the existing directory 
(#adapt_home_ownership option).
+          #   - When deleting the user (i.e., when going back to skip the user 
creation after
+          #   creating it), its home must be removed too (#remove_home).
+          commit_config = Y2Users::CommitConfig.new.tap do |config|
+            config.username = user.name
+            config.home_without_skel = false
+            config.move_home = true
+            config.adapt_home_ownership = true
+            # WARNING: this can lead to a undesired situation if using 
firstboot in an already
+            # initialized system with the user home previously created. 
However, this is quite
+            # unexpected scenario for this client and firstboot module in 
general.
+            config.remove_home = true
+          end
+
+          collection.add(commit_config)
+        end
+      end
+
       # A copy of config holding all the users on the system
       #
       # @return [Y2Users::Config]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-firstboot-4.4.5/test/y2firstboot/clients/user_test.rb 
new/yast2-firstboot-4.4.6/test/y2firstboot/clients/user_test.rb
--- old/yast2-firstboot-4.4.5/test/y2firstboot/clients/user_test.rb     
2021-09-22 16:52:42.000000000 +0200
+++ new/yast2-firstboot-4.4.6/test/y2firstboot/clients/user_test.rb     
2021-11-15 10:07:10.000000000 +0100
@@ -21,6 +21,8 @@
 
 require_relative "../../test_helper"
 require "y2firstboot/clients/user"
+require "y2users"
+require "y2users/linux/writer"
 
 describe Y2Firstboot::Clients::User do
   subject(:client) { described_class.new }
@@ -116,28 +118,25 @@
 
       before do
         described_class.username = "test"
-      end
-
-      context "if the user name does not match with the basename of the home 
directory" do
-        before do
-          user.home = "/home/test"
-        end
-
-        it "updates the home directory" do
-          expect(Yast::InstUserFirstDialog).to receive(:new) do |_, params|
-            user = params[:user]
-            user.name = "test2"
-          end.and_return(dialog)
-
-          subject.run
 
-          expect(user.home).to eq("/home/test2")
-        end
+        allow(writer).to receive(:write)
       end
 
+      let(:writer) { instance_double(Y2Users::Linux::Writer) }
+
       it "writes the config to the system" do
-        expect(Y2Users::Linux::Writer).to receive(:new)
-          .with(config, system_config).and_call_original
+        expect(Y2Users::Linux::Writer).to receive(:new) do |target, system, 
commit_configs|
+          expect(target).to eql(config)
+          expect(system).to eql(system_config)
+
+          commit_config = commit_configs.by_username(user.name)
+          expect(commit_config.move_home?).to eq(true)
+          expect(commit_config.remove_home?).to eq(true)
+          expect(commit_config.adapt_home_ownership?).to eq(true)
+          expect(commit_config.home_without_skel?).to eq(false)
+        end.and_return(writer)
+
+        expect(writer).to receive(:write)
 
         subject.run
       end
@@ -168,7 +167,7 @@
       end
 
       it "does not write the users configuration" do
-        expect(Y2Users::Linux::Writer).to_not receive(:new)
+        expect_any_instance_of(Y2Users::Linux::Writer).to_not receive(:write)
 
         subject.run
       end

Reply via email to