Class: Yast::PackageClass

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) Available(package)



167
168
169
170
171
172
173
174
# File '../../src/modules/Package.rb', line 167

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

- (Object) DoInstall(packages)

Install list of packages

Parameters:

  • packages (Array<String>)

    list of packages to be installed

Returns:

  • True on success



129
130
131
132
133
134
135
136
137
# File '../../src/modules/Package.rb', line 129

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

- (Object) DoInstallAndRemove(toinstall, toremove)

Install and Remove list of packages in one go

Parameters:

  • toinstall (Array<String>)

    list of packages to be installed

  • toremove (Array<String>)

    list of packages to be removed

Returns:

  • True on success



156
157
158
159
160
161
162
163
164
165
# File '../../src/modules/Package.rb', line 156

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

- (Object) DoRemove(packages)

Remove list of packages

Parameters:

  • packages (Array<String>)

    list of packages to be removed

Returns:

  • True on success



142
143
144
145
146
147
148
149
150
# File '../../src/modules/Package.rb', line 142

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

- (Object) Installed(package)



176
177
178
179
180
181
182
183
# File '../../src/modules/Package.rb', line 176

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

- (Object) InstallKernel(kernel_modules)



203
204
205
206
207
208
209
210
211
# File '../../src/modules/Package.rb', line 203

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

- (Object) main



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
121
122
123
124
# File '../../src/modules/Package.rb', line 39

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)"
    )
  }

  @Functions = Mode.config ? @FunctionsAI : @FunctionsSystem

  @last_op_canceled = false

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

- (Object) PackageAvailable(package)



185
186
187
188
189
190
191
192
# File '../../src/modules/Package.rb', line 185

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

- (Object) PackageInstalled(package)



194
195
196
197
198
199
200
201
# File '../../src/modules/Package.rb', line 194

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