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



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

def Available(_package)
  true
end

#DoInstall(packages) ⇒ Object



64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'library/packages/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

#DoInstallAndRemove(toinst, torem) ⇒ Object



92
93
94
95
96
97
98
99
# File 'library/packages/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

#DoRemove(packages) ⇒ Object



78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'library/packages/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

#GetModifiedBoolean

Functions which returns if the settings were modified

Returns:

  • (Boolean)

    settings were modified



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

def GetModified
  @modified
end

#Installed(package) ⇒ Object



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

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

#InstallKernel(_kernel_modules) ⇒ Object



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

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

#mainObject



36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'library/packages/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

#PackageAvailable(package) ⇒ Object

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

Returns:

  • true if yes



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

def PackageAvailable(package)
  Available(package)
end

#PackageInstalled(package) ⇒ Object

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

Returns:

  • true if yes



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

def PackageInstalled(package)
  Installed(package)
end

#SetModifiedObject

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



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

def SetModified
  @modified = true

  nil
end