Skip to content

Commit

Permalink
Merge pull request #49 from yast/addon-packages-iso
Browse files Browse the repository at this point in the history
Possibly interactive workflow with addon= (fate#324656)
  • Loading branch information
mvidner committed Feb 9, 2018
2 parents f913cb6 + db8b21c commit 0c44e96
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 79 deletions.
7 changes: 7 additions & 0 deletions package/yast2-add-on.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Feb 7 15:48:56 UTC 2018 - mvidner@suse.com

- Made the addon=url boot option work with a multi-product medium
such as the SLE-15 Packages DVD (FATE#324656)
- 4.0.6

-------------------------------------------------------------------
Mon Jan 8 10:57:47 UTC 2018 - lslezak@suse.cz

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-add-on.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-add-on
Version: 4.0.5
Version: 4.0.6
Release: 0
Summary: YaST2 - Add-On media installation code
License: GPL-2.0
Expand Down
21 changes: 10 additions & 11 deletions src/clients/inst_add-on.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def main
Yast.import "URL"

Yast.include self, "add-on/add-on-workflow.rb"
Yast.include self, "packager/repositories_include.rb"

if AddOnProduct.skip_add_ons
Builtins.y2milestone("Skipping add-ons (as requested before)")
Expand Down Expand Up @@ -68,18 +69,16 @@ def main
ret = NetworkSetupForAddons(missing_addons)
return ret if Builtins.contains([:back, :abort], ret)

begin
tmp = Tempfile.new("cmdline-addons-")
# each add-on on a separate line
File.write(tmp.path, missing_addons.join("\n"))
# import the add-ons from the temporary file
AddOnProduct.AddPreselectedAddOnProducts(
[{ "file" => tmp.path, "type" => "plain" }]
)
ensure
tmp.close
tmp.unlink
plaindir, download, name, alias_ = false, true, "", ""
missing_addons.each do |url|
sources_before = Pkg.SourceGetCurrent(false)
Builtins.y2milestone("Sources before adding new one: %1", sources_before)

createSourceImpl(url, plaindir, download, name, alias_)

activate_addon_changes(sources_before)
end
InstallProduct()
end
end

Expand Down
67 changes: 0 additions & 67 deletions src/include/add-on/add-on-workflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,64 +73,6 @@ def Write
:next
end

# Checks whether some network is available in the current moment,
# see the bug #170147 for more information.
def IsAnyNetworkAvailable
ret = false

command = "TERM=dumb /sbin/ip -o address show | grep inet | grep -v scope.host"
Builtins.y2milestone("Running %1", command)
cmd_run = Convert.to_map(
SCR.Execute(path(".target.bash_output"), command)
)
Builtins.y2milestone("Command returned: %1", cmd_run)

# command failed
if Ops.get_integer(cmd_run, "exit", -1) != 0
# some errors were there, we don't know the status, rather return that it's available
# `grep` also returns non zero exit code when there is nothing to do...
if Ops.get_string(cmd_run, "stdout", "") != ""
Builtins.y2error("Checking the network failed")
ret = true
end
# some devices are listed
elsif Ops.get_string(cmd_run, "stdout", "") != nil &&
Ops.get_string(cmd_run, "stdout", "") != "" &&
Ops.get_string(cmd_run, "stdout", "") != "\n"
ret = true
end

ret
end

# Returns begining string for source type
#
# @param [Symbol] source_type
# @return [String] url begins with...
def GetURLBeginsWith(source_type)
url = ""

if source_type == :ftp
url = "ftp://"
elsif source_type == :http
url = "http://"
elsif source_type == :https
url = "https://"
elsif source_type == :samba
url = "smb://"
elsif source_type == :nfs
url = "nfs://"
elsif source_type == :cd
url = "cd:///"
elsif source_type == :dvd
url = "dvd:///"
elsif source_type == :local_dir
url = "dir://"
end

url
end

# used Add-Ons are stored in AddOnProduct::add_on_products
# bnc #393620
def AddAddOnToStore(src_id)
Expand Down Expand Up @@ -1284,15 +1226,6 @@ def AdjustInfoWidget
nil
end

# Logs wrong product with 'log_this' error and returns 'return_this'.
# Added because of bnc #459461
def LogWrongProduct(one_product, log_this, return_this)
one_product = deep_copy(one_product)
Builtins.y2error("Erroneous product: %1: %2", log_this, one_product)

return_this
end

# Modifies repository info (adds some missing pieces).
def AdjustRepositoryInfo(info)
Builtins.foreach(
Expand Down

0 comments on commit 0c44e96

Please sign in to comment.