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, ...


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

def debian
  if @_distro.nil?
    if SCR.Execute(
      path(".target.bash"),
      "/usr/bin/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, ...


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

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


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

def main
  textdomain "base"

  # Cache
  @_distro = nil
end

#suseObject

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


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

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