Skip to content

Commit

Permalink
Merge d710987 into a95db3b
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jan 27, 2020
2 parents a95db3b + d710987 commit 500dbdd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 94 deletions.
9 changes: 8 additions & 1 deletion package/yast2-add-on.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Jan 27 13:41:41 UTC 2020 - Josef Reidinger <jreidinger@suse.com>

- 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

Expand All @@ -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 <dgonzalez@suse.com>
Expand Down
2 changes: 1 addition & 1 deletion package/yast2-add-on.spec
Expand Up @@ -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
Expand Down
108 changes: 16 additions & 92 deletions src/clients/add-on.rb
Expand Up @@ -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=<target_XML_file> 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(
Expand Down Expand Up @@ -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

Expand All @@ -165,9 +91,7 @@ def main
Pkg.SourceReleaseAll

UI.CloseDialog
@ret

# EOF
ret
end
end
end
Expand Down

0 comments on commit 500dbdd

Please sign in to comment.