Author: locilka
Date: Fri Mar 14 15:02:08 2008
New Revision: 45465
URL: http://svn.opensuse.org/viewcvs/yast?rev=45465&view=rev
Log:
Added function for checking whether running a particular
stage and mode is required
Modified:
trunk/yast2/library/control/src/ProductControl.ycp
Modified: trunk/yast2/library/control/src/ProductControl.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/control/src/ProductControl.ycp?rev=45465&r1=45464&r2=45465&view=diff
==============================================================================
--- trunk/yast2/library/control/src/ProductControl.ycp (original)
+++ trunk/yast2/library/control/src/ProductControl.ycp Fri Mar 14 15:02:08 2008
@@ -3,6 +3,9 @@
* Package: installation
* Summary: Product Control routines
* Authors: Anas Nashif
+ * Stanislav Visnovsky
+ * Jiri Srain
+ * Lukas Ocilka
*
* $Id$
*/
@@ -472,7 +475,7 @@
/**
* Get Workflow
* @param stage Stage
- * @param mode Mdoe
+ * @param mode Mode
* @return map Workflow map
*/
global define map getCompleteWorkflow(string stage, string mode)
@@ -524,6 +527,37 @@
}
/**
+ * Returns whether is is required to run YaST in the defined
+ * stage and mode
+ *
+ * @param string stage
+ * @param string mode
+ * @return boolean if needed
+ */
+global boolean RunRequired (string stage, string mode) {
+ list <map> modules = getModules (stage, mode, `enabled);
+
+ if (modules == nil) {
+ y2error ("Undefined %1/%2", stage, mode);
+ return nil;
+ }
+
+ modules = filter (map one_module, modules, {
+ // modules
+ if (one_module["name"]:"" != nil && one_module["name"]:"" != "") {
+ return true;
+ // proposals
+ } else if (one_module["proposal"]:"" != nil && one_module["proposal"]:"" != "") {
+ return true;
+ }
+ // the rest
+ return false;
+ });
+
+ return (size (modules) > 0);
+}
+
+/**
* Get Workflow Label
* @param string stage
* @param string mode
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org