Class: Yast::PackageAIClass

Inherits:
Module
  • Object
show all
Defined in:
library/packages/src/modules/PackageAI.rb

Instance Method Summary collapse

Instance Method Details

#Available(_package) ⇒ Object


99
100
101
# File 'library/packages/src/modules/PackageAI.rb', line 99

def Available(_package)
  true
end

#DoInstall(packages) ⇒ Object


62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'library/packages/src/modules/PackageAI.rb', line 62

def DoInstall(packages)
  packages = deep_copy(packages)
  @toinstall = Convert.convert(
    Builtins.union(@toinstall, packages),
    from: "list",
    to:   "list <string>"
  )
  @toremove = Builtins.filter(@toremove) do |p|
    !Builtins.contains(packages, p)
  end
  @modified = true
  true
end

#DoInstallAndRemove(toinst, torem) ⇒ Object


90
91
92
93
94
95
96
97
# File 'library/packages/src/modules/PackageAI.rb', line 90

def DoInstallAndRemove(toinst, torem)
  toinst = deep_copy(toinst)
  torem = deep_copy(torem)
  DoInstall(toinst)
  DoRemove(torem)
  @modified = true
  true
end

#DoRemove(packages) ⇒ Object


76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'library/packages/src/modules/PackageAI.rb', line 76

def DoRemove(packages)
  packages = deep_copy(packages)
  @toremove = Convert.convert(
    Builtins.union(@toremove, packages),
    from: "list",
    to:   "list <string>"
  )
  @toinstall = Builtins.filter(@toinstall) do |p|
    !Builtins.contains(packages, p)
  end
  @modified = true
  true
end

#GetModifiedBoolean

Functions which returns if the settings were modified


58
59
60
# File 'library/packages/src/modules/PackageAI.rb', line 58

def GetModified
  @modified
end

#Installed(package) ⇒ Object


103
104
105
# File 'library/packages/src/modules/PackageAI.rb', line 103

def Installed(package)
  Builtins.contains(@toinstall, package)
end

#InstallKernel(_kernel_modules) ⇒ Object


119
120
121
122
# File 'library/packages/src/modules/PackageAI.rb', line 119

def InstallKernel(_kernel_modules)
  # the kernel packages are handled by autoyast on its own
  true
end

#mainObject


34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'library/packages/src/modules/PackageAI.rb', line 34

def main
  textdomain "base"

  @toinstall = []
  @toremove = []

  @last_op_canceled = false

  Yast.include self, "packages/common.rb"

  # default value of settings modified
  @modified = false
end

#PackageAvailable(package) ⇒ Object

Is a package available? Checks only package name, not list of provides.


115
116
117
# File 'library/packages/src/modules/PackageAI.rb', line 115

def PackageAvailable(package)
  Available(package)
end

#PackageInstalled(package) ⇒ Object

Is a package installed? Checks only the package name in contrast to Installed() function.


109
110
111
# File 'library/packages/src/modules/PackageAI.rb', line 109

def PackageInstalled(package)
  Installed(package)
end

#SetModifiedObject

Function sets internal variable, which indicates, that any settings were modified, to "true"


50
51
52
53
54
# File 'library/packages/src/modules/PackageAI.rb', line 50

def SetModified
  @modified = true

  nil
end