Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jsrain committed Jul 22, 2014
2 parents 5839d9d + d780737 commit 422ca9b
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 33 deletions.
25 changes: 25 additions & 0 deletions package/autoyast2.changes
@@ -1,3 +1,28 @@
-------------------------------------------------------------------
Mon Jul 21 16:59:06 CEST 2014 - locilka@suse.com

- Do not clone hidden modules, not even automatically with
clone_system (bnc#887115)
- Added support for autogenerated XML in format:
'services-manager'->'services'->'enable/disable'->'service'
instead of 'listentry'
- 3.1.48

-------------------------------------------------------------------
Thu Jul 21 16:30:02 CEST 2014 - schubi@suse.de

- Set default timeout of error,warning,...popups correctly.
(bnc#887397)
- 3.1.47

-------------------------------------------------------------------
Mon Jul 21 15:15:27 CEST 2014 - locilka@suse.com

- SCR agent for reading desktop file now understand comments
according freedesktop.org (^#[ \t])
- Added support for "Hidden" modules (both bnc#887115)
- 3.1.46

-------------------------------------------------------------------
Wed Jul 16 13:49:24 CEST 2014 - schubi@suse.de

Expand Down
2 changes: 1 addition & 1 deletion package/autoyast2.spec
Expand Up @@ -17,7 +17,7 @@


Name: autoyast2
Version: 3.1.45
Version: 3.1.48
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
16 changes: 7 additions & 9 deletions src/clients/clone_system.rb
Expand Up @@ -10,6 +10,9 @@
# $Id$
module Yast
class CloneSystemClient < Client
# FIXME: unify with conftree.rb
ALWAYS_CLONABLE_MODULES = ["software", "partitioning", "bootloader"]

def main
Yast.import "AutoinstClone"
Yast.import "Profile"
Expand All @@ -25,15 +28,10 @@ def main
@moduleList = ""

Builtins.foreach(Y2ModuleConfig.ModuleMap) do |def_resource, resourceMap|
clonable = Ops.get_string(
resourceMap,
"X-SuSE-YaST-AutoInstClonable",
"false"
) == "true"
if clonable || def_resource == "bootloader" ||
def_resource == "partitioning" ||
def_resource == "software"
@moduleList = Builtins.sformat("%1 %2", @moduleList, def_resource)
clonable = resourceMap["X-SuSE-YaST-AutoInstClonable"] == "true"

if clonable || ALWAYS_CLONABLE_MODULES.include?(def_resource)
@moduleList << " " << def_resource
end
end

Expand Down
11 changes: 7 additions & 4 deletions src/clients/inst_autoinit.rb
Expand Up @@ -200,11 +200,14 @@ def processProfile
Progress.NextStage
Progress.Title(_("Initial Configuration"))
Builtins.y2milestone("Initial Configuration")
tmp = Profile.current.fetch("report",{})
if !tmp.has_key?( "yesno_messages" )
tmp["yesno_messages"] = tmp.fetch("errors",{})
report = Profile.current["report"]
if report && !report.has_key?( "yesno_messages" )
# Set "yesno_messages", but do not reset the other settings
# (bnc#887397)
report = Report.Export # getting all values
report["yesno_messages"] = report.fetch("errors",{})
Report.Import(report) # setting all values
end
Report.Import(tmp)
AutoinstGeneral.Import(Profile.current.fetch("general",{}))
AutoinstGeneral.SetSignatureHandling
AutoinstGeneral.SetMultipathing
Expand Down
4 changes: 4 additions & 0 deletions src/clients/report_auto.rb
Expand Up @@ -64,6 +64,10 @@ def main
# return map or list
elsif @func == "Export"
@ret = Report.Export
# Set timeout for autoyast to 10 seconds (bnc#887397)
@ret["messages"]["timeout"] = 10 if @ret["messages"]["timeout"] <= 0
@ret["warnings"]["timeout"] = 10 if @ret["warnings"]["timeout"] <= 0
@ret["yesno_messages"]["timeout"] = 10 if @ret["yesno_messages"]["timeout"] <= 0
elsif @func == "GetModified"
@ret = Report.GetModified
elsif @func == "SetModified"
Expand Down
26 changes: 13 additions & 13 deletions src/include/autoinstall/conftree.rb
Expand Up @@ -116,6 +116,9 @@ def modules(group_name, selectedModule)
Builtins.y2milestone("group_name: %1", group_name)
itemList = []
Builtins.foreach(Y2ModuleConfig.ModuleMap) do |k, v|
# bnc #887115 comment #9: Desktop file is "hidden" and should not be shown at all
next if v["Hidden"] == "true"

if Ops.get_string(v, "X-SuSE-YaST-Group", "") == group_name
desktop_file = Builtins.substring(
Ops.get_string(v, "X-SuSE-DocTeamID", ""),
Expand Down Expand Up @@ -216,7 +219,7 @@ def layout(preselectedGroup, preselectedModule)

# Set the group selection box to the specified YaST group.
#
# @praram group_name YaST group to select.
# @param group_name YaST group to select.
def setGroup(group_name)
UI.ChangeWidget(Id(:groups), :CurrentItem, group_name)
updateModules
Expand All @@ -238,6 +241,8 @@ def getModule
Convert.to_string(UI.QueryWidget(Id(:modules), :CurrentItem))
end

ALWAYS_CLONABLE_MODULES = ["software", "partitioning", "bootloader"]

# Updates the action button activation status. (Some modules are not
# clonable, some are not writeable).
#
Expand All @@ -247,18 +252,13 @@ def updateButtons(selectedModule)
if Builtins.contains(AutoinstConfig.noWriteNow, selectedModule)
UI.ChangeWidget(Id(:writeNow), :Enabled, false)
end
# enable disable read button
resourceMap = Ops.get(Y2ModuleConfig.ModuleMap, selectedModule, {})
clonable = Ops.get_string(
resourceMap,
"X-SuSE-YaST-AutoInstClonable",
"false"
) == "true"
if !clonable && "software" != selectedModule &&
"partitioning" != selectedModule &&
"bootloader" != selectedModule
UI.ChangeWidget(Id(:read), :Enabled, false)
end

# set read button status
resourceMap = Y2ModuleConfig.ModuleMap.fetch(selectedModule, {})
clonable = resourceMap["X-SuSE-YaST-AutoInstClonable"] == "true"

clone_button_status = clonable || ALWAYS_CLONABLE_MODULES.include?(selectedModule)
UI.ChangeWidget(Id(:read), :Enabled, clone_button_status)

nil
end
Expand Down
3 changes: 3 additions & 0 deletions src/include/autoinstall/xml.rb
Expand Up @@ -59,6 +59,9 @@ def profileSetup
"masquerade_users" => "masquerade_user",
"virtual_users" => "virtual_user",
"services" => "service",
# services-manager -> (hash) services -> (list) enable/disable -> service
"enable" => "service",
"disable" => "service",
"modules_conf" => "module_conf",
"interfaces" => "interface",
"routes" => "route",
Expand Down
11 changes: 8 additions & 3 deletions src/modules/AutoinstClone.rb
Expand Up @@ -19,6 +19,8 @@

module Yast
class AutoinstCloneClass < Module
include Yast::Logger

def main
Yast.import "Mode"

Expand Down Expand Up @@ -177,7 +179,7 @@ def createClonableList
# Build the profile
# @return [void]
def Process
Builtins.y2debug("Additional resources: %1 %2", @base, @additional)
log.info "Base resources: #{@base} additional: #{@additional}"
Profile.Reset
Profile.prepare = true
Mode.SetMode("autoinst_config")
Expand All @@ -190,9 +192,12 @@ def Process
""
)
resource = def_resource if resource == ""
Builtins.y2debug("current resource: %1", resource)
if Builtins.contains(@additional, resource)

if @additional.include?(resource)
log.info "Now cloning: #{resource}"
time_start = Time.now
ret = CommonClone(def_resource, resourceMap)
log.info "Cloning #{resource} took: #{(Time.now - time_start).round} sec"
end
end

Expand Down
3 changes: 3 additions & 0 deletions src/modules/Profile.rb
Expand Up @@ -342,6 +342,9 @@ def Prepare
e = []

Builtins.foreach(@ModuleMap) do |p, d|
# bnc#887115 Hidden modules cannot be cloned
next if d["Hidden"] == "true"

#
# Set resource name, if not using default value
#
Expand Down
1 change: 1 addition & 0 deletions src/modules/Y2ModuleConfig.rb
Expand Up @@ -42,6 +42,7 @@ def ReadMenuEntries(modes)
"Name",
"GenericName",
"Icon",
"Hidden",
"X-SuSE-YaST-AutoInst",
"X-SuSE-YaST-AutoInstResource",
"X-SuSE-YaST-AutoInstClient",
Expand Down
6 changes: 3 additions & 3 deletions src/scrconf/autoinstall.scr
@@ -1,6 +1,6 @@
/**
* File: yast2_desktop.scr
* Summary: Agent for reading/writing yast2 menuentries
* File: autoinstall.scr
* Summary: Agent for reading desktop files
* Author: Michal Svec <msvec@suse.cz>
* Anas Nashif <nashif@suse.de>
* Access: read / write
Expand All @@ -20,7 +20,7 @@
`IniAgent( [ "/usr/share/applications/YaST2/*.desktop" , "/usr/share/autoinstall/modules/*.desktop" ],
$[
"options" : [ ],
"comments" : [ "^[ \t]*;.*", ";.*", "\\{[^}]*\\}", "^[ \t]*$" ],
"comments" : [ "^[ \t]*;.*", ";.*", "\\{[^}]*\\}", "^[ \t]*$", "^#[ \t].*" ],
"sections" : [
$[ "begin" : [
"^[ \t]*\\[[ \t]*(.*[^ \t])[ \t]*\\][ \t]*",
Expand Down

0 comments on commit 422ca9b

Please sign in to comment.