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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
# File 'src/clients/inst_add-on_software.rb', line 49
def main
Yast.import "Pkg"
Yast.import "Kernel"
Yast.import "PackagesUI"
Yast.import "GetInstArgs"
Yast.import "ProductControl"
Yast.import "ProductFeatures"
Yast.import "Installation"
return :auto if GetInstArgs.going_back
@argmap = GetInstArgs.argmap
Builtins.y2milestone("Client called with args: %1", @argmap)
@modes = {
"patterns" => :patternSelector,
"search" => :searchMode,
"summary" => :summaryMode,
"repositories" => :repoMode
}
Pkg.TargetInit(Installation.destdir, false)
Pkg.SourceStartManager(true)
@pcg_mode = Ops.get_string(@argmap, "sw_mode", "patterns")
@run_in_mode = Ops.get(@modes, @pcg_mode, :summaryMode)
Builtins.y2milestone(
"Running package selector in mode %1/%2",
@pcg_mode,
@run_in_mode
)
@ret = PackagesUI.RunPackageSelector({ "mode" => @run_in_mode })
Builtins.y2milestone("RunPackageSelector returned %1", @ret)
@dialog_ret = :next
@dialog_ret = :abort if @ret == :cancel
if @ret == :accept || @ret == :ok
if Ops.get_boolean(@argmap, "skip_installation", false) != true
Builtins.y2milestone("Selected resolvables will be installed now")
if WFM.CallFunction(
"inst_rpmcopy",
[GetInstArgs.Buttons(false, false)]
) == :abort
@dialog_ret = :abort
else
Kernel.InformAboutKernelChange
Builtins.y2milestone("Done")
end
end
end
@dialog_ret
end
|