Class: Yast::OSReleaseClass

Inherits:
Module
  • Object
show all
Defined in:
../../library/general/src/modules/OSRelease.rb

Instance Method Summary (collapse)

Constructor Details

- (OSReleaseClass) initialize

Returns a new instance of OSReleaseClass



35
36
37
# File '../../library/general/src/modules/OSRelease.rb', line 35

def initialize
  @file_path        = "/etc/os-release"
end

Instance Method Details

- (String) ReleaseInformation(directory)

Get information about the OS release

Parameters:

  • directory (String)

    containing the installed system (/ in installed system)

Returns:

  • (String)

    the release information



42
43
44
# File '../../library/general/src/modules/OSRelease.rb', line 42

def ReleaseInformation(directory)
  MakeNiceName(Misc.CustomSysconfigRead("PRETTY_NAME", "?", directory + @file_path))
end

- (String) ReleaseName

Get information about the OS name Is limited for the currently running product

Returns:

  • (String)

    the release information



49
50
51
52
53
54
55
# File '../../library/general/src/modules/OSRelease.rb', line 49

def ReleaseName
  if Stage.initial
    return SCR.Read(path(".content.PRODUCT"))
  end
  directory = "/" # TODO make this optional argument
  Misc.CustomSysconfigRead("NAME", "SUSE LINUX", directory + @file_path)
end

- (String) ReleaseVersion

Get information about the OS version Is limited for the currently running product

Returns:

  • (String)

    the release information



60
61
62
63
64
65
66
# File '../../library/general/src/modules/OSRelease.rb', line 60

def ReleaseVersion
  if Stage.initial
    return SCR.Read(path(".content.VERSION"))
  end
  directory = "/"
  Misc.CustomSysconfigRead("VERSION_ID", "", directory + @file_path)
end