Skip to content

Commit

Permalink
Merge pull request #70 from yast/no_yast_packages
Browse files Browse the repository at this point in the history
No yast packages in the target
  • Loading branch information
lslezak committed Sep 13, 2013
2 parents abbeffd + d85f691 commit b83c49e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 45 deletions.
5 changes: 4 additions & 1 deletion src/clients/inst_mode.rb
Expand Up @@ -503,6 +503,9 @@ def InstModeDialogHelp
end

# BNC #469730: Installation requires some packages

# TODO FIXME: remove this later, for now we still need at least yast2-core
# and perl-bootloader packages
def SetRequiredPackages
if @new_mode == :install
Builtins.y2milestone(
Expand All @@ -511,7 +514,7 @@ def SetRequiredPackages
PackagesProposal.AddResolvables(
"YaST-Installation",
:package,
["yast2-installation"]
["yast2-core", "perl-bootloader"]
)
elsif @new_mode == :update
Builtins.y2milestone(
Expand Down
52 changes: 8 additions & 44 deletions src/include/installation/scr_switch_debugger.rb
Expand Up @@ -52,7 +52,7 @@ def initialize_installation_scr_switch_debugger(include_target)
# test result (Checking for xyz... Passed)
@result_ok = _("Passed")
# test result (Checking for xyz... Failed)
@result_failed = "Failed"
@result_failed = _("Failed")

# *********************************************************************

Expand All @@ -74,20 +74,12 @@ def initialize_installation_scr_switch_debugger(include_target)
# any command for the chroot command
@test_do_chroot = "/bin/ls -1 /"

# y2base path
@test_y2base = "/usr/lib/YaST2/bin/y2base"

# get all installed rpm packages
@test_rpm = "rpm -qa"

# all needed rpm packages
@needed_rpm_packages = [
"yast2",
"yast2-installation",
"yast2-core",
"yast2-bootloader",
"yast2-packager"
]
# all needed rpm packages, Yast might not be installed at the target system,
# so only glibc seems to be really needed...
@needed_rpm_packages = ["glibc"]

# is the package %1 installed?
@test_one_rpm = "rpm -q %1"
Expand Down Expand Up @@ -345,24 +337,6 @@ def RunSCRSwitchTest_DoChroot
test_result
end

# checks whether the y2base binary exists
def RunSCRSwitchTest_Y2BASE
y2basefile = Builtins.sformat("%1%2", @chroot_path, @test_y2base)
test_result = FileUtils.Exists(y2basefile)

ReportTest(
# Test progress
Builtins.sformat(
_("Checking for %1 in %2..."),
@test_y2base,
@chroot_path
),
test_result
)

test_result
end

def RunSCRSwitchTest_FreeSpace
ReportProgress(_("Checking free space"))

Expand Down Expand Up @@ -602,29 +576,20 @@ def RunSCRSwitchTest_DoNeededRPMsRequire(package_name)
# checks a package, whether it is installed
# if it is installed, whether is has installed requires
def RunSCRSwitchTest_DoNeededRPMsCheck
ret = true

# check whether all needed packages are installed
Builtins.foreach(Builtins.sort(@needed_rpm_packages)) do |package_name|
@needed_rpm_packages.sort.all? do |package_name|
# Test progress
ReportProgress(
Builtins.sformat(
_("Running complex check on package %1..."),
package_name
)
)
# is the package installed?
if !RunSCRSwitchTest_CheckWhetherInstalled(package_name)
ret = false
raise Break
# if it is installed, check whetheris has all dependencies
elsif !RunSCRSwitchTest_DoNeededRPMsRequire(package_name)
ret = false
raise Break
end
end

ret
# is the package installed? all dependencies Ok?
RunSCRSwitchTest_CheckWhetherInstalled(package_name) && RunSCRSwitchTest_DoNeededRPMsRequire(package_name)
end
end

def PrintLinesFromTo(from_line, to_line)
Expand Down Expand Up @@ -710,7 +675,6 @@ def RunSCRSwitchTests
return false if !RunSCRSwitchTest_ListFilesInChroot()
return false if !RunSCRSwitchTest_BinaryExists()
return false if !RunSCRSwitchTest_DoChroot()
return false if !RunSCRSwitchTest_Y2BASE()
return false if !RunSCRSwitchTest_FreeSpace()
return false if !RunSCRSwitchTest_DoRPMCheck()

Expand Down

0 comments on commit b83c49e

Please sign in to comment.