Skip to content

Commit

Permalink
Merge pull request #284 from yast/review_140813_fixing_testcases
Browse files Browse the repository at this point in the history
[Review] Request from 'schubi2' @ 'yast/yast-yast2/review_140813_fixing_testcases'
  • Loading branch information
schubi2 committed Aug 13, 2014
2 parents a66f41a + 77bc9bf commit 4ad6f40
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
5 changes: 0 additions & 5 deletions library/general/src/modules/Mode.rb
Expand Up @@ -90,8 +90,6 @@ def main

textdomain "base"

Yast.import "Package"

# Current mode
@_mode = nil

Expand Down Expand Up @@ -186,9 +184,6 @@ def SetMode(new_mode)
Builtins.y2milestone("setting mode to %1", new_mode)
@_mode = new_mode

# Update package manipulation mode
Package.UpdateInstallationMode

nil
end

Expand Down
22 changes: 10 additions & 12 deletions library/packages/src/modules/Package.rb
Expand Up @@ -116,8 +116,6 @@ def main
)
}

self.UpdateInstallationMode

@last_op_canceled = false

Yast.include self, "packages/common.rb"
Expand All @@ -126,8 +124,8 @@ def main
# If Yast is running in the autoyast configuration mode
# no changes will be done on the target system by using
# the PackageAI class.
def UpdateInstallationMode
@Functions = Mode.config ? @FunctionsAI : @FunctionsSystem
def functions
Mode.config ? @FunctionsAI : @FunctionsSystem
end

# Install list of packages
Expand All @@ -136,7 +134,7 @@ def UpdateInstallationMode
def DoInstall(packages)
packages = deep_copy(packages)
function = Convert.convert(
Ops.get(@Functions, "DoInstall"),
Ops.get(functions, "DoInstall"),
:from => "any",
:to => "boolean (list <string>)"
)
Expand All @@ -149,7 +147,7 @@ def DoInstall(packages)
def DoRemove(packages)
packages = deep_copy(packages)
function = Convert.convert(
Ops.get(@Functions, "DoRemove"),
Ops.get(functions, "DoRemove"),
:from => "any",
:to => "boolean (list <string>)"
)
Expand All @@ -164,7 +162,7 @@ def DoInstallAndRemove(toinstall, toremove)
toinstall = deep_copy(toinstall)
toremove = deep_copy(toremove)
function = Convert.convert(
Ops.get(@Functions, "DoInstallAndRemove"),
Ops.get(functions, "DoInstallAndRemove"),
:from => "any",
:to => "boolean (list <string>, list <string>)"
)
Expand All @@ -173,7 +171,7 @@ def DoInstallAndRemove(toinstall, toremove)

def Available(package)
function = Convert.convert(
Ops.get(@Functions, "Available"),
Ops.get(functions, "Available"),
:from => "any",
:to => "boolean (string)"
)
Expand All @@ -182,7 +180,7 @@ def Available(package)

def Installed(package)
function = Convert.convert(
Ops.get(@Functions, "Installed"),
Ops.get(functions, "Installed"),
:from => "any",
:to => "boolean (string)"
)
Expand All @@ -191,7 +189,7 @@ def Installed(package)

def PackageAvailable(package)
function = Convert.convert(
Ops.get(@Functions, "PackageAvailable"),
Ops.get(functions, "PackageAvailable"),
:from => "any",
:to => "boolean (string)"
)
Expand All @@ -200,7 +198,7 @@ def PackageAvailable(package)

def PackageInstalled(package)
function = Convert.convert(
Ops.get(@Functions, "PackageInstalled"),
Ops.get(functions, "PackageInstalled"),
:from => "any",
:to => "boolean (string)"
)
Expand All @@ -210,7 +208,7 @@ def PackageInstalled(package)
def InstallKernel(kernel_modules)
kernel_modules = deep_copy(kernel_modules)
function = Convert.convert(
Ops.get(@Functions, "InstallKernel"),
Ops.get(functions, "InstallKernel"),
:from => "any",
:to => "boolean (list <string>)"
)
Expand Down
8 changes: 8 additions & 0 deletions package/yast2.changes
@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Aug 13 14:36:23 CEST 2014 - schubi@suse.de

- Package.rb: Each call is polling which installation mode is
active currently. So Mode.rb has not to take care about modules
which are using Mode.rb. (Fixing current testcases)
- 3.1.98

-------------------------------------------------------------------
Tue Aug 12 16:35:30 CEST 2014 - locilka@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2
Version: 3.1.97
Version: 3.1.98
Release: 0
URL: https://github.com/yast/yast-yast2

Expand Down

0 comments on commit 4ad6f40

Please sign in to comment.