Class: Yast::DistroClass

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

Instance Method Summary collapse

Instance Method Details

#debianObject

Is it Debian based? Ubuntu, …



66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'library/general/src/modules/Distro.rb', line 66

def debian
  if @_distro.nil?
    if SCR.Execute(
      path(".target.bash"),
      "grep DISTRIB_ID=Ubuntu /etc/lsb-release"
    ) == 0
      @_distro = "debian"
      Builtins.y2milestone("Found Debian/Ubuntu")
    end
  end

  @_distro == "debian"
end

#fedoraObject

Is it Fedora based? RHEL, Oracle, …



54
55
56
57
58
59
60
61
62
63
# File 'library/general/src/modules/Distro.rb', line 54

def fedora
  if @_distro.nil?
    if SCR.Read(path(".target.size"), "/etc/fedora-release") != -1
      @_distro = "fedora"
      Builtins.y2milestone("Found Fedora")
    end
  end

  @_distro == "fedora"
end

#mainObject



34
35
36
37
38
39
# File 'library/general/src/modules/Distro.rb', line 34

def main
  textdomain "base"

  # Cache
  @_distro = nil
end

#suseObject

Is it SUSE based? openSUSE, SLES, SLED, …



42
43
44
45
46
47
48
49
50
51
# File 'library/general/src/modules/Distro.rb', line 42

def suse
  if @_distro.nil?
    if SCR.Read(path(".target.size"), "/etc/SuSE-release") != -1
      @_distro = "suse"
      Builtins.y2milestone("Found SUSE")
    end
  end

  @_distro == "suse"
end