Class: Yast::PackageClass

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

Instance Method Summary collapse

Instance Method Details

#Available(package) ⇒ Object


170
171
172
173
174
175
176
177
# File 'library/packages/src/modules/Package.rb', line 170

def Available(package)
  function = Convert.convert(
    Ops.get(functions, "Available"),
    from: "any",
    to:   "boolean (string)"
  )
  function.call(package)
end

#DoInstall(packages) ⇒ Object

Install list of packages


132
133
134
135
136
137
138
139
140
# File 'library/packages/src/modules/Package.rb', line 132

def DoInstall(packages)
  packages = deep_copy(packages)
  function = Convert.convert(
    Ops.get(functions, "DoInstall"),
    from: "any",
    to:   "boolean (list <string>)"
  )
  function.call(packages)
end

#DoInstallAndRemove(toinstall, toremove) ⇒ Object

Install and Remove list of packages in one go


159
160
161
162
163
164
165
166
167
168
# File 'library/packages/src/modules/Package.rb', line 159

def DoInstallAndRemove(toinstall, toremove)
  toinstall = deep_copy(toinstall)
  toremove = deep_copy(toremove)
  function = Convert.convert(
    Ops.get(functions, "DoInstallAndRemove"),
    from: "any",
    to:   "boolean (list <string>, list <string>)"
  )
  function.call(toinstall, toremove)
end

#DoRemove(packages) ⇒ Object

Remove list of packages


145
146
147
148
149
150
151
152
153
# File 'library/packages/src/modules/Package.rb', line 145

def DoRemove(packages)
  packages = deep_copy(packages)
  function = Convert.convert(
    Ops.get(functions, "DoRemove"),
    from: "any",
    to:   "boolean (list <string>)"
  )
  function.call(packages)
end

#functionsObject

If Yast is running in the autoyast configuration mode no changes will be done on the target system by using the PackageAI class.


125
126
127
# File 'library/packages/src/modules/Package.rb', line 125

def functions
  Mode.config ? @FunctionsAI : @FunctionsSystem
end

#Installed(package) ⇒ Object


179
180
181
182
183
184
185
186
# File 'library/packages/src/modules/Package.rb', line 179

def Installed(package)
  function = Convert.convert(
    Ops.get(functions, "Installed"),
    from: "any",
    to:   "boolean (string)"
  )
  function.call(package)
end

#InstallKernel(kernel_modules) ⇒ Object


206
207
208
209
210
211
212
213
214
# File 'library/packages/src/modules/Package.rb', line 206

def InstallKernel(kernel_modules)
  kernel_modules = deep_copy(kernel_modules)
  function = Convert.convert(
    Ops.get(functions, "InstallKernel"),
    from: "any",
    to:   "boolean (list <string>)"
  )
  function.call(kernel_modules)
end

#mainObject


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'library/packages/src/modules/Package.rb', line 37

def main
  textdomain "base"

  Yast.import "Mode"
  Yast.import "PackageAI"
  Yast.import "PackageSystem"

  # **
  # Packages Manipulation

  @FunctionsSystem = {
    "DoInstall"          => fun_ref(
      PackageSystem.method(:DoInstall),
      "boolean (list <string>)"
    ),
    "DoRemove"           => fun_ref(
      PackageSystem.method(:DoRemove),
      "boolean (list <string>)"
    ),
    "DoInstallAndRemove" => fun_ref(
      PackageSystem.method(:DoInstallAndRemove),
      "boolean (list <string>, list <string>)"
    ),
    "Available"          => fun_ref(
      PackageSystem.method(:Available),
      "boolean (string)"
    ),
    "Installed"          => fun_ref(
      PackageSystem.method(:Installed),
      "boolean (string)"
    ),
    "InstallKernel"      => fun_ref(
      PackageSystem.method(:InstallKernel),
      "boolean (list <string>)"
    ),
    "PackageInstalled"   => fun_ref(
      PackageSystem.method(:PackageInstalled),
      "boolean (string)"
    ),
    "PackageAvailable"   => fun_ref(
      PackageSystem.method(:PackageAvailable),
      "boolean (string)"
    )
  }

  @FunctionsAI = {
    "DoInstall"          => fun_ref(
      PackageAI.method(:DoInstall),
      "boolean (list <string>)"
    ),
    "DoRemove"           => fun_ref(
      PackageAI.method(:DoRemove),
      "boolean (list <string>)"
    ),
    "DoInstallAndRemove" => fun_ref(
      PackageAI.method(:DoInstallAndRemove),
      "boolean (list <string>, list <string>)"
    ),
    "Available"          => fun_ref(
      PackageAI.method(:Available),
      "boolean (string)"
    ),
    "Installed"          => fun_ref(
      PackageAI.method(:Installed),
      "boolean (string)"
    ),
    "InstallKernel"      => fun_ref(
      PackageAI.method(:InstallKernel),
      "boolean (list <string>)"
    ),
    "PackageInstalled"   => fun_ref(
      PackageAI.method(:PackageInstalled),
      "boolean (string)"
    ),
    "PackageAvailable"   => fun_ref(
      PackageAI.method(:PackageAvailable),
      "boolean (string)"
    )
  }

  @last_op_canceled = false

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

#PackageAvailable(package) ⇒ Object


188
189
190
191
192
193
194
195
# File 'library/packages/src/modules/Package.rb', line 188

def PackageAvailable(package)
  function = Convert.convert(
    Ops.get(functions, "PackageAvailable"),
    from: "any",
    to:   "boolean (string)"
  )
  function.call(package)
end

#PackageInstalled(package) ⇒ Object


197
198
199
200
201
202
203
204
# File 'library/packages/src/modules/Package.rb', line 197

def PackageInstalled(package)
  function = Convert.convert(
    Ops.get(functions, "PackageInstalled"),
    from: "any",
    to:   "boolean (string)"
  )
  function.call(package)
end