Class: Yast::StageClass

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

Instance Method Summary collapse

Instance Method Details

#contBoolean

continuing installation in target system

Returns:

  • (Boolean)

    true if installation continues on the target system


92
93
94
# File 'library/general/src/modules/Stage.rb', line 92

def cont
  stage == "continue"
end

#firstbootBoolean

Firstboot stage

Returns:

  • (Boolean)

    true if first-boot installation is running


98
99
100
# File 'library/general/src/modules/Stage.rb', line 98

def firstboot
  stage == "firstboot"
end

#initialBoolean

starting installation in inst-sys system

Returns:

  • (Boolean)

    true if installation first stage is running


86
87
88
# File 'library/general/src/modules/Stage.rb', line 86

def initial
  stage == "initial"
end

#mainObject


36
37
38
39
40
41
# File 'library/general/src/modules/Stage.rb', line 36

def main
  textdomain "base"

  # Current stage
  @_stage = nil
end

#normalBoolean

normal, running system

Returns:

  • (Boolean)

    true if YaST was started normally


104
105
106
# File 'library/general/src/modules/Stage.rb', line 104

def normal
  stage == "normal"
end

#reprobeBoolean

This flag indicates that a config module has been called due to a change in the system hardware that has been detected on boot time.

Returns:

  • (Boolean)

    true if YaST was invoked because new hardware was probed


112
113
114
# File 'library/general/src/modules/Stage.rb', line 112

def reprobe
  stage == "hardware_probed"
end

#Set(new_stage) ⇒ Object

Set the installation stage

Parameters:

  • new_stage (String)

    string currently processed stage


70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'library/general/src/modules/Stage.rb', line 70

def Set(new_stage)
  if !Builtins.contains(
    ["normal", "initial", "continue", "firstboot", "hardware_probed"],
    new_stage
  )
    Builtins.y2error("Unknown stage %1", new_stage)
  end

  Builtins.y2milestone("setting stage to %1", new_stage)
  @_stage = new_stage

  nil
end

#stageString

Get the current stage

Returns:

  • (String)

    the current stage


45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'library/general/src/modules/Stage.rb', line 45

def stage
  if @_stage.nil?
    @_stage = "normal"

    arg_count = Builtins.size(WFM.Args)
    arg_no = 0
    while Ops.less_than(arg_no, arg_count)
      if WFM.Args(arg_no) == "initial"
        @_stage = "initial"
      elsif WFM.Args(arg_no) == "continue"
        @_stage = "continue"
      elsif WFM.Args(arg_no) == "firstboot"
        @_stage = "firstboot"
      elsif WFM.Args(arg_no) == "reprobe"
        @_stage = "hardware_probed"
      end

      arg_no = Ops.add(arg_no, 1)
    end
  end
  @_stage
end