Script 'mail_helper' called by ro Hello packager, This is just FYI. Your package was checked in in distribution "sle12" by autobuild-member: ro. Here comes the log... ---------------------------%<------------------------------ Hi, here is the log from ci_new_pac /mounts/work_src_done/SLE12/yast2-update -> sle12 ## BNC# 882039 : "[UPGRADE] Upgrade process modifies data on installed system and does not restore them" (ASSIGNED/) Changes: -------- --- /work/SRC/SUSE:SLE-12:GA/yast2-update/yast2-update.changes 2014-07-01 13:12:46.000000000 +0200 +++ /mounts/work_src_done/SLE12/yast2-update/yast2-update.changes 2014-07-23 11:39:05.000000000 +0200 @@ -1,0 +2,7 @@ +Wed Jul 2 10:15:10 UTC 2014 - jreidinger@suse.com + +- add cleaning of old backups and also restore backup if user + go back to root selection(bnc#882039) +- 3.1.19 + +------------------------------------------------------------------- calling whatdependson for sle12-i586 Packages directly triggered for rebuild: - yast2-product-creator - yast2-schema - yast2-update ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/SUSE:SLE-12:GA/yast2-update (Old) and /mounts/work_src_done/SLE12/yast2-update (BS:build ID:41674 MAIL:yast-commit@opensuse.org) (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-update", Maintainer is "yast-commit@opensuse.org" Old: ---- yast2-update-3.1.18.tar.bz2 New: ---- yast2-update-3.1.19.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-update.spec ++++++ --- /var/tmp/diff_new_pack.HTFDvj/_old 2014-07-23 12:58:25.000000000 +0200 +++ /var/tmp/diff_new_pack.HTFDvj/_new 2014-07-23 12:58:25.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-update -Version: 3.1.18 +Version: 3.1.19 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-update-3.1.18.tar.bz2 -> yast2-update-3.1.19.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.19/package/yast2-update.changes --- old/yast2-update-3.1.18/package/yast2-update.changes 2014-07-01 09:55:07.000000000 +0200 +++ new/yast2-update-3.1.19/package/yast2-update.changes 2014-07-23 11:35:58.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Jul 2 10:15:10 UTC 2014 - jreidinger@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 - lslezak@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.19/package/yast2-update.spec --- old/yast2-update-3.1.18/package/yast2-update.spec 2014-07-01 09:55:07.000000000 +0200 +++ new/yast2-update-3.1.19/package/yast2-update.spec 2014-07-23 11:35:58.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-update -Version: 3.1.18 +Version: 3.1.19 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.19/src/clients/inst_update_partition.rb --- old/yast2-update-3.1.18/src/clients/inst_update_partition.rb 2014-07-01 09:55:07.000000000 +0200 +++ new/yast2-update-3.1.19/src/clients/inst_update_partition.rb 2014-07-23 11:35:58.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/modules/RootPart.rb new/yast2-update-3.1.19/src/modules/RootPart.rb --- old/yast2-update-3.1.18/src/modules/RootPart.rb 2014-07-01 09:55:07.000000000 +0200 +++ new/yast2-update-3.1.19/src/modules/RootPart.rb 2014-07-23 11:35:58.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.19/src/modules/Update.rb --- old/yast2-update-3.1.18/src/modules/Update.rb 2014-07-01 09:55:07.000000000 +0200 +++ new/yast2-update-3.1.19/src/modules/Update.rb 2014-07-23 11:35:58.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.19/test/update_test.rb --- old/yast2-update-3.1.18/test/update_test.rb 2014-07-01 09:55:07.000000000 +0200 +++ new/yast2-update-3.1.19/test/update_test.rb 2014-07-23 11:35:58.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 continue with "q"... Checked in at Wed Jul 23 12:58:58 CEST 2014 by ro Remember to have fun... -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org