Hello community,

here is the log from the commit of package yast2-registration for 
openSUSE:Factory checked in at 2019-01-26 22:21:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-registration (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-registration.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-registration"

Sat Jan 26 22:21:44 2019 rev:29 rq:668619 version:4.1.15

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-registration/yast2-registration.changes    
2019-01-24 14:00:47.096231426 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-registration.new.28833/yast2-registration.changes
 2019-01-26 22:21:46.682886630 +0100
@@ -1,0 +2,7 @@
+Fri Jan 25 10:52:15 CET 2019 - sch...@suse.de
+
+- Do not try to remove services which have already been deleted.
+  (bsc#1110246)
+- 4.1.15
+
+-------------------------------------------------------------------

Old:
----
  yast2-registration-4.1.14.tar.bz2

New:
----
  yast2-registration-4.1.15.tar.bz2

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

Other differences:
------------------
++++++ yast2-registration.spec ++++++
--- /var/tmp/diff_new_pack.GvOn7w/_old  2019-01-26 22:21:47.070886317 +0100
+++ /var/tmp/diff_new_pack.GvOn7w/_new  2019-01-26 22:21:47.074886313 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-registration
-Version:        4.1.14
+Version:        4.1.15
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-registration-4.1.14.tar.bz2 -> yast2-registration-4.1.15.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.1.14/package/yast2-registration.changes 
new/yast2-registration-4.1.15/package/yast2-registration.changes
--- old/yast2-registration-4.1.14/package/yast2-registration.changes    
2019-01-17 17:36:46.000000000 +0100
+++ new/yast2-registration-4.1.15/package/yast2-registration.changes    
2019-01-25 12:49:46.000000000 +0100
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Fri Jan 25 10:52:15 CET 2019 - sch...@suse.de
+
+- Do not try to remove services which have already been deleted.
+  (bsc#1110246)
+- 4.1.15
+
+-------------------------------------------------------------------
 Thu Jan 17 15:08:40 UTC 2019 - lsle...@suse.cz
 
 - Save the current repository configuration so it is properly
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.1.14/package/yast2-registration.spec 
new/yast2-registration-4.1.15/package/yast2-registration.spec
--- old/yast2-registration-4.1.14/package/yast2-registration.spec       
2019-01-17 17:36:46.000000000 +0100
+++ new/yast2-registration-4.1.15/package/yast2-registration.spec       
2019-01-25 12:49:46.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-registration
-Version:        4.1.14
+Version:        4.1.15
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-registration-4.1.14/src/clients/scc_auto.rb 
new/yast2-registration-4.1.15/src/clients/scc_auto.rb
--- old/yast2-registration-4.1.14/src/clients/scc_auto.rb       2019-01-17 
17:36:46.000000000 +0100
+++ new/yast2-registration-4.1.15/src/clients/scc_auto.rb       2019-01-25 
12:49:46.000000000 +0100
@@ -217,7 +217,8 @@
       # we cannot use pkg-bindings here because loading services would trigger
       # service and repository refresh which we want to avoid (it might easily 
fail)
       old = Dir[File.join(Installation.destdir, "/etc/zypp/repos.d/*")] +
-        Dir[File.join(Installation.destdir, "/etc/zypp/services.d/*")]
+        Dir[File.join(Installation.destdir, "/etc/zypp/services.d/*")] +
+        Dir[File.join(Installation.destdir, "/var/cache/zypp/*")]
 
       log.info "Removing #{old}"
       ::FileUtils.rm_rf(old)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.1.14/src/lib/registration/registration.rb 
new/yast2-registration-4.1.15/src/lib/registration/registration.rb
--- old/yast2-registration-4.1.14/src/lib/registration/registration.rb  
2019-01-17 17:36:46.000000000 +0100
+++ new/yast2-registration-4.1.15/src/lib/registration/registration.rb  
2019-01-25 12:49:46.000000000 +0100
@@ -262,8 +262,12 @@
       old_service = product_service.obsoleted_service_name
       # sanity check
       if old_service && !old_service.empty? && old_service != 
product_service.name
-        log.info "Found obsoleted service: #{old_service}"
-        ::Registration::SwMgmt.remove_service(old_service)
+        # old_service comes from SCC. So it could be that we have already 
removed
+        # this service from the system meanwhile --> checking first.
+        if ::Registration::SwMgmt.service_installed?(old_service)
+          log.info "Found obsoleted service: #{old_service}"
+          ::Registration::SwMgmt.remove_service(old_service)
+        end
       end
 
       # read the global credentials
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.1.14/src/lib/registration/sw_mgmt.rb 
new/yast2-registration-4.1.15/src/lib/registration/sw_mgmt.rb
--- old/yast2-registration-4.1.14/src/lib/registration/sw_mgmt.rb       
2019-01-17 17:36:46.000000000 +0100
+++ new/yast2-registration-4.1.15/src/lib/registration/sw_mgmt.rb       
2019-01-25 12:49:46.000000000 +0100
@@ -387,6 +387,14 @@
       end
     end
 
+    # Check if a libzypp service is installed
+    # @param [String] name name of the service
+    def self.service_installed?(name)
+      ret = Pkg.ServiceAliases.include?(name)
+      log.info "Service #{name} is installed: #{ret}"
+      ret
+    end
+
     # get list of repositories belonging to registered services
     # @param product_service [SUSE::Connect::Remote::Service] added service
     # @param only_updates [Boolean] return only update repositories
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-registration-4.1.14/test/sw_mgmt_spec.rb 
new/yast2-registration-4.1.15/test/sw_mgmt_spec.rb
--- old/yast2-registration-4.1.14/test/sw_mgmt_spec.rb  2019-01-17 
17:36:46.000000000 +0100
+++ new/yast2-registration-4.1.15/test/sw_mgmt_spec.rb  2019-01-25 
12:49:46.000000000 +0100
@@ -499,6 +499,22 @@
     end
   end
 
+  describe ".service_installed?" do
+    let(:service) { "service" }
+
+    it "returns true if the service is installed" do
+      expect(Yast::Pkg).to receive(:ServiceAliases).and_return(["service"])
+
+      expect(subject.service_installed?(service)).to eq true
+    end
+
+    it "returns false if the service is not installed" do
+      expect(Yast::Pkg).to 
receive(:ServiceAliases).and_return(["wrong_service"])
+
+      expect(subject.service_installed?(service)).to eq false
+    end
+  end
+
   describe ".set_repos_state" do
     it "sets the repository state and stores the original state" do
       repos = [{ "SrcId" => 42, "enabled" => true }]


Reply via email to