Module: Yast::ProductCreatorWizardsInclude

Defined in:
../../src/include/product-creator/wizards.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) AddSequence

Add a configuration of product-creator

Returns:

  • sequence result



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
85
86
87
88
89
90
91
92
93
# File '../../src/include/product-creator/wizards.rb', line 50

def AddSequence
  aliases = {
    "source"         => lambda { sourceDialog },
    "base"           => lambda { baseProductSelectionDialog },
    "config1"        => lambda { Configure1Dialog() },
    "config2"        => lambda { Configure2Dialog() },
    "isolinuxcheck"  => [lambda { CheckBootableSrc() }, true],
    "isolinux"       => lambda { isolinuxDialog },
    "packagemanager" => lambda { packageSelector },
    "gpgkey"         => lambda { gpgKeyDialog },
    "write"          => lambda { WriteDialog() },
    "summary"        => lambda { ConfigSummary() }
  }


  sequence = {
    "ws_start"       => "config1",
    "source"         => { :abort => :abort, :next => "base" },
    "base"           => { :abort => :abort, :next => "config2" },
    "config1"        => { :abort => :abort, :next => "source" },
    "config2"        => { :abort => :abort, :next => "isolinuxcheck" },
    "isolinuxcheck"  => {
      :next          => "isolinux",
      :skip_isolinux => "packagemanager"
    },
    "isolinux"       => {
      :abort    => :abort,
      :next     => "packagemanager",
      :autoyast => "gpgkey"
    },
    "packagemanager" => {
      :abort  => :abort,
      :next   => "gpgkey",
      :accept => "gpgkey",
      :failed => "summary",
      :cancel => "isolinuxcheck"
    },
    "gpgkey"         => { :abort => :abort, :next => "summary" },
    "summary"        => { :abort => :abort, :next => "write" },
    "write"          => { :abort => :abort, :next => :next }
  }

  Sequencer.Run(aliases, sequence)
end

- (Object) CommitConfig

save current configuration into global map



116
117
118
119
# File '../../src/include/product-creator/wizards.rb', line 116

def CommitConfig
  ProductCreator.CommitConfig
  :next
end

- (Object) CreateSequence

Create a CD image tree and ISO image

Returns:

  • sequence result



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File '../../src/include/product-creator/wizards.rb', line 96

def CreateSequence
  aliases = { "verify" => lambda { VerifyDialog() }, "create" => lambda do
    TreeDialog()
  end }


  sequence = {
    "ws_start" => "verify",
    "verify"   => {
      :abort    => :abort,
      :next     => "create",
      :overview => :next
    },
    "create"   => { :abort => :abort, :next => :next, :overview => :next }
  }

  Sequencer.Run(aliases, sequence)
end

- (Object) ImageCreatorSequence



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File '../../src/include/product-creator/wizards.rb', line 162

def ImageCreatorSequence
  aliases = {
    "init_repositories" => [lambda { InitRepositories() }, true],
    "images_overview"   => lambda { ImagesOverviewDialog() },
    "kiwi_prepare"      => lambda { PrepareDialog() },
    "kiwi"              => lambda { KiwiDialog() }
  }
  sequence = {
    "ws_start"          => "init_repositories",
    "init_repositories" => { :next => "images_overview" },
    "images_overview"   => {
      :abort => :abort,
      :kiwi  => "kiwi_prepare",
      :next  => :next
    },
    "kiwi_prepare"      => { :abort => :abort, :next => "kiwi" },
    "kiwi"              => {
      :abort => :abort,
      :next  => "init_repositories"
    }
  }

  PackageCallbacks.InitPackageCallbacks

  ret = Sequencer.Run(aliases, sequence)
  ret
end

- (Object) initialize_product_creator_wizards(include_target)



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File '../../src/include/product-creator/wizards.rb', line 30

def initialize_product_creator_wizards(include_target)
  Yast.import "UI"
  Yast.import "Pkg"

  textdomain "product-creator"

  Yast.import "Kiwi"
  Yast.import "Wizard"
  Yast.import "Popup"
  Yast.import "Package"
  Yast.import "PackageCallbacks"
  Yast.import "Sequencer"

  Yast.include include_target, "product-creator/complex.rb"
  Yast.include include_target, "product-creator/dialogs.rb"
  Yast.include include_target, "product-creator/kiwi_dialogs.rb"
end

- (Object) InitRepositories

Initialize the list of current repositories (before any other handling): we need to know their id's so it is possible to delete them when new kiwi config is imported (and its repos should be added)



130
131
132
133
134
135
136
137
138
# File '../../src/include/product-creator/wizards.rb', line 130

def InitRepositories
  # finish sources before next start, so 32bit and 64bit don't get mangled (bnc#510971)
  Pkg.SourceFinishAll
  Pkg.SourceStartManager(false)

  Kiwi.initial_repositories = Kiwi.InitCurrentRepositories
  Kiwi.Read
  :next
end

- (Object) InitSources

Initialize the sources of selected configuration



122
123
124
125
# File '../../src/include/product-creator/wizards.rb', line 122

def InitSources
  ProductCreator.EnableSource
  :next
end

- (Object) KiwiSequence



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File '../../src/include/product-creator/wizards.rb', line 141

def KiwiSequence
  aliases = {
    "init_sources" => [lambda { InitSources() }, true],
    "kiwi"         => lambda { KiwiDialog() },
    "summary"      => lambda { CommitConfig() },
    # FIXME check if it was only kiwi config...
    "write"        => lambda do
      WriteDialog()
    end
  }

  sequence = {
    "ws_start"     => "init_sources",
    "init_sources" => { :next => "kiwi" },
    "kiwi"         => { :abort => :abort, :next => "summary" },
    "summary"      => { :next => "write" },
    "write"        => { :abort => :abort, :next => :next }
  }
  Sequencer.Run(aliases, sequence)
end

- (Object) MainSequence

Main workflow of the product-creator configuration

Returns:

  • sequence result



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File '../../src/include/product-creator/wizards.rb', line 192

def MainSequence
  aliases = {
    "overview"  => lambda { OverviewDialog() },
    "configure" => [lambda { AddSequence() }, true],
    "add"       => [lambda { AddSequence() }, true],
    "edit"      => [lambda { AddSequence() }, true],
    "create"    => [lambda { CreateSequence() }, true],
    "kiwi"      => [lambda { KiwiSequence() }, true]
  }

  sequence = {
    "ws_start"  => "overview",
    "overview"  => {
      :abort  => :abort,
      :add    => "add",
      :edit   => "edit",
      :create => "create",
      :kiwi   => "kiwi",
      :next   => :next
    },
    "configure" => { :abort => :abort, :next => "overview" },
    "add"       => { :abort => :abort, :next => "overview" },
    "edit"      => { :abort => :abort, :next => "overview" },
    "create"    => { :abort => :abort, :next => "overview" },
    "kiwi"      => { :abort => :abort, :next => "overview" }
  }

  ret = Sequencer.Run(aliases, sequence)

  ret
end

- (Object) ProductCreatorSequence

Whole configuration of product-creator

Returns:

  • sequence result



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# File '../../src/include/product-creator/wizards.rb', line 228

def ProductCreatorSequence
  aliases = { "main" => lambda { MainSequence() }, "read" => [lambda do
    ReadDialog()
  end, true] }

  sequence = {
    "ws_start" => "read",
    "read"     => { :abort => :abort, :next => "main" },
    "main"     => { :abort => :abort, :next => :next }
  }

  Wizard.CreateDialog
  Wizard.SetDesktopTitleAndIcon("product-creator")
  required_packages = ["inst-source-utils", "mkisofs", "createrepo"]

  # add PPC specific packages
  if ProductCreator.GetArch == "ppc" || ProductCreator.GetArch == "ppc64"
    # /bin/objcopy - binutils
    # /bin/mkzimage - lilo
    required_packages = Convert.convert(
      Builtins.union(required_packages, ["binutils", "lilo"]),
      :from => "list",
      :to   => "list <string>"
    )
  end

  if !Package.InstallAll(required_packages)
    Popup.Error(_("Installation of required packages\nfailed."))
    return false
  end

  ret = Sequencer.Run(aliases, sequence)

  UI.CloseDialog
  ret == :next
end