Class: Yast::PackageAIClass

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) Available(_package)



101
102
103
# File '../../src/modules/PackageAI.rb', line 101

def Available(_package)
  true
end

- (Object) DoInstall(packages)



64
65
66
67
68
69
70
71
72
73
74
75
76
# File '../../src/modules/PackageAI.rb', line 64

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

- (Object) DoInstallAndRemove(toinst, torem)



92
93
94
95
96
97
98
99
# File '../../src/modules/PackageAI.rb', line 92

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

- (Object) DoRemove(packages)



78
79
80
81
82
83
84
85
86
87
88
89
90
# File '../../src/modules/PackageAI.rb', line 78

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

- (Boolean) GetModified

Functions which returns if the settings were modified

Returns:

  • (Boolean)

    settings were modified



60
61
62
# File '../../src/modules/PackageAI.rb', line 60

def GetModified
  @modified
end

- (Object) Installed(package)



105
106
107
# File '../../src/modules/PackageAI.rb', line 105

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

- (Object) InstallKernel(_kernel_modules)



121
122
123
124
# File '../../src/modules/PackageAI.rb', line 121

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

- (Object) main



36
37
38
39
40
41
42
43
44
45
46
47
48
# File '../../src/modules/PackageAI.rb', line 36

def main
  textdomain "base"

  @toinstall = []
  @toremove = []

  @last_op_canceled = false

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

  # default value of settings modified
  @modified = false
end

- (Object) PackageAvailable(package)

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

Returns:

  • true if yes



117
118
119
# File '../../src/modules/PackageAI.rb', line 117

def PackageAvailable(package)
  Available(package)
end

- (Object) PackageInstalled(package)

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

Returns:

  • true if yes



111
112
113
# File '../../src/modules/PackageAI.rb', line 111

def PackageInstalled(package)
  Installed(package)
end

- (Object) SetModified

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



52
53
54
55
56
# File '../../src/modules/PackageAI.rb', line 52

def SetModified
  @modified = true

  nil
end