diff --git a/package/yast2-add-on.changes b/package/yast2-add-on.changes index 0648958..dd82d3b 100644 --- a/package/yast2-add-on.changes +++ b/package/yast2-add-on.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Jan 27 13:41:41 UTC 2020 - Josef Reidinger + +- Drop fake CLI that opens GUI and suggest to use zypper or + SUSEConnect instead (bsc#1149900) +- 4.2.14 + ------------------------------------------------------------------- Fri Dec 6 13:50:38 CET 2019 - schubi@suse.de @@ -23,7 +30,7 @@ Thu Nov 21 13:36:10 UTC 2019 - schubi@suse.de - Using Y2Packager::Resolvable.any? and Y2Packager::Resolvable.find in order to decrease the required memory (bsc#1132650, bsc#1140037). -- 4.2.10 +- 4.2.10 ------------------------------------------------------------------- Thu Nov 21 12:36:10 UTC 2019 - David Diaz diff --git a/package/yast2-add-on.spec b/package/yast2-add-on.spec index 82fc13b..fa54587 100644 --- a/package/yast2-add-on.spec +++ b/package/yast2-add-on.spec @@ -17,7 +17,7 @@ Name: yast2-add-on -Version: 4.2.13 +Version: 4.2.14 Release: 0 Summary: YaST2 - Add-On media installation code License: GPL-2.0-only diff --git a/src/clients/add-on.rb b/src/clients/add-on.rb index c55aa55..1d8ded2 100644 --- a/src/clients/add-on.rb +++ b/src/clients/add-on.rb @@ -22,82 +22,24 @@ def main Yast.import "Mode" Yast.import "CommandLine" Yast.import "Directory" - Yast.import "XML" Yast.include self, "add-on/add-on-workflow.rb" - - @wfm_args = WFM.Args - Builtins.y2milestone("ARGS: %1", @wfm_args) - - @commands = CommandLine.Parse(@wfm_args) - Builtins.y2debug("Commands: %1", @commands) - - # bnc #430852 - if Ops.get_string(@commands, "command", "") == "help" || - Ops.get_string(@commands, "command", "") == "longhelp" - Mode.SetUI("commandline") - # TRANSLATORS: commandline help - CommandLine.Print( + CommandLine.Run( + "id" => "add_on", + # Command line help text for the repository module, %1 is "zypper" + "help" => format( _( - "\n" + - "Add-on Module Help\n" + - "------------------\n" + - "\n" + - "To add a new add-on product via the command-line, use this syntax:\n" + - " /sbin/yast2 add-on URL\n" + - "URL is the path to the add-on source.\n" + - "\n" + - "Examples of URL:\n" + - "http://server.name/directory/Lang-AddOn-10.2-i386/\n" + - "ftp://server.name/directory/Lang-AddOn-10.2-i386/\n" + - "nfs://server.name/directory/SDK1-SLE-i386/\n" + - "disk://dev/sda5/directory/Product/CD1/\n" + - "cd://\n" + - "dvd://\n" - ) - ) - return :auto - elsif Ops.get_string(@commands, "command", "") == "xmlhelp" - Mode.SetUI("commandline") - if !Builtins.haskey(Ops.get_map(@commands, "options", {}), "xmlfile") - CommandLine.Print( - _( - "Target file name ('xmlfile' option) is missing. Use xmlfile= command line option." - ) - ) - return :auto - else - @doc = {} - - Ops.set( - @doc, - "listEntries", - { - "commands" => "command", - "options" => "option", - "examples" => "example" - } - ) - Ops.set( - @doc, - "systemID", - Ops.add(Directory.schemadir, "/commandline.dtd") - ) - Ops.set(@doc, "typeNamespace", "http://www.suse.com/1.0/configns") - Ops.set(@doc, "rootElement", "commandline") - XML.xmlCreateDoc(:xmlhelp, @doc) - - @exportmap = { "module" => "add-on" } - XML.YCPToXMLFile( - :xmlhelp, - @exportmap, - Ops.get_string(@commands, ["options", "xmlfile"], "") - ) - Builtins.y2milestone("exported XML map: %1", @exportmap) - return :auto - end - end + "Add On Management - This module does not support the command line " \ + "interface, use '%{zypper}' instead for adding a new repository or " \ + "'%{SUSEConnect}' to register a new add-on." + ), + { zypper: "zypper", SUSEConnect: "SUSEConnect" } + ), + "guihandler" => fun_ref(method(:run_GUI), "symbol ()") + ) + end + def run_GUI Wizard.CreateDialog Wizard.SetContents( @@ -134,28 +76,12 @@ def main # Initialize current sources Read() - @ret = nil - # <-- Initialization finish Wizard.EnableAbortButton Wizard.EnableNextButton - if Builtins.size(WFM.Args) == 0 - Builtins.y2milestone( - "Url not specified in cmdline, starting full-featured module" - ) - @ret = RunAddOnsOverviewDialog() - else - @url = Convert.to_string(WFM.Args(0)) - Builtins.y2milestone("Specified URL %1", @url) - begin - @createResult = SourceManager.createSource(@url) - Builtins.y2milestone("Source creating result: %1", @createResult) - end while @createResult == :again - AddOnProduct.last_ret = :next - @ret = RunAutorunWizard() - end + ret = RunAddOnsOverviewDialog() Pkg.SourceSaveAll if @ret == :next @@ -165,9 +91,7 @@ def main Pkg.SourceReleaseAll UI.CloseDialog - @ret - - # EOF + ret end end end