Hello community,
here is the log from the commit of package yast2
checked in at Fri Mar 14 18:03:19 CET 2008.
--------
--- yast2/yast2.changes 2008-03-12 22:34:43.000000000 +0100
+++ /mounts/work_src_done/STABLE/yast2/yast2.changes 2008-03-14 15:27:49.000000000 +0100
@@ -1,0 +2,15 @@
+Fri Mar 14 12:26:39 CET 2008 - locilka@suse.cz
+
+- Several changes in ProductControl modules for automatic
+ configuration and easies enabling and disabling modules.
+- DisabledModules and DisabledProposals were made local and acces
+ to them is available via functional API only. Both for
+ (fate #303396).
+- 2.16.36
+
+-------------------------------------------------------------------
+Fri Mar 14 11:29:13 CET 2008 - jsrain@suse.cz
+
+- fixed textdomain
+
+-------------------------------------------------------------------
@@ -5,0 +21 @@
+- 2.16.35
Old:
----
yast2-2.16.35.tar.bz2
New:
----
yast2-2.16.36.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2.spec ++++++
--- /var/tmp/diff_new_pack.fe6547/_old 2008-03-14 18:02:57.000000000 +0100
+++ /var/tmp/diff_new_pack.fe6547/_new 2008-03-14 18:02:57.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package yast2 (Version 2.16.35)
+# spec file for package yast2 (Version 2.16.36)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -12,12 +12,12 @@
Name: yast2
-Version: 2.16.35
+Version: 2.16.36
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-2.16.35.tar.bz2
+Source0: yast2-2.16.36.tar.bz2
Prefix: /usr
Source1: yast2-rpmlintrc
BuildRequires: perl-XML-Writer update-desktop-files yast2-devtools yast2-perl-bindings yast2-testsuite
@@ -132,7 +132,7 @@
Steffen Winterfeldt
%prep
-%setup -n yast2-2.16.35
+%setup -n yast2-2.16.36
%build
%{prefix}/bin/y2tool y2autoconf
@@ -235,11 +235,20 @@
%doc %{prefix}/share/doc/packages/yast2/system
%doc %{prefix}/share/doc/packages/yast2/types
%doc %{prefix}/share/doc/packages/yast2/wizard
-
%changelog
+* Fri Mar 14 2008 locilka@suse.cz
+- Several changes in ProductControl modules for automatic
+ configuration and easies enabling and disabling modules.
+- DisabledModules and DisabledProposals were made local and acces
+ to them is available via functional API only. Both for
+ (fate #303396).
+- 2.16.36
+* Fri Mar 14 2008 jsrain@suse.cz
+- fixed textdomain
* Wed Mar 12 2008 locilka@suse.cz
- Adjusted ProductControl to evaluate `accept and `ok as if it was
`next (bnc #369846).
+- 2.16.35
* Tue Mar 11 2008 jsrain@suse.cz
- added infrastructure to detect configuration files changed not
by YaST and warn users about such changes possibly getting lost
++++++ yast2-2.16.35.tar.bz2 -> yast2-2.16.36.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-2.16.35/data/country_long.ycp new/yast2-2.16.36/data/country_long.ycp
--- old/yast2-2.16.35/data/country_long.ycp 2007-12-07 15:59:56.000000000 +0100
+++ new/yast2-2.16.36/data/country_long.ycp 2008-03-14 12:21:46.000000000 +0100
@@ -1,11 +1,11 @@
/**
- * $Id: country_long.ycp 42788 2007-12-07 12:25:56Z jsuchome $
+ * $Id: country_long.ycp 45452 2008-03-14 10:29:23Z jsrain $
* Author: Michal Svec
*/
{
-textdomain "country";
+textdomain "base";
return $[
"af_ZA" : _("South Africa"),
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-2.16.35/data/country.ycp new/yast2-2.16.36/data/country.ycp
--- old/yast2-2.16.35/data/country.ycp 2007-12-07 15:59:56.000000000 +0100
+++ new/yast2-2.16.36/data/country.ycp 2008-03-14 12:21:46.000000000 +0100
@@ -1,11 +1,11 @@
/**
- * $Id: country.ycp 42788 2007-12-07 12:25:56Z jsuchome $
+ * $Id: country.ycp 45452 2008-03-14 10:29:23Z jsrain $
* Author: Michal Svec
*/
{
-textdomain "country";
+textdomain "base";
return $[
"AE" : _("United Arab Emirates"),
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-2.16.35/library/control/src/ProductControl.ycp new/yast2-2.16.36/library/control/src/ProductControl.ycp
--- old/yast2-2.16.35/library/control/src/ProductControl.ycp 2008-03-12 17:18:28.000000000 +0100
+++ new/yast2-2.16.36/library/control/src/ProductControl.ycp 2008-03-14 15:02:08.000000000 +0100
@@ -3,8 +3,11 @@
* Package: installation
* Summary: Product Control routines
* Authors: Anas Nashif
+ * Stanislav Visnovsky
+ * Jiri Srain
+ * Lukas Ocilka
*
- * $Id: ProductControl.ycp 45389 2008-03-12 16:18:28Z locilka $
+ * $Id: ProductControl.ycp 45465 2008-03-14 14:02:08Z locilka $
*/
{
textdomain "base";
@@ -68,12 +71,18 @@
global list<map> last_stage_mode = [];
+// -->
+
+// Currently only local variables, they have their own API
+
// List of module to disable in the current run
-global list<string> DisabledModules = [];
+list<string> DisabledModules = [];
// List of proposals to disable in the current run
-global list<string> DisabledProposals = [];
+list<string> DisabledProposals = [];
+
+// <--
// Log files for hooks
global list<string> logfiles = [];
@@ -114,11 +123,12 @@
global list<string> EnableModule (string modname) {
DisabledModules = filter (string mod, DisabledModules, ``(mod != modname));
+
return DisabledModules;
}
/**
- * Disable given module from installation workflow
+ * Disable given module in installation workflow
* @return current list of disabled modules
*/
global list<string> DisableModule (string modname) {
@@ -141,6 +151,43 @@
}
/**
+ * Enable given disabled proposal
+ * @return current list of disabled proposals
+ */
+global list<string> EnableProposal (string enable_proposal) {
+
+ DisabledProposals = filter (string one_proposal, DisabledProposals, {
+ return (one_proposal != enable_proposal);
+ });
+
+ return DisabledProposals;
+}
+
+/**
+ * Disable given proposal in installation workflow
+ * @return current list of disabled proposals
+ */
+global list<string> DisableProposal (string disable_proposal) {
+
+ if (disable_proposal == nil || disable_proposal == "") {
+ y2error ("Module to disable is '%1'", disable_proposal);
+ } else {
+ DisabledProposals = (list<string>) union (DisabledProposals, [disable_proposal]);
+ }
+
+ return DisabledProposals;
+}
+
+/**
+ * Returns list of proposals disabled in workflow
+ *
+ * @return list <string> DisabledProposals
+ */
+global list <string> GetDisabledProposals () {
+ return DisabledProposals;
+}
+
+/**
* Check if a module is disabled
* @param map module map
* @return boolean
@@ -152,10 +199,18 @@
return nil;
}
- if (contains(DisabledModules, mod["name"]:""))
- {
- return true;
+ // Proposal
+ if (mod["proposal"]:"" != nil && mod["proposal"]:"" != "") {
+ if (contains (DisabledProposals, mod["proposal"]:"")) {
+ return true;
+ }
+ // Normal step
+ } else if (mod["name"]:"" != nil && mod["name"]:"" != "") {
+ if (contains (DisabledModules, mod["name"]:"")) {
+ return true;
+ }
}
+
return false;
}
@@ -420,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)
@@ -472,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
@@ -492,7 +578,69 @@
return dgettext (wz_td, label);
}
+list <string> localDisabledProposals = [];
+list <string> localDisabledModules = [];
+
+list <map> already_disabled_workflows = [];
+
+global void DisableAllModulesAndProposals (string mode, string stage) {
+ map this_workflow = $["mode":mode, "stage":stage];
+
+ if (contains (already_disabled_workflows, this_workflow)) {
+ y2milestone ("Workflow %1 already disabled", this_workflow);
+ return;
+ }
+
+ // stores modules and proposals disabled before
+ // this 'general' disabling
+ localDisabledProposals = DisabledProposals;
+ localDisabledModules = DisabledModules;
+
+ y2milestone ("localDisabledProposals: %1", localDisabledProposals);
+ y2milestone ("localDisabledModules: %1", localDisabledModules);
+
+ foreach (map m, getModules (stage, mode, `all), {
+ if (m["proposal"]:"" != nil && m["proposal"]:"" != "") {
+ y2milestone ("Disabling proposal: %1", m);
+ DisabledProposals = (list <string>) union (DisabledProposals, [m["proposal"]:""]);
+ } else if (m["name"]:"" != nil && m["name"]:"" != "") {
+ y2milestone ("Disabling module: %1", m);
+ DisabledModules = (list <string>) union (DisabledModules, [m["name"]:""]);
+ }
+ });
+
+ already_disabled_workflows = (list <map>) union (already_disabled_workflows, [this_workflow]);
+}
+
+global void UnDisableAllModulesAndProposals (string mode, string stage) {
+ map this_workflow = $["mode":mode, "stage":stage];
+
+ y2milestone ("Un-Disabling workflow %1", this_workflow);
+ already_disabled_workflows = filter (map one_workflow, already_disabled_workflows, {
+ return (one_workflow != this_workflow);
+ });
+ // Note: This might be done by a simple reverting with 'X = localX'
+ // but some of these modules don't need to be in a defined mode and stage
+
+ foreach (map m, getModules (stage, mode, `all), {
+ // A proposal
+ // Enable it only if it was enabled before
+ if (m["proposal"]:"" != nil && m["proposal"]:"" != "" && ! contains (localDisabledProposals, m["proposal"]:"")) {
+ y2milestone ("Enabling proposal: %1", m);
+ DisabledProposals = filter (string one_proposal, DisabledProposals, {
+ return (m["proposal"]:"" != one_proposal);
+ });
+ // A module
+ // Enable it only if it was enabled before
+ } else if (m["name"]:"" != nil && m["name"]:"" != "" && ! contains (localDisabledModules, m["name"]:"")) {
+ y2milestone ("Enabling module: %1", m);
+ DisabledModules = filter (string one_module, DisabledModules, {
+ return (m["name"]:"" != one_module);
+ });
+ }
+ });
+}
/**
* Add Wizard Steps
@@ -516,28 +664,42 @@
string first_id = "";
// UI::WizardCommand(`SetVerboseCommands( true ) );
- foreach (map sm , stagemode, ``{
+ foreach (map sm , stagemode, {
y2debug( "Adding wizard steps for %1", sm );
+ // only for debugging
+ y2milestone ("Adding wizard steps for %1", sm);
+
string slabel = getWorkflowLabel(sm["stage"]:"", sm["mode"]:"", wizard_textdomain);
- if ( slabel != "" )
- {
+ if (slabel != "") {
UI::WizardCommand (`AddStepHeading (slabel));
}
+ // just to check whether there are some steps to display
+ list <map> enabled_modules = getModules (sm["stage"]:"", sm["mode"]:"", `enabled);
+ enabled_modules = filter (map m, enabled_modules, {
+ return (m["heading"]:"" == "");
+ });
+ if (size (enabled_modules) == 0) {
+ y2milestone ("There are no (more) steps for %1, section will be disabled", sm);
+ return;
+ }
+
string last_label = "";
string last_domain = "";
- foreach(map m, getModules(sm["stage"]:"", sm["mode"]:"", `enabled),
- ``{
+ foreach (map m, getModules (sm["stage"]:"", sm["mode"]:"", `enabled), {
+ // only for debugging
y2debug("Adding wizard step: %1", m );
- if (haskey (m, "heading") && m["label"]:"" != "")
- {
+
+ // Heading
+ if (haskey (m, "heading") && m["label"]:"" != "") {
UI::WizardCommand (`AddStepHeading (
haskey (m, "textdomain")
? dgettext (m["textdomain"]:"", m["label"]:"")
- : dgettext (wizard_textdomain, m["label"]:"")));
- }
- else if (m["label"]:"" != "")
- {
+ : dgettext (wizard_textdomain, m["label"]:"")
+ ));
+
+ // Label
+ } else if (m["label"]:"" != "") {
if (first_id=="")
{
first_id = m["id"]:"";
@@ -546,28 +708,30 @@
haskey (m, "textdomain")
? dgettext (m["textdomain"]:"", m["label"]:"")
: dgettext (wizard_textdomain, m["label"]:""),
- m["id"]:"" ));
+ m["id"]:""
+ ));
last_label = m["label"]:"";
last_domain = m["textdomain"]:"";
+
+ // The rest
} else {
- if (first_id=="")
- {
+ if (first_id=="") {
first_id = m["id"]:"";
}
- if (last_label != "")
- {
- if (last_domain != "")
+ if (last_label != "") {
+ if (last_domain != "") {
UI::WizardCommand(`AddStep( dgettext(
last_domain,
last_label ),
m["id"]:"" )
);
- else
+ } else {
UI::WizardCommand(`AddStep( dgettext(
wizard_textdomain,
last_label ),
m["id"]:"" )
);
+ }
}
}
});
@@ -579,6 +743,41 @@
/* Forces UpdateWizardSteps to redraw steps even if nothing seem to be changed */
boolean force_UpdateWizardSteps = false;
+// -->
+// Installation without second stage
+// "Automatic Configuration"
+
+// FIXME: read the default value from control file
+boolean use_automatic_configuration = true;
+
+/**
+ * Adjust the automatic configuration to be either enabled or disabled.
+ * Enabling it means that second stage will be disabled.
+ *
+ * @param boolean enabled
+ */
+global void SetUseAutomaticConfiguration (boolean set_param) {
+ if (set_param == nil) {
+ y2error ("Automatic configuration can be either enabled or disabled, not nil!");
+ return;
+ }
+
+ use_automatic_configuration = set_param;
+}
+
+/**
+ * Returns whether automatic configuration will be enabled.
+ *
+ * @return boolean if enabled
+ */
+global boolean GetUseAutomaticConfiguration () {
+ return use_automatic_configuration;
+}
+
+// <--
+
+list <string> lastDisabledModules = DisabledModules;
+
/**
* Update Steps
*/
@@ -587,12 +786,15 @@
if (force_UpdateWizardSteps == true) {
y2milestone ("UpdateWizardSteps forced");
force_UpdateWizardSteps = false;
+ } else if (DisabledModules != lastDisabledModules) {
+ y2milestone ("Disabled modules were changed");
} else if (last_stage_mode == stagemode) {
y2milestone ("No changes in Wizard steps");
return;
}
last_stage_mode = stagemode;
+ lastDisabledModules = DisabledModules;
UI::WizardCommand(`DeleteSteps());
// Also redraws the wizard and sets the current step
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-2.16.35/library/modules/Version.ycp new/yast2-2.16.36/library/modules/Version.ycp
--- old/yast2-2.16.35/library/modules/Version.ycp 2008-03-12 17:26:04.000000000 +0100
+++ new/yast2-2.16.36/library/modules/Version.ycp 2008-03-14 15:28:04.000000000 +0100
@@ -20,7 +20,7 @@
/**
* Version of the yast2 package
*/
-global string yast2 = "2.16.35";
+global string yast2 = "2.16.36";
/* EOF */
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-2.16.35/VERSION new/yast2-2.16.36/VERSION
--- old/yast2-2.16.35/VERSION 2008-03-12 17:21:10.000000000 +0100
+++ new/yast2-2.16.36/VERSION 2008-03-14 15:27:40.000000000 +0100
@@ -1 +1 @@
-2.16.35
+2.16.36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org