30
31
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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
# File 'src/lib/installation/clients/deploying_proposal.rb', line 30
def main
textdomain "installation"
Yast.import "Mode"
Yast.import "ImageInstallation"
Yast.import "Progress"
Yast.import "Installation"
Yast.import "Report"
@func = Convert.to_string(WFM.Args(0))
@param = Convert.to_map(WFM.Args(1))
@ret = {}
@im_do_enable = "deploying_enable"
@im_do_disable = "deploying_disable"
case @func
when "MakeProposal"
@force_reset = Ops.get_boolean(@param, "force_reset", false)
@language_changed = Ops.get_boolean(@param, "language_changed", false)
if @force_reset
ImageInstallation.last_patterns_selected = [nil]
ImageInstallation.changed_by_user = false
end
if ImageInstallation.changed_by_user == true &&
Installation.image_installation == false
Builtins.y2milestone("ImageInstallation already disabled by user")
else
CallProposalScript()
end
if Mode.installation
@ret = {
"preformatted_proposal" => GenerateProposalText(),
"links" => [@im_do_enable, @im_do_disable],
"help" => _(
"<p><b>Installation from Images</b> is used to speed the installation up.\n" \
"Images contain compressed snapshots of an installed system matching your\n" \
"selection of patterns. The rest of the packages which are not contained in the\n" \
"images will be installed from packages the standard way.</p>\n"
) +
_(
"<p>Note that when installing from images, the time stamps of all packages " \
"originating from the images will\nnot match the installation date but rather " \
"the date the image was created.</p>"
) +
_(
"<p>Installation from images is disabled by default if the current\n" \
"pattern selection does not fit any set of images.</p>"
)
}
else
Builtins.y2error(
"Installation from images should be used for new installation only!"
)
@ret = {
"preformatted_proposal" => Builtins.sformat(
_("Error: Images should not be used for mode: %1."),
Mode.mode
),
"warning_level" => :error
}
end
when "AskUser"
@chosen_id = Ops.get(@param, "chosen_id")
Builtins.y2milestone(
"Images proposal change requested, id %1",
@chosen_id
)
@old_status = Installation.image_installation
Installation.image_installation = if @chosen_id == @im_do_disable
false
elsif @chosen_id == @im_do_enable
true
else
!Installation.image_installation
end
CallProposalScript() if Installation.image_installation
if @old_status == false &&
@old_status == Installation.image_installation
Report.Message(
_(
"Cannot enable installation from images.\n" \
"\n" \
"Currently selected patterns do not fit the images\n" \
"stored on the installation media.\n"
)
)
end
ImageInstallation.changed_by_user = true
@ret = { "workflow_sequence" => :next }
when "Description"
@ret = {
"rich_text_title" => _("Installation from Images"),
"menu_title" => _(
"Installation from &Images"
),
"id" => "deploying"
}
end
deep_copy(@ret)
end
|