Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package yast2-storage-ng for openSUSE:Factory checked in at 2021-08-06 22:44:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-storage-ng (Old) and /work/SRC/openSUSE:Factory/.yast2-storage-ng.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-storage-ng" Fri Aug 6 22:44:30 2021 rev:105 rq:910337 version:4.4.7 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-storage-ng/yast2-storage-ng.changes 2021-06-24 18:21:55.880873429 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-storage-ng.new.1899/yast2-storage-ng.changes 2021-08-06 22:44:53.470058856 +0200 @@ -1,0 +2,7 @@ +Thu Aug 5 12:19:04 UTC 2021 - Jos?? Iv??n L??pez Gonz??lez <jlo...@suse.com> + +- Improve detection of devices that contain an installation + repository (bsc#1185694). +- 4.4.7 + +------------------------------------------------------------------- Old: ---- yast2-storage-ng-4.4.6.tar.bz2 New: ---- yast2-storage-ng-4.4.7.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-storage-ng.spec ++++++ --- /var/tmp/diff_new_pack.w8nRoj/_old 2021-08-06 22:44:54.678056712 +0200 +++ /var/tmp/diff_new_pack.w8nRoj/_new 2021-08-06 22:44:54.682056705 +0200 @@ -17,7 +17,7 @@ Name: yast2-storage-ng -Version: 4.4.6 +Version: 4.4.7 Release: 0 Summary: YaST2 - Storage Configuration License: GPL-2.0-only OR GPL-3.0-only ++++++ yast2-storage-ng-4.4.6.tar.bz2 -> yast2-storage-ng-4.4.7.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.6/package/yast2-storage-ng.changes new/yast2-storage-ng-4.4.7/package/yast2-storage-ng.changes --- old/yast2-storage-ng-4.4.6/package/yast2-storage-ng.changes 2021-06-15 14:02:26.000000000 +0200 +++ new/yast2-storage-ng-4.4.7/package/yast2-storage-ng.changes 2021-08-05 14:27:58.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Aug 5 12:19:04 UTC 2021 - Jos?? Iv??n L??pez Gonz??lez <jlo...@suse.com> + +- Improve detection of devices that contain an installation + repository (bsc#1185694). +- 4.4.7 + +------------------------------------------------------------------- Tue Jun 15 10:21:16 UTC 2021 - Imobach Gonzalez Sosa <igonzalezs...@suse.com> - Fix the Comment entry in the desktop file so the tooltip diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.6/package/yast2-storage-ng.spec new/yast2-storage-ng-4.4.7/package/yast2-storage-ng.spec --- old/yast2-storage-ng-4.4.6/package/yast2-storage-ng.spec 2021-06-15 14:02:26.000000000 +0200 +++ new/yast2-storage-ng-4.4.7/package/yast2-storage-ng.spec 2021-08-05 14:27:58.000000000 +0200 @@ -16,7 +16,7 @@ # Name: yast2-storage-ng -Version: 4.4.6 +Version: 4.4.7 Release: 0 Summary: YaST2 - Storage Configuration License: GPL-2.0-only OR GPL-3.0-only diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.6/src/lib/y2storage/blk_device.rb new/yast2-storage-ng-4.4.7/src/lib/y2storage/blk_device.rb --- old/yast2-storage-ng-4.4.6/src/lib/y2storage/blk_device.rb 2021-06-15 14:02:26.000000000 +0200 +++ new/yast2-storage-ng-4.4.7/src/lib/y2storage/blk_device.rb 2021-08-05 14:27:58.000000000 +0200 @@ -146,7 +146,7 @@ # # Take into account that libstorage-ng intentionally filter outs many udev # paths and ids, so the list is expected to be incomplete. If you need to - # lookup a device by its udev name, check {.find_by_all_names}. + # lookup a device by its udev name, check {.find_by_any_name}. # # @see #udev_full_paths # @see #udev_full_ids diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.6/src/lib/y2storage/device_finder.rb new/yast2-storage-ng-4.4.7/src/lib/y2storage/device_finder.rb --- old/yast2-storage-ng-4.4.6/src/lib/y2storage/device_finder.rb 2021-06-15 14:02:26.000000000 +0200 +++ new/yast2-storage-ng-4.4.7/src/lib/y2storage/device_finder.rb 2021-08-05 14:27:58.000000000 +0200 @@ -182,7 +182,7 @@ !StorageManager.instance.committed? end - # Alternative versions of the name to be also considered in searchs + # Alternative versions of the name to be also considered in searches # # @param device_name [String] a kernel name, udev name or any other device name # @return [Array<String>] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.6/src/lib/y2storage/disk_analyzer.rb new/yast2-storage-ng-4.4.7/src/lib/y2storage/disk_analyzer.rb --- old/yast2-storage-ng-4.4.6/src/lib/y2storage/disk_analyzer.rb 2021-06-15 14:02:26.000000000 +0200 +++ new/yast2-storage-ng-4.4.7/src/lib/y2storage/disk_analyzer.rb 2021-08-05 14:27:58.000000000 +0200 @@ -1,4 +1,4 @@ -# Copyright (c) [2015-2019] SUSE LLC +# Copyright (c) [2015-2021] SUSE LLC # # All Rights Reserved. # @@ -315,34 +315,16 @@ # Checks whether a device contains an installation repository # - # For all possible names of the given device, it is checked if any of that - # names is included in the URI of an installation repository (see - # {#repositories_devices}). Note that the names of all devices inside the - # given device are considered as names of the given device (see #{device_names}), - # (e.g., when a disk contains a partition being used as LVM PV, the names of the - # LVM LVs are considered as names of the disk). + # A device contains an installation repository if the device or any of its descendant devices + # is included in the list of devices from the installation repository URI. For example, if the + # URI is "hd:/subdir?device=/dev/sda1", then "/dev/sda" contains an installation repository. # # @param device [BlkDevice] # @return [Boolean] def contain_installation_repository?(device) - device_names(device).any? { |n| repositories_devices.include?(n) } - end - - # All possible device names of a device - # - # Device names includes the kernel name and all udev names given by libstorage-ng. - # Moreover, it includes the names of all devices inside the given device - # (e.g., names of partitions inside a disk). Note that when a device contains a - # partition being used as LVM PV, the names of the LVM LVs are considered as names - # of the device. - # - # @param device [BlkDevice] - # @return [Array<String>] - def device_names(device) - devices = all_devices_from_device(device) + repositories_names = repositories_devices.map(&:name) - names = devices.map { |d| d.udev_full_all.prepend(d.name) } - names.flatten.compact.uniq + all_devices_from_device(device).any? { |d| repositories_names.include?(d.name) } end # All blk devices defined from a device, including the given device @@ -357,13 +339,28 @@ devices.prepend(device) end + # Devices whose name is indicated in the URI of the installation repositories + # + # @return [Array<BlkDevice>] + def repositories_devices + return @repositories_devices if @repositories_devices + + devices = repositories_device_names.map { |n| devicegraph.find_by_any_name(n) }.compact + + @repositories_devices = devices + end + # Device names indicated in the URI of the installation repositories # # @see #local_repositories # # @return [Array<String>] - def repositories_devices - @repositories_devices ||= local_repositories.map { |r| repository_devices(r) }.flatten + def repositories_device_names + return @repositories_device_names if @repositories_device_names + + names = local_repositories.flat_map { |r| repository_device_names(r) }.uniq + + @repositories_device_names = names end # TODO: This method should be moved to Y2Packager::Repository class @@ -376,7 +373,7 @@ # # @param repository [Y2Packager::Repository] # @return [Array<String>] - def repository_devices(repository) + def repository_device_names(repository) match_data = repository.url.to_s.match(/.*device[s]?=([^&]*)/) return [] unless match_data diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.6/test/y2storage/disk_analyzer_test.rb new/yast2-storage-ng-4.4.7/test/y2storage/disk_analyzer_test.rb --- old/yast2-storage-ng-4.4.6/test/y2storage/disk_analyzer_test.rb 2021-06-15 14:02:26.000000000 +0200 +++ new/yast2-storage-ng-4.4.7/test/y2storage/disk_analyzer_test.rb 2021-08-05 14:27:58.000000000 +0200 @@ -1,5 +1,6 @@ #!/usr/bin/env rspec -# Copyright (c) [2016-2019] SUSE LLC + +# Copyright (c) [2016-2021] SUSE LLC # # All Rights Reserved. # @@ -687,6 +688,21 @@ expect(candidate_disks).to_not include("/dev/sda", "/dev/sdb") end end + + context "when the url of an installation repository points to an udev symlink" do + before do + allow(Y2Storage::BlkDevice).to receive(:find_by_any_name) + .with(fake_devicegraph, udev_name).and_return(sda1) + end + + let(:udev_name) { "/dev/disk/by-id/111-222-3333" } + + let(:repository_url) { "dvd:/?devices=#{udev_name}" } + + it "does not include the disk device" do + expect(candidate_disks).to_not include("/dev/sda1") + end + end end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-storage-ng-4.4.6/test/y2storage/planned/can_be_formatted_test.rb new/yast2-storage-ng-4.4.7/test/y2storage/planned/can_be_formatted_test.rb --- old/yast2-storage-ng-4.4.6/test/y2storage/planned/can_be_formatted_test.rb 2021-06-15 14:02:26.000000000 +0200 +++ new/yast2-storage-ng-4.4.7/test/y2storage/planned/can_be_formatted_test.rb 2021-08-05 14:27:58.000000000 +0200 @@ -89,7 +89,7 @@ it "sets the 'ro' option exactly once" do planned.format!(blk_device) - expect(blk_device.filesystem.mount_options).to include("ro").once + expect(blk_device.filesystem.mount_options.count { |x| x == "ro" }).to eq(1) end context "and fstab options also include the 'ro' flag" do @@ -99,7 +99,7 @@ it "sets the 'ro' option exactly once" do planned.format!(blk_device) - expect(blk_device.filesystem.mount_options).to include("ro").once + expect(blk_device.filesystem.mount_options.count { |x| x == "ro" }).to eq(1) end end