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 -> sle12
## BNC# 873877 : "after sled installation, grub2 show the boot menu as sles" (ASSIGNED/)
Changes:
--------
--- /work/SRC/SUSE:SLE-12:GA/yast2/yast2.changes 2014-04-22 15:50:07.000000000 +0200
+++ /mounts/work_src_done/SLE12/yast2/yast2.changes 2014-04-25 15:48:29.000000000 +0200
@@ -1,0 +2,7 @@
+Thu Apr 24 15:59:44 CEST 2014 - locilka@suse.com
+
+- Product library changed to read data only from os-release and
+ libzypp (bnc#873877), no more from content file
+- 3.1.54
+
+-------------------------------------------------------------------
calling whatdependson for sle12-i586
Packages directly triggered for rebuild:
- yast2
- at least 73 other packages
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/SUSE:SLE-12:GA/yast2 (Old)
and /mounts/work_src_done/SLE12/yast2 (BS:build ID:36794 MAIL:yast-commit@opensuse.org) (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2", Maintainer is "yast-commit@opensuse.org"
Old:
----
yast2-3.1.53.tar.bz2
New:
----
yast2-3.1.54.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2.spec ++++++
--- /var/tmp/diff_new_pack.XPVvvZ/_old 2014-04-28 14:38:45.000000000 +0200
+++ /var/tmp/diff_new_pack.XPVvvZ/_new 2014-04-28 14:38:45.000000000 +0200
@@ -17,7 +17,7 @@
Name: yast2
-Version: 3.1.53
+Version: 3.1.54
Release: 0
URL: https://github.com/yast/yast-yast2
++++++ yast2-3.1.53.tar.bz2 -> yast2-3.1.54.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-3.1.53/library/packages/src/modules/Product.rb new/yast2-3.1.54/library/packages/src/modules/Product.rb
--- old/yast2-3.1.53/library/packages/src/modules/Product.rb 2014-04-22 15:11:17.000000000 +0200
+++ new/yast2-3.1.54/library/packages/src/modules/Product.rb 2014-04-25 15:41:15.000000000 +0200
@@ -35,222 +35,252 @@
include Yast::Logger
- CONTENT_FILE = "/content"
-
def main
Yast.import "Pkg"
-
Yast.import "Mode"
Yast.import "Stage"
Yast.import "OSRelease"
Yast.import "PackageLock"
Yast.import "PackageSystem"
- Yast.import "FileUtils"
+ end
- # General product name and version
- @name = "" # "SuSE Linux 8.1"
- @short_name = "" # "SuSE Linux"
- @version = "" # "8.1"
- @vendor = "" # "SuSE Linux AG"
-
- # Distribution: Personal, Professional, etc.
- @dist = ""
- @distproduct = "" # "SuSE-Linux-Professional-INT-i386"
- @distversion = "" # "8.1-0"
-
- # base product
- @baseproduct = "" # "UnitedLinux"
- @baseversion = "" # "1.0"
-
- # url of release notes (downloaded during internet test)
- @relnotesurl = ""
-
- # list of all urls of release notes (downloaded during internet test)
- # bugzilla #160563
- @relnotesurl_all = []
-
- # map relnotes url to product name
- @product_of_relnotes = {}
-
- # Run YOU during the Internet connection test.
- @run_you = true
-
- # list of flags from content file
- @flags = []
-
- # Short label for bootloader entry
- @shortlabel = ""
- Product()
+ # Loads and returns base product property
+ #
+ # @param [Symbol] key (optional)
+ def find_property(key = __callee__)
+ load_product_data(key)
+ get_property(key)
end
+ # Long product name including version
+ alias_method :name, :find_property
+
+ # Short product name
+ alias_method :short_name, :find_property
+
+ # Product version
+ alias_method :version, :find_property
+
+ # Boolean whether product requires to run online update
+ alias_method :run_you, :find_property
+
+ # Array of Strings - Product flags such as "no_you"
+ alias_method :flags, :find_property
+
+ # URL to release notes
+ alias_method :relnotesurl, :find_property
+
+ # Array of URLs of all release notes
+ alias_method :relnotesurl_all, :find_property
+
+ # Hash of { URL => product_name } pairs
+ alias_method :product_of_relnotes, :find_property
+
+ # Values loaded from os-release file
+ OS_RELEASE_PROPERTIES = [
+ :name, :short_name, :version
+ ]
+
+ # All these methods have been dropped
+ DROPPED_METHODS = [
+ :vendor, :dist, :distproduct, :distversion, :shortlabel
+ ]
+
+ # Returns list of selected (installation) or installed (running system)
+ # base products got from libzypp
+ #
+ # @return [Hash] products
def FindBaseProducts
- # bugzilla #238556
- if !PackageLock.Check
- Builtins.y2error("Locked!")
- return []
- end
+ return unless load_zypp
- Builtins.y2milestone("Looking for base products")
- products = Pkg.ResolvableProperties("", :product, "")
- expected_status = Stage.initial ? :selected : :installed
- products = products.select do |p|
- p["status"] == expected_status
- end
-
- Builtins.y2milestone("All found products: %1", products)
-
- products = Builtins.filter(products) do |p|
- # bug 165314, relnotes_url needn't be defined (or empty string)
- if Ops.get_string(p, "relnotes_url", "") != ""
- rn_url = Ops.get_string(p, "relnotes_url", "")
- @relnotesurl_all = Builtins.add(@relnotesurl_all, rn_url)
- # bug 180581, relnotes should be identified by name
- Ops.set(
- @product_of_relnotes,
- rn_url,
- Ops.get_string(p, "display_name", "")
- )
- end
- Stage.initial ? (p["source"] == 0) : (p["category"] == "base")
+ log.info "Looking for base products"
+
+ products = Pkg.ResolvableProperties("", :product, "").dup || []
+ required_status = use_installed_products? ? :installed : :selected
+ products.select!{ |p| p["status"] == required_status }
+
+ log.info "All #{required_status} products: #{products}"
+
+ # For all (not only base) products
+ fill_up_relnotes(products)
+
+ # Use only base products
+ products.select! do |p|
+ use_installed_products? ? (p["category"] == "base") : (p["source"] == 0)
end
- Builtins.y2milestone("Found base products: %1", products)
- if Builtins.size(products) == 0
- Builtins.y2error("No base product found")
- raise "No base product for installation found" if Stage.initial
- elsif Ops.greater_than(Builtins.size(products), 1)
- Builtins.y2warning("More than one base product found")
+ log.info "Found #{products.size} base product(s)"
+
+ if products.empty?
+ log.error "No base product found"
+ raise "No #{required_status} base product found"
+ elsif products.size > 1
+ log.warn "More than one base product found!"
end
+
deep_copy(products)
end
- # Read the products from the package manager
+ # Reads products from libzypp and fills the internal products cache
+ # that can be read by other methods in this library
def ReadProducts
- Builtins.y2milestone("Product::ReadProducts() started")
- if !Mode.config
- # bugzilla #238556
- if !PackageLock.Check
- Builtins.y2error("Locked!")
- return
- end
-
- PackageSystem.EnsureTargetInit
- PackageSystem.EnsureSourceInit # TODO: is it still needed?
+ # Do not read any product information from zypp on a running system
+ return if Mode.config
- # run the solver to compute the installed products
- Pkg.PkgSolve(true) # TODO: is it still needed?
+ Builtins.y2milestone("Product.#{__method__} started")
+ return unless load_zypp
- base_products = FindBaseProducts()
- base_product = Ops.get(base_products, 0, {}) # there should be only one - hopefuly
+ base_product = FindBaseProducts().fetch(0, {})
- @name = Ops.get_string(
- base_product,
- "display_name",
- Ops.get_string(
- base_product,
- "summary",
- Ops.get_string(base_product, "name", "")
+ set_property(
+ :name,
+ base_product.fetch("display_name",
+ base_product.fetch("summary",
+ base_product.fetch("name", "")
)
)
- @short_name = Ops.get_string(base_product, "short_name", @name)
- @version = Ops.get_string(base_product, "version", "")
- @vendor = Ops.get_string(base_product, "vendor", "")
- @relnotesurl = Ops.get_string(base_product, "relnotes_url", "")
- @flags = Ops.get_list(base_product, "flags", [])
- end
+ )
+
+ set_property(:short_name, base_product.fetch("short_name", name))
+ set_property(:version, base_product.fetch("version", "").split("-")[0])
+ set_property(:relnotesurl, base_product.fetch("relnotes_url", ""))
+ set_property(:flags, base_product.fetch("flags", []))
+ set_property(:run_you, flags.include?("no_you"))
nil
end
- def can_use_content_file?
- FileUtils.Exists(CONTENT_FILE) && !Mode.live_installation
- end
+ private
+ # Is it possible to use os-release file?
def can_use_os_release_file?
- OSRelease.os_release_exists?
+ !Stage.initial && !Mode.installation && OSRelease.os_release_exists?
end
- # -----------------------------------------------
- # Constructor
- def Product
- if can_use_os_release_file?
- read_os_release_file
- elsif can_use_content_file?
- read_content_file
+ # Whether to use :installed or :selected products
+ def use_installed_products?
+ !Mode.installation || Mode.live_installation
+ end
+
+ # Ensures that we can load data from libzypp
+ def load_zypp
+ if !PackageLock.Check
+ Builtins.y2error("Packager is locked, can't read product info!")
+ return false
+ end
+
+ if use_installed_products?
+ PackageSystem.EnsureTargetInit
else
- raise "Cannot determine the product. Neither from the content, nor the os-relese file"
+ PackageSystem.EnsureSourceInit
end
- @distproduct = "" if @distproduct == nil
- @dist = @distproduct.split("-")[2] || ""
+ Pkg.PkgSolve(true)
+ end
- @run_you = !@flags.include?("no_you")
+ # Reads basic product information from os-release file
+ #
+ # @return [Boolean] whether all the data have been successfully loaded
+ def read_os_release_file
+ set_property(:short_name, OSRelease.ReleaseName)
+ set_property(:version, OSRelease.ReleaseVersion)
+ set_property(:name, OSRelease.ReleaseInformation)
+
+ return OS_RELEASE_PROPERTIES.all?{ |key| !get_property(key).nil? and !get_property(key).empty? }
+ end
+
+ # Uses products information to fill up release-notes variables
+ def fill_up_relnotes(products)
+ all_release_notes = []
+ release_notes_to_product = {}
+
+ products.map do |p|
+ if p["relnotes_url"] != ""
+ url = p["relnotes_url"]
+ all_release_notes << url
+ release_notes_to_product[url] = (p["display_name"] || "")
+ end
+ end
- # set the product name for UI
- Yast.import "Wizard"
+ set_property(:relnotesurl_all, all_release_notes)
+ set_property(:product_of_relnotes, release_notes_to_product)
+ end
- Builtins.y2milestone("Product name: '%1'", @name)
+ # Fills up internal product data
+ #
+ # @param [Symbol] key
+ # @param [Any] value
+ def set_property(key, value)
+ current_value = get_property(key)
+
+ # Redefining already existent information
+ if !current_value.nil? && !current_value.empty? && current_value != value
+ if value.nil? || value == ""
+ log.error "Ignoring setting new Product property #{key} (#{current_value}) to new value '#{value}'"
+ return
+ else
+ log.warn "Redefining Product property #{key} (#{current_value}) to new value '#{value}'"
+ end
+ end
- Wizard.SetProductName(@name) if @name != nil && @name != ""
+ @product[key] = value
+ end
- nil
+ # Returns product property
+ #
+ # @param [Symbol] key
+ def get_property(key)
+ @product[key]
end
- private
+ # Loads product information from os-release or libzypp
+ def load_product_data(key)
+ @product ||= {}
- def read_content_file
- # it should use the same mechanism as running system. But it would
- # mean to initialize package manager from constructor, which is
- # not reasonable
- @name = SCR.Read(path(".content.LABEL"))
- @short_name = SCR.Read(path(".content.SHORTLABEL"))
- @short_name ||= @name
-
- @version = SCR.Read(path(".content.VERSION"))
- @vendor = SCR.Read(path(".content.VENDOR"))
-
- @distproduct = SCR.Read(path(".content.DISTPRODUCT"))
- @distversion = SCR.Read(path(".content.DISTVERSION"))
-
- @baseproduct = SCR.Read(path(".content.BASEPRODUCT"))
- @baseproduct = @name if @baseproduct == ""
- @baseversion = SCR.Read(path(".content.BASEVERSION"))
+ current_value = get_property(key)
+ # Already loaded
+ return if !current_value.nil?
- @relnotesurl = SCR.Read(path(".content.RELNOTESURL"))
- @shortlabel = SCR.Read(path(".content.SHORTLABEL"))
+ # Try to read the data from os-release (fast)
+ if OS_RELEASE_PROPERTIES.include?(key) && can_use_os_release_file?
+ return if read_os_release_file
+ log.warn "Incomplete os-release file, continue reading from zypp"
+ end
+
+ # Read from libzypp (expensive)
+ ReadProducts()
- @flags = (SCR.Read(path(".content.FLAGS")) || "").split
+ raise "Cannot determine the base product property #{key}" if get_property(key).nil?
end
- def read_os_release_file
- @short_name = OSRelease.ReleaseName
- @version = OSRelease.ReleaseVersion
+ # Needed for testing and internal cleanup
+ # Resets internal cache
+ def reset
+ @product = nil
+ end
- @name = OSRelease.ReleaseInformation
- if @name.empty?
- @name = "#{@short_name} #{@version}"
- log.warn "OSRelease.ReleaseInformation is empty, using default product name: #{@name}"
+ # Handles using dropped methods
+ def method_missing(method_name, *args, &block)
+ if DROPPED_METHODS.include? method_name
+ log.error "Method Product.#{method_name} dropped"
+ raise "Method Product.#{method_name} has been dropped"
+ else
+ super
end
end
- publish :variable => :name, :type => "string"
- publish :variable => :short_name, :type => "string"
- publish :variable => :version, :type => "string"
- publish :variable => :vendor, :type => "string"
- publish :variable => :dist, :type => "string"
- publish :variable => :distproduct, :type => "string"
- publish :variable => :distversion, :type => "string"
- publish :variable => :baseproduct, :type => "string"
- publish :variable => :baseversion, :type => "string"
- publish :variable => :relnotesurl, :type => "string"
- publish :variable => :relnotesurl_all, :type => "list <string>"
- publish :variable => :product_of_relnotes, :type => "map