Hello community, here is the log from the commit of package yast2-update for openSUSE:Factory checked in at 2014-07-25 12:27:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-update (Old) and /work/SRC/openSUSE:Factory/.yast2-update.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-update" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-update/yast2-update.changes 2014-07-02 15:04:12.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-update.new/yast2-update.changes 2014-07-25 12:27:45.000000000 +0200 @@ -1,0 +2,15 @@ +Wed Jul 23 15:03:43 UTC 2014 - lsle...@suse.cz + +- update proposal: always select patterns to install, not only + once, needed to select patterns for newly added add-ons + (bnc#877012) +- 3.1.20 + +------------------------------------------------------------------- +Wed Jul 2 10:15:10 UTC 2014 - jreidin...@suse.com + +- add cleaning of old backups and also restore backup if user + go back to root selection(bnc#882039) +- 3.1.19 + +------------------------------------------------------------------- Old: ---- yast2-update-3.1.18.tar.bz2 New: ---- yast2-update-3.1.20.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-update.spec ++++++ --- /var/tmp/diff_new_pack.yRSZ7C/_old 2014-07-25 12:27:48.000000000 +0200 +++ /var/tmp/diff_new_pack.yRSZ7C/_new 2014-07-25 12:27:48.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-update -Version: 3.1.18 +Version: 3.1.20 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-update-3.1.18.tar.bz2 -> yast2-update-3.1.20.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.18/package/yast2-update.changes new/yast2-update-3.1.20/package/yast2-update.changes --- old/yast2-update-3.1.18/package/yast2-update.changes 2014-07-01 09:08:20.000000000 +0200 +++ new/yast2-update-3.1.20/package/yast2-update.changes 2014-07-24 14:23:10.000000000 +0200 @@ -1,4 +1,19 @@ ------------------------------------------------------------------- +Wed Jul 23 15:03:43 UTC 2014 - lsle...@suse.cz + +- update proposal: always select patterns to install, not only + once, needed to select patterns for newly added add-ons + (bnc#877012) +- 3.1.20 + +------------------------------------------------------------------- +Wed Jul 2 10:15:10 UTC 2014 - jreidin...@suse.com + +- add cleaning of old backups and also restore backup if user + go back to root selection(bnc#882039) +- 3.1.19 + +------------------------------------------------------------------- Tue Jul 1 06:38:02 UTC 2014 - lsle...@suse.cz - remove all repositories when going back to close the open solv diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.18/package/yast2-update.spec new/yast2-update-3.1.20/package/yast2-update.spec --- old/yast2-update-3.1.18/package/yast2-update.spec 2014-07-01 09:08:20.000000000 +0200 +++ new/yast2-update-3.1.20/package/yast2-update.spec 2014-07-24 14:23:10.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-update -Version: 3.1.18 +Version: 3.1.20 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.18/src/clients/inst_update_partition.rb new/yast2-update-3.1.20/src/clients/inst_update_partition.rb --- old/yast2-update-3.1.18/src/clients/inst_update_partition.rb 2014-07-01 09:08:20.000000000 +0200 +++ new/yast2-update-3.1.20/src/clients/inst_update_partition.rb 2014-07-24 14:23:10.000000000 +0200 @@ -42,6 +42,7 @@ Yast.include self, "update/rootpart.rb" if RootPart.Mounted + Update.restore_backup Update.Detach RootPart.UnmountPartitions(false) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.18/src/clients/update_proposal.rb new/yast2-update-3.1.20/src/clients/update_proposal.rb --- old/yast2-update-3.1.18/src/clients/update_proposal.rb 2014-07-01 09:08:20.000000000 +0200 +++ new/yast2-update-3.1.20/src/clients/update_proposal.rb 2014-07-24 14:23:10.000000000 +0200 @@ -498,18 +498,18 @@ update_sum = Pkg.PkgUpdateAll(GetUpdateConf()) Builtins.y2milestone("Update summary: %1", update_sum) Update.unknown_packages = Ops.get(update_sum, :ProblemListSze, 0) + end - sys_patterns = Packages.ComputeSystemPatternList - Builtins.foreach(sys_patterns) do |pat| - Pkg.ResolvableInstall(pat, :pattern) - end + # preselect system patterns (including PackagesProposal patterns) + sys_patterns = Packages.ComputeSystemPatternList + sys_patterns.each {|pat| Pkg.ResolvableInstall(pat, :pattern)} - if Pkg.PkgSolve(!Update.onlyUpdateInstalled) - Update.solve_errors = 0 - else - Update.solve_errors = Pkg.PkgSolveErrors - end + if Pkg.PkgSolve(!Update.onlyUpdateInstalled) + Update.solve_errors = 0 + else + Update.solve_errors = Pkg.PkgSolveErrors end + # check product compatibility if !(Update.ProductsCompatible || Update.products_incompatible) || update_not_possible if Popup.ContinueCancel( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.18/src/modules/RootPart.rb new/yast2-update-3.1.20/src/modules/RootPart.rb --- old/yast2-update-3.1.18/src/modules/RootPart.rb 2014-07-01 09:08:20.000000000 +0200 +++ new/yast2-update-3.1.20/src/modules/RootPart.rb 2014-07-24 14:23:10.000000000 +0200 @@ -1797,6 +1797,7 @@ # enter the mount points of the newly mounted partitions # in the target map of the storage module AddToTargetMap() + Update.clean_backup create_backup end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.18/src/modules/Update.rb new/yast2-update-3.1.20/src/modules/Update.rb --- old/yast2-update-3.1.18/src/modules/Update.rb 2014-07-01 09:08:20.000000000 +0200 +++ new/yast2-update-3.1.20/src/modules/Update.rb 2014-07-24 14:23:10.000000000 +0200 @@ -855,6 +855,7 @@ # @example to store repos file and credentials directory # Update.create_backup("repos", ["/etc/zypp/repos.d/*", "/etc/zypp/credentials"]) def create_backup(name, paths) + log.info "Creating tarball for #{name} including #{paths}" mounted_root = Installation.destdir tarball_path = File.join(BACKUP_DIR, "#{name}.tar.bz2") @@ -865,6 +866,26 @@ create_restore_script(script_path, tarball_path, paths) end + # clean backup content. Usefull to clean up all content before creating new backup + def clean_backup + log.info "Cleaning backup dir" + mounted_root = Installation.destdir + ::FileUtils.rm_r(File.join(mounted_root, BACKUP_DIR), + :force => true, :secure => true) + end + + # restores backup + def restore_backup + log.info "Restoring backup" + mounted_root = Installation.destdir + script_glob = File.join(mounted_root, BACKUP_DIR,"restore-*.sh") + ::Dir.glob(script_glob).each do |path| + cmd = "sh #{path} #{File.join("/", mounted_root)}" + res = SCR.Execute(path(".target.bash_output"), cmd) + log.info "Restoring with script #{cmd} result: #{res}" + end + end + publish :variable => :packages_to_install, :type => "integer" publish :variable => :packages_to_update, :type => "integer" publish :variable => :packages_to_remove, :type => "integer" @@ -899,6 +920,8 @@ publish :function => :Detach, :type => "void ()" publish :function => :installed_product, :type => "string ()" publish :function => :create_backup, :type => "void (string,list)" + publish :function => :clean_backup, :type => "void ()" + publish :function => :restore_backup, :type => "void ()" private diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.18/test/update_test.rb new/yast2-update-3.1.20/test/update_test.rb --- old/yast2-update-3.1.18/test/update_test.rb 2014-07-01 09:08:20.000000000 +0200 +++ new/yast2-update-3.1.20/test/update_test.rb 2014-07-24 14:23:10.000000000 +0200 @@ -37,6 +37,7 @@ describe Yast::Update do before(:each) do log.info "--- test ---" + allow(Yast::Installation).to receive(:destdir).and_return("/mnt") end describe "#installed_product" do @@ -58,7 +59,6 @@ describe "#create_backup" do before(:each) do - allow(Yast::Installation).to receive(:destdir).and_return("/mnt") allow(::FileUtils).to receive(:mkdir_p) allow(::File).to receive(:write) allow(::FileUtils).to receive(:chmod) @@ -125,6 +125,27 @@ end end + describe "#clean_backup" do + it "removes backup directory with its content" do + expect(::FileUtils).to receive(:rm_r).with(/\/mnt.*system-upgrade.*/, anything()) + + Yast::Update.clean_backup + end + end + + describe "#restore_backup" do + it "call all restore scripts in backup directory" do + expect(::Dir).to receive(:glob).and_return(["restore-a.sh", "restore-b.sh"]) + expect(Yast::SCR).to receive(:Execute).with(Yast::Path.new(".target.bash_output"), /sh .*restore-a.sh \/mnt/). + and_return({"exit" => 0}) + expect(Yast::SCR).to receive(:Execute).with(Yast::Path.new(".target.bash_output"), /sh .*restore-b.sh \/mnt/). + and_return({"exit" => 0}) + + Yast::Update.restore_backup + end + end + + describe "#SetDesktopPattern" do context "if there is no definition of window manager upgrade path in control file" do it "returns true as there is no upgrade path defined" do -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org