Author: locilka
Date: Tue Sep 2 11:20:57 2008
New Revision: 50557
URL: http://svn.opensuse.org/viewcvs/yast?rev=50557&view=rev
Log:
- Extended control file handling to accept 'execute' module
parameter to be called instead of 'name'/inst_'name'
(BNC #401319).
Modified:
trunk/yast2/library/control/src/ProductControl.ycp
trunk/yast2/package/yast2.changes
Modified: trunk/yast2/library/control/src/ProductControl.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/control/src/ProductControl.ycp?rev=50557&r1=50556&r2=50557&view=diff
==============================================================================
--- trunk/yast2/library/control/src/ProductControl.ycp (original)
+++ trunk/yast2/library/control/src/ProductControl.ycp Tue Sep 2 11:20:57 2008
@@ -312,28 +312,41 @@
return false;
};
-
-string getClientName(string name ) {
+/**
+ * Returns name of the script to call. If 'execute' is defined,
+ * the client name is taken from there. Then, if a custom control
+ * file is defined, client name is defined as 'name'. Then, inst_'name'
+ * or just 'name' is returned if it does not match the 'inst_' regexp.
+ *
+ * @param string name
+ * @param string execute
+ * @see custom_control_file
+ */
+string getClientName (string name, string execute) {
if (Mode::test())
{
return "inst_test_workflow";
}
- // All client start with "inst_".
- string client = "";
- if ( custom_control_file != "")
- {
- return name;
+
+ // BNC #401319
+ // 'execute; is defined and thus returned
+ if (execute != "" && execute != "") {
+ y2milestone ("Step name '%1' executes '%2'", name, execute);
+ return execute;
}
- else
- {
- if (issubstring(name, _client_prefix)) {
+
+ // Defined custom control file
+ if (custom_control_file != "") {
+ return name;
+
+ // All standard clients start with "inst_"
+ } else {
+ if (issubstring (name, _client_prefix)) {
return name;
} else {
- client = _client_prefix + name;
- return client;
+ return _client_prefix + name;
}
-
}
}
@@ -345,7 +358,7 @@
*/
global define term getClientTerm (map step, map def, any former_result)
{
- string client = getClientName(step["name"]:"dummy");
+ string client = getClientName (step["name"]:"dummy", step["execute"]:"");
term result = toterm(client);
map