Hello community,

here is the log from the commit of package yast2-pam for openSUSE:Factory 
checked in at 2019-04-25 16:20:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-pam (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-pam.new.5536 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-pam"

Thu Apr 25 16:20:02 2019 rev:37 rq:695483 version:4.2.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-pam/yast2-pam.changes      2019-02-28 
21:47:51.737410851 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-pam.new.5536/yast2-pam.changes    
2019-04-25 16:20:03.174080723 +0200
@@ -1,0 +2,15 @@
+Wed Apr 17 18:44:23 UTC 2019 - Ladislav Slezak <[email protected]>
+
+- Skip loading the package manager in the test mode, fixes
+  broken unit tests in yast2-users and yast2-nis-client
+  (related to the previous fix bsc#1128385)
+- 4.2.1
+
+-------------------------------------------------------------------
+Tue Apr 16 12:39:31 UTC 2019 - Stefan Hundhammer <[email protected]>
+
+- Offer autologin only if a display manager that supports it is
+  installed (bsc#1128385) 
+- 4.2.0
+
+-------------------------------------------------------------------

Old:
----
  yast2-pam-4.1.0.tar.bz2

New:
----
  yast2-pam-4.2.1.tar.bz2

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

Other differences:
------------------
++++++ yast2-pam.spec ++++++
--- /var/tmp/diff_new_pack.b8oKRC/_old  2019-04-25 16:20:03.642080640 +0200
+++ /var/tmp/diff_new_pack.b8oKRC/_new  2019-04-25 16:20:03.642080640 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-pam
-Version:        4.1.0
+Version:        4.2.1
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-pam-4.1.0.tar.bz2 -> yast2-pam-4.2.1.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-pam-4.1.0/Dockerfile 
new/yast2-pam-4.2.1/Dockerfile
--- old/yast2-pam-4.1.0/Dockerfile      2019-02-27 15:43:12.000000000 +0100
+++ new/yast2-pam-4.2.1/Dockerfile      2019-04-18 10:44:16.000000000 +0200
@@ -1,3 +1,3 @@
-FROM yastdevel/ruby
+FROM registry.opensuse.org/yast/head/containers/yast-ruby:latest
 COPY . /usr/src/app
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-pam-4.1.0/package/yast2-pam.changes 
new/yast2-pam-4.2.1/package/yast2-pam.changes
--- old/yast2-pam-4.1.0/package/yast2-pam.changes       2019-02-27 
15:43:12.000000000 +0100
+++ new/yast2-pam-4.2.1/package/yast2-pam.changes       2019-04-18 
10:44:16.000000000 +0200
@@ -1,4 +1,19 @@
 -------------------------------------------------------------------
+Wed Apr 17 18:44:23 UTC 2019 - Ladislav Slezak <[email protected]>
+
+- Skip loading the package manager in the test mode, fixes
+  broken unit tests in yast2-users and yast2-nis-client
+  (related to the previous fix bsc#1128385)
+- 4.2.1
+
+-------------------------------------------------------------------
+Tue Apr 16 12:39:31 UTC 2019 - Stefan Hundhammer <[email protected]>
+
+- Offer autologin only if a display manager that supports it is
+  installed (bsc#1128385) 
+- 4.2.0
+
+-------------------------------------------------------------------
 Tue Feb 26 12:05:42 UTC 2019 - José Iván López González <[email protected]>
 
 - Version bump (bsc#1124009)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-pam-4.1.0/package/yast2-pam.spec 
new/yast2-pam-4.2.1/package/yast2-pam.spec
--- old/yast2-pam-4.1.0/package/yast2-pam.spec  2019-02-27 15:43:12.000000000 
+0100
+++ new/yast2-pam-4.2.1/package/yast2-pam.spec  2019-04-18 10:44:16.000000000 
+0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-pam
-Version:        4.1.0
+Version:        4.2.1
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-pam-4.1.0/src/modules/Autologin.rb 
new/yast2-pam-4.2.1/src/modules/Autologin.rb
--- old/yast2-pam-4.1.0/src/modules/Autologin.rb        2019-02-27 
15:43:12.000000000 +0100
+++ new/yast2-pam-4.2.1/src/modules/Autologin.rb        2019-04-18 
10:44:16.000000000 +0200
@@ -30,11 +30,23 @@
 
 module Yast
   class AutologinClass < Module
+    include Yast::Logger
+
+    # Display managers that support autologin.
+    # Notice that xdm does NOT support it!
+    #
+    # "autologin-support" is a pseudo-"provides" that maintainers of display
+    # manager packages can add to indicate that the package has that
+    # capability.
+    DISPLAY_MANAGERS = ["autologin-support", "kdm", "gdm", "sddm", 
"lightdm"].freeze
+
     def main
       textdomain "pam"
 
       Yast.import "Package"
       Yast.import "Popup"
+      Yast.import "Pkg"
+      Yast.import "PackageCallbacks"
 
       # User to log in automaticaly
       @user = ""
@@ -43,15 +55,18 @@
       @pw_less = false
 
       # Is autologin feature available?
-      @available = true
+      @available = supported?
 
-      # Is autogion used? Usualy true when user is not empty, but for the first
+      # Is autologin used? Usualy true when user is not empty, but for the 
first
       # time (during installation), this can be true by default although user 
is ""
       # (depends on the control file)
       @used = false
 
       # Autologin settings modified?
       @modified = false
+
+      # Pkg stuff initialized?
+      @pkg_initialized = false
     end
 
     # Read autologin settings
@@ -64,7 +79,7 @@
         return false
       end
 
-      @available = true
+      @available = supported?
       @user = Convert.to_string(
         SCR.Read(path(".sysconfig.displaymanager.DISPLAYMANAGER_AUTOLOGIN"))
       )
@@ -156,6 +171,41 @@
       @used
     end
 
+    # Check if autologin is supported with the currently selected or installed
+    # packages.
+    #
+    # @return Boolean
+    def supported?
+      pkg_lazy_init
+      supported = DISPLAY_MANAGERS.any? { |dm| Pkg.IsSelected(dm) || 
Pkg.IsProvided(dm) }
+
+      if supported
+        log.info("Autologin is supported")
+      else
+        log.info("Autologin is not supported: No package provides any of 
#{DISPLAY_MANAGERS}")
+      end
+
+      supported
+    end
+
+    # Initialize the pkg subsystem
+    def pkg_lazy_init
+      return if @pkg_initialized
+
+      # We don't strictly need any package callbacks here, but libzypp might
+      # report an error, and then there would be no user feedback.
+      PackageCallbacks.InitPackageCallbacks
+      # FIXME: Mode.test workaround for the old testsuite to not break the 
other modules
+      Pkg.TargetInitialize("/") unless Mode.test
+
+      # Add the installed system to the libzypp pool
+      # FIXME: Mode.test workaround for the old testsuite to not break the 
other modules
+      Pkg.TargetLoad unless Mode.test
+
+      @pkg_initialized = true
+    end
+
+
     publish :variable => :user, :type => "string"
     publish :variable => :pw_less, :type => "boolean"
     publish :variable => :available, :type => "boolean"
@@ -165,6 +215,7 @@
     publish :function => :Write, :type => "boolean (boolean)"
     publish :function => :Disable, :type => "void ()"
     publish :function => :Use, :type => "void (boolean)"
+    publish :function => :supported?, :type => "boolean ()"
     publish :function => :DisableAndWrite, :type => "boolean (boolean)"
     publish :function => :AskForDisabling, :type => "boolean (string)"
   end


Reply via email to