commit yast2-packager for openSUSE:Factory
Hello community, here is the log from the commit of package yast2-packager for openSUSE:Factory checked in at 2017-08-02 11:26:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-packager (Old) and /work/SRC/openSUSE:Factory/.yast2-packager.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-packager" Wed Aug 2 11:26:40 2017 rev:338 rq:512861 version:3.3.2 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-packager/yast2-packager.changes 2017-07-22 02:31:59.147403795 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-packager.new/yast2-packager.changes 2017-08-02 11:26:43.330443760 +0200 @@ -1,0 +2,16 @@ +Thu Jul 27 11:12:01 CEST 2017 - schubi@suse.de + +- AutoYaST: Configuring EULA acceptance of add-on products has + not worked if the add-on product is on the medium of the base + product too. (bnc#1032523). + Now the add-on product has to be defined in the AutoYaST + configuration file explicit. +- 3.3.2 + +------------------------------------------------------------------- +Wed Jul 26 14:18:31 UTC 2017 - jreidinger@suse.com + +- drop reading "/content" file (FATE#322386) +- 3.3.1 + +------------------------------------------------------------------- Old: ---- yast2-packager-3.3.0.tar.bz2 New: ---- yast2-packager-3.3.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-packager.spec ++++++ --- /var/tmp/diff_new_pack.4ezJ5D/_old 2017-08-02 11:26:45.174183092 +0200 +++ /var/tmp/diff_new_pack.4ezJ5D/_new 2017-08-02 11:26:45.178182527 +0200 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 3.3.0 +Version: 3.3.2 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-packager-3.3.0.tar.bz2 -> yast2-packager-3.3.2.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.3.0/package/yast2-packager.changes new/yast2-packager-3.3.2/package/yast2-packager.changes --- old/yast2-packager-3.3.0/package/yast2-packager.changes 2017-07-20 13:40:44.767976013 +0200 +++ new/yast2-packager-3.3.2/package/yast2-packager.changes 2017-07-28 09:44:36.217816176 +0200 @@ -1,4 +1,20 @@ ------------------------------------------------------------------- +Thu Jul 27 11:12:01 CEST 2017 - schubi@suse.de + +- AutoYaST: Configuring EULA acceptance of add-on products has + not worked if the add-on product is on the medium of the base + product too. (bnc#1032523). + Now the add-on product has to be defined in the AutoYaST + configuration file explicit. +- 3.3.2 + +------------------------------------------------------------------- +Wed Jul 26 14:18:31 UTC 2017 - jreidinger@suse.com + +- drop reading "/content" file (FATE#322386) +- 3.3.1 + +------------------------------------------------------------------- Thu Jul 20 06:44:42 UTC 2017 - lslezak@suse.cz - Less strict low memory detection, there might be some rounding diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.3.0/package/yast2-packager.spec new/yast2-packager-3.3.2/package/yast2-packager.spec --- old/yast2-packager-3.3.0/package/yast2-packager.spec 2017-07-20 13:40:44.767976013 +0200 +++ new/yast2-packager-3.3.2/package/yast2-packager.spec 2017-07-28 09:44:36.217816176 +0200 @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 3.3.0 +Version: 3.3.2 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.3.0/src/clients/inst_mediacopy.rb new/yast2-packager-3.3.2/src/clients/inst_mediacopy.rb --- old/yast2-packager-3.3.0/src/clients/inst_mediacopy.rb 2017-07-20 13:40:44.807976013 +0200 +++ new/yast2-packager-3.3.2/src/clients/inst_mediacopy.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,147 +0,0 @@ -# encoding: utf-8 - -# Module: inst_mediacopy.ycp -# -# Authors: Anas Nashif <nashif@suse.de> -# -# Purpose: Copy Media to local disk -# -# $Id$ -# -module Yast - class InstMediacopyClient < Client - def main - Yast.import "Pkg" - textdomain "packager" - - Yast.import "Label" - Yast.import "Popup" - Yast.import "Wizard" - Yast.import "Packages" - Yast.import "PackageCallbacks" - Yast.import "PackageCallbacksInit" - Yast.import "Installation" - Yast.import "GetInstArgs" - Yast.import "String" - - @source_list = [] - - # full initialization is required for Pkg::SourceMediaData() - Packages.Init(true) - @num = Builtins.size(Packages.theSources) - if Ops.less_or_equal(@num, 0) - Builtins.y2error("No repository") - else - Builtins.foreach(Packages.theSources) do |i| - new_product = Pkg.SourceProductData(i) - @source_list = Builtins.add( - @source_list, - Item( - Id(i), - Ops.get_string(new_product, "productname", "?"), - Ops.get_string(new_product, "productversion", "?") - ) - ) - end - end - - # dialog heading - @heading_text = _("Copy Installation Media") - # help text - @help_text = _( - "<p>The installation CDs will be copied into the system\n" + - "to create a repository that can be used to install\n" + - "other systems.</p>\n" - ) - # label for showing repositories - @label = _("Registered Repositories") - - @contents = VBox( - HCenter( - HSquash( - VBox( - HSpacing(40), # force minimum width - Left(Label(@label)), - Table(Id(:sources), Header(_("Name"), _("Version")), @source_list) - ) - ) - ), - VSpacing(2) - ) - - Wizard.SetContents( - @heading_text, - @contents, - @help_text, - GetInstArgs.enable_back, - GetInstArgs.enable_next - ) - - @dest = "" - if SCR.Read(path(".target.dir"), Ops.add(Installation.destdir, "/export")) == nil - SCR.Execute( - path(".target.mkdir"), - Ops.add(Installation.destdir, "/export") - ) - end - @dest = Ops.add(Installation.destdir, "/export") - - PackageCallbacksInit.SetMediaCallbacks - - @s = Pkg.SourceGetCurrent(false) - Builtins.y2milestone("%1", @s) - - Builtins.foreach(@s) do |source| - md = Pkg.SourceMediaData(source) - pd = Pkg.SourceProductData(source) - distprod = Ops.get_string(pd, "label", "") - l = Builtins.splitstring(distprod, " ") - distprod = Builtins.mergestring(l, "-") - updir = Convert.to_string(SCR.Read(path(".etc.install_inf.UpdateDir"))) - __export = "" - if updir == nil - __export = Ops.add(@dest, "/dist") - else - __export = Ops.add(@dest, updir) - end - changed_url = false - i = 1 - while Ops.less_or_equal(i, Ops.get_integer(md, "media_count", 0)) - tgt = Builtins.sformat("%1/%2/CD%3", __export, distprod, i) - Builtins.y2debug("tgt: %1", tgt) - #Popup::Message(sformat(_("Before... %1"), i )); - dir = Pkg.SourceProvideDirectory(source, i, ".", false, false) - #Popup::Message(sformat(_("After... %1"), i )); - if dir != nil - # feedback popup 1/2 - Popup.ShowFeedback( - _("Copying CD contents to a local directory..."), - # feedback popup 2/2 - _("Please wait...") - ) - SCR.Execute(path(".target.mkdir"), tgt) - #string cmd = sformat("cd %1 && tar cf - . | (cd %2 && tar xBf -)", dir, tgt); - cmd = Builtins.sformat( - "cp '%1/content' '%2'", - String.Quote(Builtins.tostring(dir)), - String.Quote(tgt) - ) - SCR.Execute(path(".target.bash"), cmd) - - if !changed_url - Pkg.SourceChangeUrl(source, Ops.add("dir://", tgt)) - changed_url = true - end - - Popup.ClearFeedback - end - i = Ops.add(i, 1) - end - end - - :next - end - end -end - -Yast::InstMediacopyClient.new.main diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.3.0/src/modules/AddOnProduct.rb new/yast2-packager-3.3.2/src/modules/AddOnProduct.rb --- old/yast2-packager-3.3.0/src/modules/AddOnProduct.rb 2017-07-20 13:40:44.883976013 +0200 +++ new/yast2-packager-3.3.2/src/modules/AddOnProduct.rb 2017-07-28 09:44:36.241816176 +0200 @@ -780,119 +780,19 @@ nil end - # Checks whether the content file of the add-on has a flag REGISTERPRODUCT - # set to "true" or "yes". If it has, product is added into list of pruducts - # that need registration. Cached content file is used if possible. + # Checks whether the addon at src_id need registration + # If it has, product is added into list of products that need registration. # # @param [Fixnum] src_id source id def PrepareForRegistration(src_id) control_file = WorkflowManager.GetCachedWorkflowFilename(:addon, src_id, ""); - if WorkflowManager.IncorporateControlFileOptions(control_file) == true + return unless WorkflowManager.IncorporateControlFileOptions(control_file) # FATE #305578: Add-On Product Requiring Registration - if WorkflowManager.WorkflowRequiresRegistration(src_id) - Builtins.y2milestone("REGISTERPRODUCT (require_registration) defined in control file") - @addons_requesting_registration << deep_copy(src_id) - return nil - end - end - - - tmpdir = Ops.add( - Convert.to_string(SCR.Read(path(".target.tmpdir"))), - "/add-on-content-files/" - ) - - # create directory if doesn't exist - if !FileUtils.Exists(tmpdir) - run = Convert.to_integer( - SCR.Execute( - path(".target.bash"), - Builtins.sformat("/bin/mkdir -p '%1'", tmpdir) - ) - ) - if run != 0 - Builtins.y2error("Cannot create directory %1", tmpdir) - return nil - end - end + return unless WorkflowManager.WorkflowRequiresRegistration(src_id) - # use cached file if possible - contentfile = Builtins.sformat("%1content-%2", tmpdir, src_id) - if FileUtils.Exists(contentfile) - Builtins.y2milestone("Using cached contentfile %1", contentfile) - else - Builtins.y2milestone("Checking contentfile from repository") - sourcefile = GetCachedFileFromSource( - src_id, - 1, - "/content", - "signed", - true - ) - if sourcefile == nil - Builtins.y2warning("Cannot obtain content file!") - return nil - end - # copying content file - run = Convert.to_integer( - SCR.Execute( - path(".target.bash"), - Builtins.sformat( - "/bin/cp '%1' '%2'", - String.Quote(sourcefile), - String.Quote(contentfile) - ) - ) - ) - if run != 0 - Builtins.y2error("Cannot copy '%1' to '%2'", sourcefile, contentfile) - return nil - end - end - - # registering agent for the current content file - SCR.RegisterAgent( - path(".addon.content"), - term( - :ag_ini, - term( - :IniAgent, - contentfile, - { - "options" => ["read_only", "global_values", "flat"], - "comments" => ["^#.*", "^[ \t]*$"], - "params" => [ - { - "match" => [ - "^[ \t]*([a-zA-Z0-9_.]+)[ \t]*(.*)[ \t]*$", - "%s %s" - ] - } - ] - } - ) - ) - ) - register_product = Convert.to_string( - SCR.Read(path(".addon.content.REGISTERPRODUCT")) - ) - SCR.UnregisterAgent(path(".addon.content")) - - # evaluating REGISTERPRODUCT flag, default (nil == false) - Builtins.y2milestone( - "RegisterProduct flag for repository %1 is %2", - src_id, - register_product - ) - if register_product == "yes" || register_product == "true" - @addons_requesting_registration = Builtins.add( - @addons_requesting_registration, - src_id - ) - end - - nil + log.info "REGISTERPRODUCT (require_registration) defined in control file" + @addons_requesting_registration << deep_copy(src_id) end # Calls registration client if needed. @@ -900,7 +800,6 @@ # @param [Fixnum] src_id source id def RegisterAddOnProduct(src_id) # FATE #305578: Add-On Product Requiring Registration - # or check the content file if WorkflowManager.WorkflowRequiresRegistration(src_id) || Builtins.contains(@addons_requesting_registration, src_id) Builtins.y2milestone("Repository ID %1 requests registration", src_id) @@ -1006,146 +905,6 @@ "Add-On-Product-ID:#{src_id}" end - # See also DeselectProductPatterns() - def SelectProductPatterns(content_file, src_id) - patterns_to_select = [] - - if content_file && File.exist?(content_file) - contentmap = Convert.to_map(SCR.Read(path(".content_file"), content_file)) || {} - - # no PATTERNS defined - if !contentmap.key?("PATTERNS") - log.info "Add-On doesn't have any required patterns (PATTERNS in content)" - end - - # parsing PATTERNS - patterns_to_select = contentmap.fetch("PATTERNS", "").split(/[\t ]/) - patterns_to_select.reject! { |p| p.nil? || p.empty? } - end - - product_patterns = ProductPatterns.new(src: @src_id) - log.info "Found default product patterns: #{product_patterns.names}" - patterns_to_select.concat(product_patterns.names) - patterns_to_select.uniq! - - log.info "Add-On requires these patterns: #{patterns_to_select.inspect}" - - # clear/set - @patterns_preselected_by_addon[src_id] = [] - - # bnc #458297 - # Using PackagesProposal to select the patterns itself - PackagesProposal.SetResolvables( - PackagesProposalAddonID(src_id), - :pattern, - patterns_to_select - ) - - if Stage.initial - log.info "Using PackagesProposal to select Add-On patterns" - return true - end - - ret = true - - Builtins.foreach(patterns_to_select) do |one_pattern| - pattern_properties = Pkg.ResolvableProperties(one_pattern, :pattern, "") - already_selected = false - Builtins.foreach(pattern_properties) do |one_pattern_found| - patt_status = Ops.get_symbol(one_pattern_found, "status", :unknown) - # patern is already selected - if patt_status == :installed || patt_status == :selected - already_selected = true - raise Break - end - end - if already_selected - Builtins.y2milestone( - "Pattern %1 is already installed/selected", - one_pattern - ) - next - end - if !Pkg.ResolvableInstall(one_pattern, :pattern) - Builtins.y2error( - "Cannot select pattern: %1, reason: %2", - one_pattern, - Pkg.LastError - ) - ret = false - else - Ops.set( - @patterns_preselected_by_addon, - src_id, - Builtins.add( - Ops.get(@patterns_preselected_by_addon, src_id, []), - one_pattern - ) - ) - end - end - - ret - end - - - # See also SelectProductPatterns() - def DeselectProductPatterns(src_id) - # bnc #458297 - # Using PackagesProposal to deselect the patterns itself - PackagesProposal.SetResolvables( - PackagesProposalAddonID(src_id), - :pattern, - [] - ) - - if Stage.initial - Builtins.y2milestone( - "Initial stage, using PackagesProposal to deselect patterns" - ) - return true - end - - patterns_to_deselect = Ops.get(@patterns_preselected_by_addon, src_id, []) - - if Builtins.size(patterns_to_deselect) == 0 - Builtins.y2milestone("There's no pattern to be deselected") - return true - end - - ret = true - - Builtins.foreach(patterns_to_deselect) do |one_pattern| - if !Pkg.ResolvableNeutral(one_pattern, :pattern, true) - Builtins.y2error( - "Cannot deselect pattern: %1, reason: %2", - one_pattern, - Pkg.LastError - ) - ret = false - end - end - - ret - end - def HandleProductPATTERNS(srcid) - # FATE #302398: PATTERNS keyword in content file - content_file = GetCachedFileFromSource( - srcid, - 1, - "/content", - "signed", - true - ) - - if content_file == nil - Builtins.y2warning("Add-On %1 doesn't have a content file", srcid) - end - - SelectProductPatterns(content_file, srcid) - - nil - end def IntegrateReleaseNotes(repo_id) products = Pkg.ResolvableProperties("", :product, ""). select do |product| @@ -1196,7 +955,8 @@ end # FATE #302398: PATTERNS keyword in content file - HandleProductPATTERNS(srcid) + # changed for software section in installation.xml + # or 'defaultpattern()' product Provides (FATE#320199) # Adds workflow to the Workflow Store if any workflow exists WorkflowManager.AddWorkflow(:addon, srcid, "") @@ -1211,8 +971,6 @@ # # @param [Fixnum] srcid integer the ID of the repository def Disintegrate(srcid) - DeselectProductPatterns(srcid) - WorkflowManager.RemoveWorkflow(:addon, srcid, "") nil diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-packager-3.3.0/src/modules/Packages.rb new/yast2-packager-3.3.2/src/modules/Packages.rb --- old/yast2-packager-3.3.0/src/modules/Packages.rb 2017-07-20 13:40:44.927976013 +0200 +++ new/yast2-packager-3.3.2/src/modules/Packages.rb 2017-07-28 09:44:36.245816176 +0200 @@ -46,6 +46,7 @@ def main Yast.import "UI" Yast.import "Pkg" + Yast.import "Mode" textdomain "packager" @@ -280,17 +281,11 @@ # Return information about suboptimal distribution if relevant # @return [String] the information string or empty string def InfoAboutSubOptimalDistribution - # warn about suboptimal distribution - # this depends on the kernel - dp = Convert.to_string(SCR.Read(path(".content.DISTPRODUCT"))) - dp = "" if dp == nil - if ProductFeatures.GetBooleanFeature( "software", "inform_about_suboptimal_distribution" ) && - Arch.i386 && - Builtins.issubstring(dp, "DVD") + Arch.i386 tmp = Convert.to_string( SCR.Read(path(".proc.cpuinfo.value.\"0\".\"flags\"")) ) @@ -838,7 +833,13 @@ "Found list of add-on products to preselect: %1", @add_on_products_list ) - AddOnProduct.AddPreselectedAddOnProducts(@add_on_products_list) + if Mode.auto + Builtins.y2warning( "This is an AutoYaST installation. "\ + "Only Add-on products will be added which have been defined "\ + "in the add-on section of the AutoYaST configuration file." ) + else + AddOnProduct.AddPreselectedAddOnProducts(@add_on_products_list) + end @add_on_products_list = [] # do not select them any more end @@ -1157,33 +1158,6 @@ install_list end - # Check whether content file in the specified repository is the same - # as the one in the ramdisk - # @param [Fixnum] source integer the repository ID to check - # @return [Boolean] true if content files match - def CheckContentFile(source) - Builtins.y2milestone("Checking content file") - instmode = Linuxrc.InstallInf("InstMode") - if !(instmode == nil || instmode == "cd" || instmode == "dvd") - Builtins.y2milestone( - "Installing via network, not checking the content file" - ) - return true - end - if !File.exists?("/content") - Builtins.y2milestone( - "Ramdisk does not contain content file, not checking the file on media" - ) - return true - end - media_content = Pkg.SourceProvideSignedFile(source, 1, "/content", false) - media = Convert.to_string(SCR.Read(path(".target.string"), media_content)) - ramdisk = Convert.to_string(SCR.Read(path(".target.string"), "/content")) - ret = media == ramdisk - Builtins.y2milestone("Content files are the same: %1", ret) - ret - end - # Import GPG keys found in the inst-sys def ImportGPGKeys out = Convert.to_map( @@ -1251,24 +1225,6 @@ deep_copy(ret) end - def ContentFileProductLabel - language = Language.language - locales = LocaleVersions(Language.language) - ret = "" - Builtins.foreach(locales) do |loc| - if ret == "" - val = Convert.to_string( - SCR.Read(Builtins.add(path(".content"), Ops.add("LABEL.", loc))) - ) - if val != "" && val != nil - ret = val - next ret - end - end - end - Convert.to_string(SCR.Read(path(".content.LABEL"))) - end - # Returns ID of the base product repository. # # @return [Fixnum] base source ID @@ -1620,8 +1576,7 @@ true end - # Adjusts repository name according to LABEL in content file - # or a first product found on the media (as a fallback). + # Adjusts repository name according to a first product found on the media. # # @param [Fixnum] src_id repository ID # @return [Boolean] if successful @@ -1635,52 +1590,18 @@ return nil end - Builtins.y2milestone("Trying to adjust repository name for: %1", src_id) + Builtins.y2milestone("Trying to get repository name from products") + all_products = Pkg.ResolvableProperties("", :product, "") new_name = nil - - # At first, try LABEL from content file - contentfile = Pkg.SourceProvideSignedFile( - src_id, # optional - 1, - "/content", - true - ) - if contentfile != nil - contentmap = Convert.to_map( - SCR.Read(path(".content_file"), contentfile) - ) - if Builtins.haskey(contentmap, "LABEL") && - Ops.get(contentmap, "LABEL") != nil && - Ops.get_string(contentmap, "LABEL", "") != "" - new_name = Ops.get_string(contentmap, "LABEL", "") - - if Builtins.regexpmatch(new_name, "^[ \t]+") - new_name = Builtins.regexpsub(new_name, "^[ \t]+(.*)", "\\1") - end - if Builtins.regexpmatch(new_name, "[ \t]+$") - new_name = Builtins.regexpsub(new_name, "(.*)[ \t]+$", "\\1") - end - - Builtins.y2milestone("Using LABEL from content file: %1", new_name) - else - Builtins.y2warning("No (useful) LABEL in product content file") - end - end - - # As a fallback, - if new_name == nil || new_name == "" - Builtins.y2milestone("Trying to get repository name from products") - all_products = Pkg.ResolvableProperties("", :product, "") - Builtins.foreach(all_products) do |one_product| - # source ID matches - if Ops.get_integer(one_product, "source", -1) == src_id - if Builtins.haskey(one_product, "name") && - Ops.get(one_product, "name") != nil && - Ops.get_string(one_product, "name", "") != "" - new_name = Ops.get_string(one_product, "name", "") - Builtins.y2milestone("Product name found: %1", new_name) - raise Break - end + Builtins.foreach(all_products) do |one_product| + # source ID matches + if Ops.get_integer(one_product, "source", -1) == src_id + if Builtins.haskey(one_product, "name") && + Ops.get(one_product, "name") != nil && + Ops.get_string(one_product, "name", "") != "" + new_name = Ops.get_string(one_product, "name", "") + Builtins.y2milestone("Product name found: %1", new_name) + raise Break end end end @@ -1814,24 +1735,9 @@ return end end - if !CheckContentFile(initial_repository) - label = ContentFileProductLabel() - # bug #159754, release the mounted CD - Pkg.SourceReleaseAll - Pkg.SourceDelete(initial_repository) - initial_repository = nil - if !Popup.ContinueCancel( - # message popup, %1 is product name - Builtins.sformat(_("Insert %1 CD 1"), label) - ) - @init_error = Builtins.sformat(_("%1 CD 1 not found"), label) - @init_in_progress = false - return - end - end end - # BNC #481828: Using LABEL from content file as a repository name + # BNC #481828: Using LABEL from product AdjustSourcePropertiesAccordingToProduct(@base_source_id) @base_source_id = initial_repository @@ -2643,7 +2549,6 @@ publish :function => :addAdditionalPackage, :type => "void (string)" publish :function => :ComputeSystemPatternList, :type => "list <string> ()" publish :function => :ComputeSystemPackageList, :type => "list <string> ()" - publish :function => :CheckContentFile, :type => "boolean (integer)" publish :function => :GetBaseSourceID, :type => "integer ()" publish :function => :Init, :type => "void (boolean)" publish :function => :SlideShowSetUp, :type => "void (string)"
participants (1)
-
root@hilbert.suse.de