Class: Yast::InstPrepareImageClient

Inherits:
Client
  • Object
show all
Defined in:
src/lib/installation/clients/inst_prepare_image.rb

Instance Method Summary collapse

Instance Method Details

#mainObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'src/lib/installation/clients/inst_prepare_image.rb', line 32

def main
  Yast.import "Pkg"
  Yast.import "Packages"
  Yast.import "ImageInstallation"
  Yast.import "GetInstArgs"
  Yast.import "Wizard"
  Yast.import "Installation"

  textdomain "installation"

  return :back if GetInstArgs.going_back

  Builtins.y2milestone("Preparing image for package selector")

  # set repo to get images from
  ImageInstallation.SetRepo(Ops.get(Packages.theSources, 0, 0))

  @all_patterns = Y2Packager::Resolvable.find(kind: :pattern)

  @patterns_to_install = Builtins.maplist(@all_patterns) do |one_patern|
    if one_patern.status == :selected ||
        one_patern.status == :installed
      next one_patern.name
    else
      next ""
    end
  end

  @patterns_to_install = Builtins.filter(@patterns_to_install) do |one_pattern|
    one_pattern != "" && !one_pattern.nil?
  end

  if @patterns_to_install == ImageInstallation.last_patterns_selected
    Builtins.y2milestone("List of selected patterns hasn't changed...")
    return :auto
  end
  ImageInstallation.last_patterns_selected = deep_copy(@patterns_to_install)

  # list images for currently selected patterns
  Builtins.y2milestone(
    "Currently selected patterns: %1",
    @patterns_to_install
  )

  # avoid useles calls
  ImageInstallation.FindImageSet(@patterns_to_install) if Ops.greater_than(
    Builtins.size(@patterns_to_install), 0
  )

  Builtins.y2milestone("Images for installation ready")

  :auto
end