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# 874116 : "Pattern seems not fullly selected when upgrading from SLED11 SP3 (Gnome default)." (RESOLVED/FIXED)
Changes:
--------
--- /work/SRC/SUSE:SLE-12:GA/yast2-update/yast2-update.changes 2014-05-02 15:40:07.000000000 +0200
+++ /mounts/work_src_done/SLE12/yast2-update/yast2-update.changes 2014-05-15 11:25:18.000000000 +0200
@@ -1,0 +2,8 @@
+Thu May 15 09:17:19 CEST 2014 - locilka@suse.com
+
+- Added handling for desktop upgrade (bnc#874116). Moved from code
+ to control file as packages and patterns might have different
+ names in different prducts.
+- 3.1.8
+
+-------------------------------------------------------------------
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:37936 MAIL:yast-commit@opensuse.org) (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-update", Maintainer is "yast-commit@opensuse.org"
Old:
----
yast2-update-3.1.7.tar.bz2
New:
----
yast2-update-3.1.8.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-update.spec ++++++
--- /var/tmp/diff_new_pack.meAdWU/_old 2014-05-15 16:09:30.000000000 +0200
+++ /var/tmp/diff_new_pack.meAdWU/_new 2014-05-15 16:09:30.000000000 +0200
@@ -17,7 +17,7 @@
Name: yast2-update
-Version: 3.1.7
+Version: 3.1.8
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ yast2-update-3.1.7.tar.bz2 -> yast2-update-3.1.8.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.7/package/yast2-update.changes new/yast2-update-3.1.8/package/yast2-update.changes
--- old/yast2-update-3.1.7/package/yast2-update.changes 2014-05-02 14:48:15.000000000 +0200
+++ new/yast2-update-3.1.8/package/yast2-update.changes 2014-05-15 11:22:50.000000000 +0200
@@ -1,4 +1,12 @@
-------------------------------------------------------------------
+Thu May 15 09:17:19 CEST 2014 - locilka@suse.com
+
+- Added handling for desktop upgrade (bnc#874116). Moved from code
+ to control file as packages and patterns might have different
+ names in different prducts.
+- 3.1.8
+
+-------------------------------------------------------------------
Fri May 2 12:36:53 UTC 2014 - jreidinger@suse.com
- Fix internal error caused by wrong type passed as string append
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.7/package/yast2-update.spec new/yast2-update-3.1.8/package/yast2-update.spec
--- old/yast2-update-3.1.7/package/yast2-update.spec 2014-05-02 14:48:15.000000000 +0200
+++ new/yast2-update-3.1.8/package/yast2-update.spec 2014-05-15 11:22:50.000000000 +0200
@@ -17,7 +17,7 @@
Name: yast2-update
-Version: 3.1.7
+Version: 3.1.8
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.7/src/modules/Update.rb new/yast2-update-3.1.8/src/modules/Update.rb
--- old/yast2-update-3.1.7/src/modules/Update.rb 2014-05-02 14:48:15.000000000 +0200
+++ new/yast2-update-3.1.8/src/modules/Update.rb 2014-05-15 11:22:50.000000000 +0200
@@ -743,69 +743,60 @@
Builtins.maplist(patterns) { |p| Ops.get_string(p, "name", "") }
end
+ # Searches the mounted system ready for ugrade for current desktop
+ # and selects resolvables matching this desktop in new product as
+ # it is defined in control file software->upgrade->window_managers
+ #
+ # @return [Boolean] whether selecting resolvables have succeeded
+ def SetDesktopPattern
+ upgrade_settings = ProductFeatures.GetFeature("software", "upgrade")
- def ReadInstalledDesktop
- SCR.Execute(
- path(".target.bash"),
- "/bin/mv -f /etc/sysconfig/windowmanager /etc/sysconfig/windowmanager.old"
- )
- SCR.Execute(
- path(".target.bash"),
- "/bin/ln -s /mnt/etc/sysconfig/windowmanager /etc/sysconfig/windowmanager"
- )
- ret = Convert.to_string(
- SCR.Read(path(".sysconfig.windowmanager.DEFAULT_WM"))
- )
- SCR.Execute(
- path(".target.bash"),
- "/bin/rm -f /etc/sysconfig/windowmanager"
- )
- SCR.Execute(
- path(".target.bash"),
- "/bin/mv -f /etc/sysconfig/windowmanager.old /etc/sysconfig/windowmanager"
- )
- ret
- end
+ if !upgrade_settings.kind_of?(Hash) || !upgrade_settings.has_key?("window_managers")
+ log.info "Desktop upgrade is not handled by this product (settings: #{upgrade_settings})"
+ return true
+ end
- # check if given package is installed in the system selected for update
- # (currently mounted under /mnt)
- def PackageInstalled(package)
- SCR.Execute(
- path(".target.bash"),
- Builtins.sformat("rpm -q %1 --root /mnt", package)
- ) == 0
- end
+ current_desktop = installed_desktop
- def SetDesktopPattern
- desktop = ReadInstalledDesktop()
- if Builtins.contains(
- ["kde", "kde4", "xfce", "lxde", "gnome", "startkde", "startkde4"],
- desktop
- )
- # 'gnome'/'startkde' could be default values even if not installed,
- # check the real state (bnc#737402)
- if desktop == "gnome"
- if !PackageInstalled("gnome-session")
- Builtins.y2milestone(
- "GNOME not present: not installing new desktop"
- )
- return
- end
- elsif desktop == "startkde" || desktop == "startkde4"
- if PackageInstalled("kdebase3-session") ||
- PackageInstalled("kdebase4-session")
- desktop = "kde4"
- else
- Builtins.y2milestone("KDE not present: not installing new desktop")
- return
- end
+ if current_desktop.nil? || current_desktop.empty?
+ log.warn "Cannot read default window manager from sysconfig"
+ return true
+ end
+
+ selected_desktop = upgrade_settings["window_managers"].find do |wm|
+ unless wm["sysconfig_wm"]
+ log.error "'sysconfig_wm' must be defined in #{wm}"
+ next
end
+ wm["sysconfig_wm"].strip == current_desktop
+ end
- Builtins.y2milestone("Selecting pattern to install: %1", desktop)
- Pkg.ResolvableInstall(desktop, :pattern)
+ if !selected_desktop
+ log.info "No matching desktop found for #{current_desktop}"
+ return true
end
- nil
+ # If the current default desktop is not installed, it's a valid use case
+ # and we don't continue further
+ return true unless packages_installed?(selected_desktop.fetch("check_packages", "").split)
+
+ install_patterns = selected_desktop.fetch("install_patterns", "").split
+ failed_patterns = select_for_installation(:pattern, install_patterns)
+
+ install_packages = selected_desktop.fetch("install_packages", "").split
+ failed_packages = select_for_installation(:package, install_packages)
+
+ failed_patterns.empty? or Report.Error(
+ _("Cannot select these patterns required for installation:\n%{patterns}") %
+ {:patterns => failed_patterns.join("\n")}
+ )
+
+ failed_packages.empty? or Report.Error(
+ _("Cannot select these packages required for installation:\n%{packages}") %
+ {:packages => failed_packages.join("\n")}
+ )
+
+ failed_patterns.empty? && failed_packages.empty?
end
#
@@ -817,13 +808,6 @@
nil
end
- def TextsUsedInFuture
- # TRANSLATORS: check-box, it might happen that we need to downgrade some packages during update
- aaa = _("Allow Package Downgrade")
-
- nil
- end
-
# Returns product installed on root partition mounted to Installation.destdir
# If not found, nil is returned
#
@@ -879,6 +863,79 @@
publish :function => :SetDesktopPattern, :type => "void ()"
publish :function => :Detach, :type => "void ()"
publish :function => :installed_product, :type => "string ()"
+
+ private
+
+ # Reads the currently selected default desktop from sysconfig
+ # and returns it
+ #
+ # @return [String] current default desktop
+ def installed_desktop
+ windowmanager_sysconfig = File.join(
+ Installation.destdir, "/etc/sysconfig/windowmanager"
+ )
+
+ if !FileUtils.Exists(windowmanager_sysconfig)
+ log.warn "Sysconfig file #{windowmanager_sysconfig} does not exist, " <<
+ "desktop upgrade will not be handled"
+ return nil
+ end
+
+ Misc.CustomSysconfigRead("DEFAULT_WM", "", windowmanager_sysconfig).strip
+ end
+
+ # Selects resolvables for installation and returns list of failed resolvables
+ #
+ # @param [Symbol] resolvable type
+ # @param [Array] list of resolvables for installation
+ # @return [Array] list of failed resolvables
+ def select_for_installation(resolvable_type, resolvables)
+ failed_resolvables = []
+ return failed_resolvables if resolvables.empty?
+
+ log.info "Selecting required #{resolvable_type}s #{resolvables}"
+
+ resolvables.each do |resolvable|
+ next if resolvable.nil? || resolvable.empty?
+
+ unless Pkg.ResolvableInstall(resolvable, resolvable_type)
+ failed_resolvables << resolvable
+ log.error "Cannot select #{resolvable_type} #{resolvable} for installation"
+ end
+ end
+
+ failed_resolvables
+ end
+
+ # check if given package is installed in the system selected for update
+ # (currently mounted under Installation.destdir)
+ #
+ # @param [String] package name
+ # @return [Boolean] whether the given package is installed
+ def package_installed?(package)
+ package_installed = SCR.Execute(
+ path(".target.bash"),
+ Builtins.sformat("rpm -q '#{package}' --root '#{Installation.destdir}'")
+ ) == 0
+
+ log.info "Package #{package} installed: #{package_installed}"
+ package_installed
+ end
+
+ # Returns whether all packages given as parameter are installed on the system
+ #
+ # @param [Array] list of packages
+ # @return [Boolean] whether all of packages are installed
+ def packages_installed?(packages)
+ desktop_installed = packages.all? do |package|
+ package_installed?(package)
+ end
+
+ log.info "Not all packages from list #{packages} are installed" unless desktop_installed
+
+ desktop_installed
+ end
+
end
Update = UpdateClass.new
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-update-3.1.7/test/data/control-files/desktop-upgrade.xml new/yast2-update-3.1.8/test/data/control-files/desktop-upgrade.xml
--- old/yast2-update-3.1.7/test/data/control-files/desktop-upgrade.xml 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-update-3.1.8/test/data/control-files/desktop-upgrade.xml 2014-05-15 11:22:50.000000000 +0200
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<productDefines xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
+ <software>
+ <upgrade>
+