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



60
61
62
63
64
65
66
67
68
69
70
# File 'library/general/src/modules/Distro.rb', line 60

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

  @_distro == "debian"
end

#fedoraObject

Is it Fedora based? RHEL, Oracle, ...



50
51
52
53
54
55
56
57
# File 'library/general/src/modules/Distro.rb', line 50

def fedora
  if @_distro.nil? && (SCR.Read(path(".target.size"), "/etc/fedora-release") != -1)
    @_distro = "fedora"
    Builtins.y2milestone("Found Fedora")
  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
# File 'library/general/src/modules/Distro.rb', line 40

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

  @_distro == "suse"
end