Skip to content

Commit

Permalink
changes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Dec 18, 2018
1 parent 3a34ef1 commit 877ff3f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 49 deletions.
16 changes: 1 addition & 15 deletions src/clients/inst_kickoff.rb
Expand Up @@ -34,21 +34,7 @@ def main
# Feature #301903, bugzilla #244937
if Mode.update
# "/" means updating the running system, bugzilla #246389
if Installation.destdir == "/"
# When upgrading system, remove devs.rpm just from rpm database
LocalCommand(
"/bin/rpm -q 'devs' && /bin/rpm --nodeps --justdb -e 'devs'"
)
# normal upgrade
else
# When upgrading system, remove devs.rpm if installed
LocalCommand(
Builtins.sformat(
"/bin/rpm --root %1 -q 'devs' && /bin/rpm --nodeps --root %1 -e 'devs'",
Installation.destdir.shellescape
)
)

if Installation.destdir != "/"
# Mount (bind) the current /dev/ to the /installed_system/dev/
LocalCommand(
Builtins.sformat(
Expand Down
5 changes: 1 addition & 4 deletions src/modules/Packages.rb
Expand Up @@ -1681,10 +1681,7 @@ def FindAndRememberAddOnProductsFiles(initial_repository)
@add_on_products_list,
"file" => filename, "type" => type
)
WFM.Execute(
path(".local.bash"),
"/usr/bin/cp #{tmp_add_on_products.shellescape} #{filename.shellescape}"
)
::FileUtils.cp(tmp_add_on_products, filename)
Builtins.y2milestone(
"Found add_on_products (repository) %1 type %2",
tmp_add_on_products,
Expand Down
32 changes: 3 additions & 29 deletions src/modules/SourceDialogs.rb
Expand Up @@ -4,6 +4,8 @@
require "uri"
require "shellwords"

Yast.import "NetworkService"

# Yast namespace
module Yast
# Displays possibilities to install from NFS, CD or partion
Expand Down Expand Up @@ -1961,34 +1963,6 @@ def ServerWidget
}
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 | /usr/bin/grep inet | " \
"/usr/bin/grep -v scope.host"
Builtins.y2milestone("Running %1", command)
cmd_run = SCR.Execute(path(".target.bash_output"), command)
Builtins.y2milestone("Command returned: %1", cmd_run)

# command failed
if Ops.get_integer(cmd_run, "exit", -1).nonzero?
# 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", "") != ""
ret = true
end

ret
end

# Returns whether Community Repositories are defined in the control file.
#
# @return [Boolean] whether defined
Expand Down Expand Up @@ -2092,7 +2066,7 @@ def SelectRadioWidgetOpt(download_widget)
),
HStretch()
)
if !IsAnyNetworkAvailable()
if !NetworkService.isNetworkRunning
Builtins.y2milestone(
"Network is not available, skipping all Network-related options..."
)
Expand Down
2 changes: 1 addition & 1 deletion src/modules/SourceManager.rb
Expand Up @@ -755,7 +755,7 @@ def InstInitSourceMoveDownloadArea
# TODO: check the size of the largest package on CD1
successful = SCR.Execute(
path(".target.bash"),
"test -d #{download_dir.shellescape} || /usr/bin/mkdir -p #{download_dir.shellescape}"
"/usr/bin/mkdir -p #{download_dir.shellescape}"
)
if successful.zero?
Pkg.SourceMoveDownloadArea(download_dir)
Expand Down

0 comments on commit 877ff3f

Please sign in to comment.