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-08-16 10:08:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-firstboot (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-firstboot.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-firstboot"

Mon Aug 16 10:08:28 2021 rev:107 rq:911854 version:4.4.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-firstboot/yast2-firstboot.changes  
2021-07-13 22:36:53.862388251 +0200
+++ 
/work/SRC/openSUSE:Factory/.yast2-firstboot.new.1899/yast2-firstboot.changes    
    2021-08-16 10:12:54.239005719 +0200
@@ -1,0 +2,7 @@
+Tue Aug 10 16:29:28 UTC 2021 - Jos?? Iv??n L??pez Gonz??lez <jlo...@suse.com>
+
+- Move the home directory when the user login is modified in the
+  client for creating a user (related to bsc#1188612).
+- 4.4.4
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-firstboot.spec ++++++
--- /var/tmp/diff_new_pack.gvCAF7/_old  2021-08-16 10:12:54.651005236 +0200
+++ /var/tmp/diff_new_pack.gvCAF7/_new  2021-08-16 10:12:54.651005236 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-firstboot
-Version:        4.4.3
+Version:        4.4.4
 Release:        0
 Summary:        YaST2 - Initial System Configuration
 License:        GPL-2.0-only

++++++ yast2-firstboot-4.4.3.tar.bz2 -> yast2-firstboot-4.4.4.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-firstboot-4.4.3/package/yast2-firstboot.changes 
new/yast2-firstboot-4.4.4/package/yast2-firstboot.changes
--- old/yast2-firstboot-4.4.3/package/yast2-firstboot.changes   2021-07-09 
15:37:09.000000000 +0200
+++ new/yast2-firstboot-4.4.4/package/yast2-firstboot.changes   2021-08-12 
18:05:55.000000000 +0200
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Tue Aug 10 16:29:28 UTC 2021 - Jos?? Iv??n L??pez Gonz??lez <jlo...@suse.com>
+
+- Move the home directory when the user login is modified in the
+  client for creating a user (related to bsc#1188612).
+- 4.4.4
+
+-------------------------------------------------------------------
 Fri Jul  9 11:59:31 UTC 2021 - Jos?? Iv??n L??pez Gonz??lez <jlo...@suse.com>
 
 - Remember plain passwords in order to provide a clean navigation
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-firstboot-4.4.3/package/yast2-firstboot.spec 
new/yast2-firstboot-4.4.4/package/yast2-firstboot.spec
--- old/yast2-firstboot-4.4.3/package/yast2-firstboot.spec      2021-07-09 
15:37:09.000000000 +0200
+++ new/yast2-firstboot-4.4.4/package/yast2-firstboot.spec      2021-08-12 
18:05:55.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-firstboot
-Version:        4.4.3
+Version:        4.4.4
 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.3/src/lib/y2firstboot/clients/user.rb 
new/yast2-firstboot-4.4.4/src/lib/y2firstboot/clients/user.rb
--- old/yast2-firstboot-4.4.3/src/lib/y2firstboot/clients/user.rb       
2021-07-09 15:37:09.000000000 +0200
+++ new/yast2-firstboot-4.4.4/src/lib/y2firstboot/clients/user.rb       
2021-08-12 18:05:55.000000000 +0200
@@ -22,6 +22,7 @@
 require "y2users/linux/writer"
 require "y2users/config_manager"
 require "users/dialogs/inst_user_first"
+require "pathname"
 
 module Y2Firstboot
   module Clients
@@ -62,6 +63,7 @@
         result = Yast::InstUserFirstDialog.new(config, user: user).run
 
         if result == :next
+          update_user
           write_config
           save_values
         end
@@ -71,6 +73,17 @@
 
     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(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-firstboot-4.4.3/test/y2firstboot/clients/user_test.rb 
new/yast2-firstboot-4.4.4/test/y2firstboot/clients/user_test.rb
--- old/yast2-firstboot-4.4.3/test/y2firstboot/clients/user_test.rb     
2021-07-09 15:37:09.000000000 +0200
+++ new/yast2-firstboot-4.4.4/test/y2firstboot/clients/user_test.rb     
2021-08-12 18:05:55.000000000 +0200
@@ -118,6 +118,23 @@
         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
+      end
+
       it "writes the config to the system" do
         expect(Y2Users::Linux::Writer).to receive(:new)
           .with(config, system_config).and_call_original

Reply via email to