Hello community,

here is the log from the commit of package yast2-installation for 
openSUSE:Factory checked in at 2020-09-05 23:56:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-installation (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-installation.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-installation"

Sat Sep  5 23:56:45 2020 rev:454 rq:831235 version:4.3.16

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-installation/yast2-installation.changes    
2020-08-28 21:20:26.576297458 +0200
+++ 
/work/SRC/openSUSE:Factory/.yast2-installation.new.3399/yast2-installation.changes
  2020-09-05 23:57:00.467091755 +0200
@@ -1,0 +2,7 @@
+Tue Sep  1 14:58:31 UTC 2020 - Ladislav Slezák <[email protected]>
+
+- Self-update improvement: write the list of updated packages to
+  the /.packages.self_update file in the inst-sys (bsc#1175614)
+- 4.3.16
+
+-------------------------------------------------------------------

Old:
----
  yast2-installation-4.3.15.tar.bz2

New:
----
  yast2-installation-4.3.16.tar.bz2

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

Other differences:
------------------
++++++ yast2-installation.spec ++++++
--- /var/tmp/diff_new_pack.VTCM54/_old  2020-09-05 23:57:02.431092738 +0200
+++ /var/tmp/diff_new_pack.VTCM54/_new  2020-09-05 23:57:02.435092741 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package yast2-installation
 #
-# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,17 +12,17 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
 Name:           yast2-installation
-Version:        4.3.15
+Version:        4.3.16
 Release:        0
 Summary:        YaST2 - Installation Parts
 License:        GPL-2.0-only
 Group:          System/YaST
-Url:            https://github.com/yast/yast-installation
+URL:            https://github.com/yast/yast-installation
 
 Source0:        %{name}-%{version}.tar.bz2
 Source1:        YaST2-Second-Stage.service

++++++ yast2-installation-4.3.15.tar.bz2 -> yast2-installation-4.3.16.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.3.15/package/yast2-installation.changes 
new/yast2-installation-4.3.16/package/yast2-installation.changes
--- old/yast2-installation-4.3.15/package/yast2-installation.changes    
2020-08-24 11:47:06.000000000 +0200
+++ new/yast2-installation-4.3.16/package/yast2-installation.changes    
2020-09-01 17:29:21.000000000 +0200
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Tue Sep  1 14:58:31 UTC 2020 - Ladislav Slezák <[email protected]>
+
+- Self-update improvement: write the list of updated packages to
+  the /.packages.self_update file in the inst-sys (bsc#1175614)
+- 4.3.16
+
+-------------------------------------------------------------------
 Mon Aug 24 09:35:13 UTC 2020 - Steffen Winterfeldt <[email protected]>
 
 - save random pool to /var/lib/systemd/random-seed (bsc#1174964)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.3.15/package/yast2-installation.spec 
new/yast2-installation-4.3.16/package/yast2-installation.spec
--- old/yast2-installation-4.3.15/package/yast2-installation.spec       
2020-08-24 11:47:06.000000000 +0200
+++ new/yast2-installation-4.3.16/package/yast2-installation.spec       
2020-09-01 17:29:21.000000000 +0200
@@ -16,7 +16,7 @@
 #
 
 Name:           yast2-installation
-Version:        4.3.15
+Version:        4.3.16
 Release:        0
 Group:          System/YaST
 License:        GPL-2.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.3.15/src/lib/installation/update_repository.rb 
new/yast2-installation-4.3.16/src/lib/installation/update_repository.rb
--- old/yast2-installation-4.3.15/src/lib/installation/update_repository.rb     
2020-08-24 11:47:06.000000000 +0200
+++ new/yast2-installation-4.3.16/src/lib/installation/update_repository.rb     
2020-09-01 17:29:21.000000000 +0200
@@ -57,6 +57,8 @@
     ORIGINS = [:default, :user].freeze
     # Path to instsys.parts registry
     INSTSYS_PARTS_PATH = Pathname("/etc/instsys.parts")
+    # a file with list of applied packages
+    PACKAGE_INDEX = "/.packages.self_update".freeze
 
     # @return [URI] URI of the repository
     attr_reader :uri
@@ -236,6 +238,8 @@
         adddir(mountpoint)
         update_instsys_parts(path, mountpoint)
       end
+
+      write_package_index
     end
 
     # Clean-up
@@ -457,5 +461,21 @@
     def safe_uri
       @safe_uri ||= Yast::URL.HidePassword(uri.to_s)
     end
+
+    # Write the list of self-update packages into a file.
+    # The inst-sys contains the list of included packages in the /.packages.*
+    # files. After applying a self-update YaST writes the list of the updated
+    # packages to the /.packages.self_update file to keep the files in sync and
+    # to make debugging easier.
+    def write_package_index(file = PACKAGE_INDEX)
+      # use the same format as the installation-images, one package per line 
in this format:
+      #   package_name [version.arch]
+      # because we cannot evaluate the dependencies the dependency part is not 
written
+      File.open(file, "a") do |f|
+        packages.each do |p|
+          f.puts "#{p.name} [#{p.version}.#{p.arch}]"
+        end
+      end
+    end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.3.15/test/update_repository_test.rb 
new/yast2-installation-4.3.16/test/update_repository_test.rb
--- old/yast2-installation-4.3.15/test/update_repository_test.rb        
2020-08-24 11:47:06.000000000 +0200
+++ new/yast2-installation-4.3.16/test/update_repository_test.rb        
2020-09-01 17:29:21.000000000 +0200
@@ -5,6 +5,7 @@
 require "installation/update_repository"
 require "uri"
 require "pathname"
+require "stringio"
 
 describe Installation::UpdateRepository do
   TEMP_DIR = Pathname.new(__FILE__).dirname.join("tmp")
@@ -28,6 +29,8 @@
       .and_return(repo_id)
     allow(Yast::Pkg).to 
receive(:SourceRefreshNow).with(repo_id).and_return(true)
     allow(Yast::Pkg).to receive(:SourceLoad).and_return(true)
+    allow(subject).to receive(:write_package_index)
+    allow(repo).to receive(:write_package_index)
   end
 
   describe "#packages" do
@@ -187,11 +190,17 @@
     let(:update_path) { Pathname("/download/yast_000") }
     let(:mount_point) { updates_path.join("yast_0000") }
     let(:file) { double("file") }
+    let(:package) do
+      Y2Packager::Resolvable.new("name" => "pkg1", "version" => "1.42-1.2", 
"arch" => "noarch")
+    end
 
     before do
       allow(repo).to receive(:update_files).and_return([update_path])
       allow(Installation::UpdateRepository::INSTSYS_PARTS_PATH).to 
receive(:open).and_yield(file)
       allow(FileUtils).to receive(:mkdir_p).with(mount_point)
+      allow(repo).to receive(:packages).and_return([package])
+      allow(Yast::SCR).to receive(:Execute).and_return("exit" => 0)
+      allow(file).to receive(:puts)
     end
 
     it "mounts and adds files/dir" do
@@ -208,6 +217,17 @@
       repo.apply(updates_path)
     end
 
+    it "writes the list of updated packages to the 
#{Installation::UpdateRepository::PACKAGE_INDEX} file" do
+      # deactivate the global mock
+      expect(repo).to receive(:write_package_index).and_call_original
+
+      io = StringIO.new
+      expect(File).to 
receive(:open).with(Installation::UpdateRepository::PACKAGE_INDEX, 
"a").and_yield(io)
+      repo.apply(updates_path)
+      # check the written content
+      expect(io.string).to eq("pkg1 [1.42-1.2.noarch]\n")
+    end
+
     it "adds mounted filesystem to instsys.parts file" do
       allow(Yast::SCR).to receive(:Execute).and_return("exit" => 0)
       expect(file).to receive(:puts).with(%r{\Adownload/yast_000.+yast_0000})


Reply via email to