Hello community, here is the log from the commit of package yast2 for openSUSE:Factory checked in at 2015-07-22 09:19:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2 (Old) and /work/SRC/openSUSE:Factory/.yast2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2/yast2.changes 2015-07-05 17:52:47.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2.new/yast2.changes 2015-07-22 09:19:23.000000000 +0200 @@ -1,0 +2,20 @@ +Fri Jul 17 08:28:41 UTC 2015 - igonzalezsosa@suse.com + +- Do not try to load snapper extension as it does not exists anymore + (bsc#938377). +- 3.1.141 + +------------------------------------------------------------------- +Thu Jul 9 15:37:27 UTC 2015 - jreidinger@suse.com + +- do not crash if desktop file does not exist for setting icon + (bnc#937549) +- 3.1.140 + +------------------------------------------------------------------- +Mon Jul 6 18:02:27 CEST 2015 - shundhammer@suse.de + +- Cleanup for snapshots made during installation (bnc#935923) +- 3.1.139 + +------------------------------------------------------------------- Old: ---- yast2-3.1.138.tar.bz2 New: ---- yast2-3.1.141.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2.spec ++++++ --- /var/tmp/diff_new_pack.vjih5J/_old 2015-07-22 09:19:24.000000000 +0200 +++ /var/tmp/diff_new_pack.vjih5J/_new 2015-07-22 09:19:24.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2 -Version: 3.1.138 +Version: 3.1.141 Release: 0 Url: https://github.com/yast/yast-yast2 ++++++ yast2-3.1.138.tar.bz2 -> yast2-3.1.141.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.138/library/system/src/lib/yast2/fs_snapshot.rb new/yast2-3.1.141/library/system/src/lib/yast2/fs_snapshot.rb --- old/yast2-3.1.138/library/system/src/lib/yast2/fs_snapshot.rb 2015-07-01 16:11:38.000000000 +0200 +++ new/yast2-3.1.141/library/system/src/lib/yast2/fs_snapshot.rb 2015-07-20 10:41:38.000000000 +0200 @@ -65,6 +65,9 @@ LIST_SNAPSHOTS_CMD = "LANG=en_US.UTF-8 /usr/bin/snapper --no-dbus --root=%{root} list" VALID_LINE_REGEX = /\A\w+\s+\| \d+/ + # Predefined snapshot cleanup strategies (the user can define custom ones, too) + CLEANUP_STRATEGY = { number: "number", timeline: "timeline" } + attr_reader :number, :snapshot_type, :previous_number, :timestamp, :user, :cleanup_algo, :description @@ -74,11 +77,10 @@ def self.configured? return @configured unless @configured.nil? - out = with_snapper do - Yast::SCR.Execute(Yast::Path.new(".target.bash_output"), - format(FIND_CONFIG_CMD, root: target_root) - ) - end + out = Yast::SCR.Execute( + Yast::Path.new(".target.bash_output"), + format(FIND_CONFIG_CMD, root: target_root) + ) log.info("Checking if Snapper is configured: \"#{FIND_CONFIG_CMD}\" returned: #{out}") @configured = out["exit"] == 0 @@ -111,15 +113,17 @@ # Creates a new 'single' snapshot unless disabled by user # - # @param description [String] Snapshot's description. + # @param description [String] Snapshot's description. + # @param cleanup [String] Cleanup strategy (:number, :timeline, nil) + # @param important [boolean] Add "important" to userdata? # @return [FsSnapshot] The created snapshot. # # @see FsSnapshot.create # @see FsSnapshot.create_snapshot? - def self.create_single(description) + def self.create_single(description, cleanup: nil, important: false) return nil unless create_snapshot?(:single) - create(:single, description) + create(:single, description, cleanup: cleanup, important: important) end # Creates a new 'pre' snapshot @@ -129,29 +133,31 @@ # # @see FsSnapshot.create # @see FsSnapshot.create_snapshot? - def self.create_pre(description) + def self.create_pre(description, cleanup: nil, important: false) return nil unless create_snapshot?(:around) - create(:pre, description) + create(:pre, description, cleanup: cleanup, important: important) end # Creates a new 'post' snapshot unless disabled by user # # Each 'post' snapshot corresponds with a 'pre' one. # - # @param description [String] Snapshot's description. - # @param previous_number [Fixnum] Number of the previous snapshot + # @param description [String] Snapshot's description. + # @param previous_number [Fixnum] Number of the previous snapshot + # @param cleanup [String] Cleanup strategy (:number, :timeline, nil) + # @param important [boolean] Add "important" to userdata? # @return [FsSnapshot] The created snapshot. # # @see FsSnapshot.create # @see FsSnapshot.create_snapshot? - def self.create_post(description, previous_number) + def self.create_post(description, previous_number, cleanup: nil, important: false) return nil unless create_snapshot?(:around) previous = find(previous_number) if previous - create(:post, description, previous) + create(:post, description, previous: previous, cleanup: cleanup, important: important) else log.error "Previous filesystem snapshot was not found" raise PreviousSnapshotNotFound @@ -166,9 +172,11 @@ # @param snapshot_type [Symbol] Snapshot's type: :pre, :post or :single. # @param description [String] Snapshot's description. # @param previous [FsSnashot] Previous snapshot. + # @param cleanup [String] Cleanup strategy (:number, :timeline, nil) + # @param important [boolean] Add "important" to userdata? # @return [FsSnapshot] The created snapshot if the operation was # successful. - def self.create(snapshot_type, description, previous = nil) + def self.create(snapshot_type, description, previous: nil, cleanup: nil, important: false) raise SnapperNotConfigured unless configured? cmd = format(CREATE_SNAPSHOT_CMD, @@ -177,11 +185,16 @@ description: description ) cmd << " --pre-num #{previous.number}" if previous + cmd << " --userdata \"important=yes\"" if important - out = with_snapper do - Yast::SCR.Execute(Yast::Path.new(".target.bash_output"), cmd) + if cleanup + strategy = CLEANUP_STRATEGY[cleanup] + cmd << " --cleanup \"#{strategy}\"" if strategy end + log.info("Executing: \"#{cmd}\"") + out = Yast::SCR.Execute(Yast::Path.new(".target.bash_output"), cmd) + if out["exit"] == 0 find(out["stdout"].to_i) # The CREATE_SNAPSHOT_CMD returns the number of the new snapshot. else @@ -200,17 +213,6 @@ end private_class_method :non_switched_installation? - # ensures that for local SCR snapper is available in insts-sys - def self.with_snapper(&block) - return block.call unless non_switched_installation? - - Yast.import "InstExtensionImage" - Yast::InstExtensionImage.with_extension("snapper") do - block.call - end - end - private_class_method :with_snapper - # Gets target directory on which should snapper operate def self.target_root return "/" unless non_switched_installation? @@ -229,12 +231,10 @@ def self.all raise SnapperNotConfigured unless configured? - out = with_snapper do - Yast::SCR.Execute( - Yast::Path.new(".target.bash_output"), - format(LIST_SNAPSHOTS_CMD, root: target_root) - ) - end + out = Yast::SCR.Execute( + Yast::Path.new(".target.bash_output"), + format(LIST_SNAPSHOTS_CMD, root: target_root) + ) lines = out["stdout"].lines.grep(VALID_LINE_REGEX) # relevant lines from output. log.info("Retrieving snapshots list: #{LIST_SNAPSHOTS_CMD} returned: #{out}") lines.each_with_object([]) do |line, snapshots| diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.138/library/system/test/fs_snapshot_test.rb new/yast2-3.1.141/library/system/test/fs_snapshot_test.rb --- old/yast2-3.1.138/library/system/test/fs_snapshot_test.rb 2015-07-01 16:11:38.000000000 +0200 +++ new/yast2-3.1.141/library/system/test/fs_snapshot_test.rb 2015-07-20 10:41:38.000000000 +0200 @@ -12,6 +12,8 @@ FIND_IN_ROOT_CONFIG = "/usr/bin/snapper --no-dbus --root=/mnt list-configs | grep \"^root \" >/dev/null" LIST_SNAPSHOTS = "LANG=en_US.UTF-8 /usr/bin/snapper --no-dbus --root=/ list" + let(:dummy_snapshot) { double("snapshot") } + before do # reset configured cache described_class.instance_variable_set("@configured", nil) @@ -53,19 +55,6 @@ allow(Yast::SCR).to receive(:Execute) .with(path(".target.bash_output"), FIND_IN_ROOT_CONFIG) .and_return("stdout" => "", "exit" => 0) - - Yast.import "InstExtensionImage" - allow(Yast::InstExtensionImage).to receive(:with_extension) do |&block| - block.call - end - end - - it "ensures snapper is available" do - expect(Yast::InstExtensionImage).to receive(:with_extension) do |&block| - block.call - end - - described_class.configured? end it "detects snapper configuration in installation target dir" do @@ -81,6 +70,8 @@ describe ".create_single" do CREATE_SINGLE_SNAPSHOT = "/usr/lib/snapper/installation-helper --step 5 "\ "--root-prefix=/ --snapshot-type single --description \"some-description\"" + OPTION_CLEANUP_NUMBER = " --cleanup \"number\"" + OPTION_IMPORTANT = " --userdata \"important=yes\"" before do allow(Yast2::FsSnapshot).to receive(:configured?).and_return(configured) @@ -90,10 +81,11 @@ context "when snapper is configured" do let(:configured) { true } let(:create_snapshot) { true } + let(:snapshot_command) { CREATE_SINGLE_SNAPSHOT } before do allow(Yast::SCR).to receive(:Execute) - .with(path(".target.bash_output"), CREATE_SINGLE_SNAPSHOT) + .with(path(".target.bash_output"), snapshot_command) .and_return(output) end @@ -109,7 +101,6 @@ context "when snapshot creation is successful" do let(:output) { { "stdout" => "2", "exit" => 0 } } - let(:dummy_snapshot) { double("snapshot") } it "returns the created snapshot" do expect(described_class).to receive(:find).with(2) @@ -118,6 +109,42 @@ expect(snapshot).to be(dummy_snapshot) end end + + context "when a cleanup strategy is set" do + let(:output) { { "stdout" => "2", "exit" => 0 } } + let(:snapshot_command) { CREATE_SINGLE_SNAPSHOT + OPTION_CLEANUP_NUMBER } + + it "creates a snapshot with that strategy" do + expect(described_class).to receive(:find).with(2) + .and_return(dummy_snapshot) + snapshot = described_class.create_single("some-description", cleanup: :number) + expect(snapshot).to be(dummy_snapshot) + end + end + + context "when a snapshot is important" do + let(:output) { { "stdout" => "2", "exit" => 0 } } + let(:snapshot_command) { CREATE_SINGLE_SNAPSHOT + OPTION_IMPORTANT } + + it "creates a snapshot marked as important" do + expect(described_class).to receive(:find).with(2) + .and_return(dummy_snapshot) + snapshot = described_class.create_single("some-description", important: true) + expect(snapshot).to be(dummy_snapshot) + end + end + + context "when it's both important and a cleanup strategy is set" do + let(:output) { { "stdout" => "2", "exit" => 0 } } + let(:snapshot_command) { CREATE_SINGLE_SNAPSHOT + OPTION_IMPORTANT + OPTION_CLEANUP_NUMBER } + + it "creates a snapshot with that strategy that is marked as important" do + expect(described_class).to receive(:find).with(2) + .and_return(dummy_snapshot) + snapshot = described_class.create_single("some-description", cleanup: :number, important: true) + expect(snapshot).to be(dummy_snapshot) + end + end end context "when snapper is not configured" do @@ -152,10 +179,11 @@ context "when snapper is configured" do let(:configured) { true } let(:create_snapshot) { true } + let(:snapshot_command) { CREATE_PRE_SNAPSHOT } before do allow(Yast::SCR).to receive(:Execute) - .with(path(".target.bash_output"), CREATE_PRE_SNAPSHOT) + .with(path(".target.bash_output"), snapshot_command) .and_return(output) end @@ -171,7 +199,6 @@ context "when snapshot creation is successful" do let(:output) { { "stdout" => "2", "exit" => 0 } } - let(:dummy_snapshot) { double("snapshot") } it "returns the created snapshot" do expect(described_class).to receive(:find).with(2) @@ -180,6 +207,42 @@ expect(snapshot).to be(dummy_snapshot) end end + + context "when a cleanup strategy is set" do + let(:output) { { "stdout" => "2", "exit" => 0 } } + let(:snapshot_command) { CREATE_PRE_SNAPSHOT + OPTION_CLEANUP_NUMBER } + + it "creates a pre snapshot with that strategy" do + expect(described_class).to receive(:find).with(2) + .and_return(dummy_snapshot) + snapshot = described_class.create_pre("some-description", cleanup: :number) + expect(snapshot).to be(dummy_snapshot) + end + end + + context "when a snapshot is important" do + let(:output) { { "stdout" => "2", "exit" => 0 } } + let(:snapshot_command) { CREATE_PRE_SNAPSHOT + OPTION_IMPORTANT } + + it "creates a pre snapshot marked as important" do + expect(described_class).to receive(:find).with(2) + .and_return(dummy_snapshot) + snapshot = described_class.create_pre("some-description", important: true) + expect(snapshot).to be(dummy_snapshot) + end + end + + context "when it's both important and a cleanup strategy is set" do + let(:output) { { "stdout" => "2", "exit" => 0 } } + let(:snapshot_command) { CREATE_PRE_SNAPSHOT + OPTION_IMPORTANT + OPTION_CLEANUP_NUMBER } + + it "creates a pre snapshot with that strategy that is marked as important" do + expect(described_class).to receive(:find).with(2) + .and_return(dummy_snapshot) + snapshot = described_class.create_pre("some-description", important: true, cleanup: :number) + expect(snapshot).to be(dummy_snapshot) + end + end end context "when snapper is not configured" do @@ -217,7 +280,6 @@ let(:create_snapshot) { true } let(:pre_snapshot) { double("snapshot", snapshot_type: :pre, number: 2) } - let(:dummy_snapshot) { double("snapshot") } let(:snapshots) { [pre_snapshot] } let(:output) { { "stdout" => "3", "exit" => 0 } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.138/library/wizard/src/modules/Wizard.rb new/yast2-3.1.141/library/wizard/src/modules/Wizard.rb --- old/yast2-3.1.138/library/wizard/src/modules/Wizard.rb 2015-07-01 16:11:38.000000000 +0200 +++ new/yast2-3.1.141/library/wizard/src/modules/Wizard.rb 2015-07-20 10:41:38.000000000 +0200 @@ -1186,6 +1186,8 @@ def SetDesktopIcon(file) description = Desktop.ParseSingleDesktopFile(file) + return false unless description + icon = description["icon"] return false unless icon diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.138/package/yast2.changes new/yast2-3.1.141/package/yast2.changes --- old/yast2-3.1.138/package/yast2.changes 2015-07-01 16:11:38.000000000 +0200 +++ new/yast2-3.1.141/package/yast2.changes 2015-07-20 10:41:38.000000000 +0200 @@ -1,4 +1,24 @@ ------------------------------------------------------------------- +Fri Jul 17 08:28:41 UTC 2015 - igonzalezsosa@suse.com + +- Do not try to load snapper extension as it does not exists anymore + (bsc#938377). +- 3.1.141 + +------------------------------------------------------------------- +Thu Jul 9 15:37:27 UTC 2015 - jreidinger@suse.com + +- do not crash if desktop file does not exist for setting icon + (bnc#937549) +- 3.1.140 + +------------------------------------------------------------------- +Mon Jul 6 18:02:27 CEST 2015 - shundhammer@suse.de + +- Cleanup for snapshots made during installation (bnc#935923) +- 3.1.139 + +------------------------------------------------------------------- Wed Jul 1 13:46:26 UTC 2015 - jreidinger@suse.com - fix using desktop icon for yast(bnc#894220) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.138/package/yast2.spec new/yast2-3.1.141/package/yast2.spec --- old/yast2-3.1.138/package/yast2.spec 2015-07-01 16:11:38.000000000 +0200 +++ new/yast2-3.1.141/package/yast2.spec 2015-07-20 10:41:38.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package yast2 # -# Copyright (c) 2013-2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,21 +17,24 @@ Name: yast2 -Version: 3.1.138 +Version: 3.1.141 Release: 0 -URL: https://github.com/yast/yast-yast2 +Url: https://github.com/yast/yast-yast2 BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: %{name}-%{version}.tar.bz2 -Group: System/YaST -License: GPL-2.0 Source1: yast2-rpmlintrc -BuildRequires: perl-XML-Writer update-desktop-files yast2-perl-bindings yast2-testsuite +BuildRequires: perl-XML-Writer +BuildRequires: update-desktop-files BuildRequires: yast2-devtools >= 3.1.10 +BuildRequires: yast2-perl-bindings +BuildRequires: yast2-testsuite # Needed already in build time -BuildRequires: yast2-core >= 2.18.12 yast2-pkg-bindings >= 2.20.3 yast2-ycp-ui-bindings >= 3.1.8 +BuildRequires: yast2-core >= 2.18.12 +BuildRequires: yast2-pkg-bindings >= 2.20.3 +BuildRequires: yast2-ycp-ui-bindings >= 3.1.8 # Needed for tests BuildRequires: grep @@ -42,7 +45,7 @@ # For running RSpec tests during build BuildRequires: rubygem(rspec) # To have Yast::CoreExt::AnsiString -BuildRequires: yast2-ruby-bindings >= 3.1.36 +BuildRequires: yast2-ruby-bindings >= 3.1.36 # pre-requires for filling the sysconfig template (sysconfig.yast2) PreReq: %fillup_prereq @@ -55,13 +58,15 @@ # changed StartPackage callback signature Requires: yast2-pkg-bindings >= 2.20.3 -Requires: yui_backend +Requires: yui_backend # For Cron Agent, Module Requires: perl-Config-Crontab # for ag_tty (/bin/stty) # for /usr/bin/md5sum -Requires: coreutils sysconfig >= 0.80.0 -Requires: yast2-xml yast2-hardware-detection +Requires: coreutils +Requires: sysconfig >= 0.80.0 +Requires: yast2-hardware-detection +Requires: yast2-xml # for SLPAPI.pm Requires: yast2-perl-bindings # for ag_anyxml @@ -101,24 +106,32 @@ Provides: yast2-lib-sequencer Obsoletes: yast2-lib-sequencer -Provides: yast2-lib-wizard yast2-lib-wizard-devel yast2-trans-wizard -Obsoletes: yast2-lib-wizard yast2-lib-wizard-devel yast2-trans-wizard -Provides: yast2-trans-menu y2t_menu -Obsoletes: yast2-trans-menu y2t_menu +Provides: yast2-lib-wizard +Provides: yast2-lib-wizard-devel +Provides: yast2-trans-wizard +Obsoletes: yast2-lib-wizard +Obsoletes: yast2-lib-wizard-devel +Obsoletes: yast2-trans-wizard +Provides: y2t_menu +Provides: yast2-trans-menu +Obsoletes: y2t_menu +Obsoletes: yast2-trans-menu # moved here from another packages -Provides: yast2-installation:/usr/share/YaST2/modules/Installation.ycp -Provides: yast2-installation:/usr/share/YaST2/modules/Product.ycp +Provides: yast2-dns-server:/usr/share/YaST2/modules/DnsServerAPI.pm Provides: yast2-installation:/usr/share/YaST2/modules/Hotplug.ycp Provides: yast2-installation:/usr/share/YaST2/modules/HwStatus.ycp +Provides: yast2-installation:/usr/share/YaST2/modules/Installation.ycp +Provides: yast2-installation:/usr/share/YaST2/modules/Product.ycp +Provides: yast2-mail-aliases Provides: yast2-network:/usr/share/YaST2/modules/Internet.ycp Provides: yast2-packager:/usr/lib/YaST2/servers_non_y2/ag_anyxml -Provides: yast2-dns-server:/usr/share/YaST2/modules/DnsServerAPI.pm -Provides: yast2-mail-aliases Requires: yast2-ruby-bindings >= 3.1.33 Summary: YaST2 - Main Package +License: GPL-2.0 +Group: System/YaST %description This package contains scripts and data needed for SUSE Linux @@ -126,14 +139,14 @@ %package devel-doc Requires: yast2 = %version -Group: System/YaST Provides: yast2-lib-sequencer-devel -Obsoletes: yast2-lib-sequencer-devel Obsoletes: yast2-devel +Obsoletes: yast2-lib-sequencer-devel Provides: yast2-devel Requires: yast2-core-devel Summary: YaST2 - Development Scripts and Documentation +Group: System/YaST %description devel-doc This package contains scripts and data needed for a SUSE Linux @@ -171,7 +184,6 @@ # because of the compression) %fdupes -s %buildroot/%_prefix/share/doc/packages/yast2 - %post %{fillup_only -n yast2}