Author: locilka
Date: Mon Mar 15 17:17:02 2010
New Revision: 61324
URL: http://svn.opensuse.org/viewcvs/yast?rev=61324&view=rev
Log:
- Restarting YaST before calling registration after packages are
upgraded (BNC #587506).
Added:
trunk/wagon/src/clients/wagon_restart_yast.ycp
Modified:
trunk/wagon/package/yast2-wagon.changes
trunk/wagon/src/clients/wagon.ycp
trunk/wagon/src/clients/wagon_update_url.ycp
trunk/wagon/src/config/online_migration.xml
trunk/wagon/src/modules/Wagon.ycp
Modified: trunk/wagon/package/yast2-wagon.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/wagon/package/yast2-wagon.changes?rev=61324&r1=61323&r2=61324&view=diff
==============================================================================
--- trunk/wagon/package/yast2-wagon.changes (original)
+++ trunk/wagon/package/yast2-wagon.changes Mon Mar 15 17:17:02 2010
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Mon Mar 15 13:28:41 CET 2010 - locilka@suse.cz
+
+- Restarting YaST before calling registration after packages are
+ upgraded (BNC #587506).
+
+-------------------------------------------------------------------
Fri Mar 12 17:38:57 CET 2010 - locilka@suse.cz
- Logging all repositories with their products during
Modified: trunk/wagon/src/clients/wagon.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/wagon/src/clients/wagon.ycp?rev=61324&r1=61323&r2=61324&view=diff
==============================================================================
--- trunk/wagon/src/clients/wagon.ycp (original)
+++ trunk/wagon/src/clients/wagon.ycp Mon Mar 15 17:17:02 2010
@@ -99,6 +99,11 @@
string current_workflow = Wagon::GetUpdateWorkflow();
y2milestone ("Current workflow is '%1'", current_workflow);
SCR::Write (.target.ycp, current_workflow_file, current_workflow);
+
+ // Store also current migration method
+ string current_method = Wagon::GetMigrationMethod();
+ y2milestone ("Current migration method is '%1'", current_method);
+ SCR::Write (.target.ycp, Wagon::migration_method_file, current_method);
}
}
@@ -141,6 +146,18 @@
Wagon::SetUpdateWorkflow (workflow_type);
}
}
+
+ if (FileUtils::Exists (Wagon::migration_method_file)) {
+ string migration_method = (string) SCR::Read (.target.ycp, Wagon::migration_method_file);
+ SCR::Execute (.target.remove, Wagon::migration_method_file);
+
+ if (migration_method == nil || migration_method == "") {
+ y2error ("Migration method is invalid: %1", migration_method);
+ } else {
+ y2milestone ("Adjusting to migration method: %1", migration_method);
+ Wagon::SetMigrationMethod (migration_method);
+ }
+ }
}
}
Added: trunk/wagon/src/clients/wagon_restart_yast.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/wagon/src/clients/wagon_restart_yast.ycp?rev=61324&view=auto
==============================================================================
--- trunk/wagon/src/clients/wagon_restart_yast.ycp (added)
+++ trunk/wagon/src/clients/wagon_restart_yast.ycp Mon Mar 15 17:17:02 2010
@@ -0,0 +1,31 @@
+/**
+ * File:
+ * clients/wagon_restart_yast.ycp
+ *
+ * Module:
+ * Wagon
+ *
+ * Authors:
+ * Lukas Ocilka
+ *
+ * Summary:
+ * Online Migration Tool
+ *
+ * $Id$
+ *
+ */
+
+{
+ textdomain "wagon";
+
+ import "GetInstArgs";
+ import "Wagon";
+
+ if (GetInstArgs::going_back()) {
+ y2milestone ("Going back...");
+ return `back;
+ }
+
+ y2milestone ("YaST will be restarted");
+ return `restart_same_step;
+}
Modified: trunk/wagon/src/clients/wagon_update_url.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/wagon/src/clients/wagon_update_url.ycp?rev=61324&r1=61323&r2=61324&view=diff
==============================================================================
--- trunk/wagon/src/clients/wagon_update_url.ycp (original)
+++ trunk/wagon/src/clients/wagon_update_url.ycp Mon Mar 15 17:17:02 2010
@@ -94,12 +94,12 @@
if (selected == `suse_register) {
Wagon::check_repositories_manually = ((boolean) UI::QueryWidget (`id (`manual_check), `Value) == true);
y2milestone ("Checking repos manually: %1", Wagon::check_repositories_manually);
- Wagon::SetUpdateWorkflow ("manual_suse_register");
+ Wagon::SetMigrationMethod("suse_register");
} else if (selected == `custom_url) {
// custom URL uses the same dialog in a different context
Wagon::check_repositories_manually = false;
y2milestone ("Checking repos manually: %1", Wagon::check_repositories_manually);
- Wagon::SetUpdateWorkflow ("manual_custom_url");
+ Wagon::SetMigrationMethod("custom");
}
Wagon::AdjustVariableSteps();
Modified: trunk/wagon/src/config/online_migration.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/wagon/src/config/online_migration.xml?rev=61324&r1=61323&r2=61324&view=diff
==============================================================================
--- trunk/wagon/src/config/online_migration.xml (original)
+++ trunk/wagon/src/config/online_migration.xml Mon Mar 15 17:17:02 2010
@@ -37,6 +37,7 @@
<module>wagon_kickoff</module>
<module>wagon_rpmcopy</module>
<module>suseconfig_after_update</module>
+ <module>restart_yast_before_registration</module>
<module>suse_register_after_update</module>
<module>finished</module>
</modules>
@@ -56,11 +57,10 @@
<module>welcome</module>
<module>update_online_mechanism</module>
<module>install_migration_products</module>
- <!-- Workflow is switched after this module -->
+ <!-- Workflow is tuned after this module -->
<module>update_url_dialog</module>
<module>suse_register_workflow</module>
<module>wagon_manual_url_repositories</module>
- <module>wagon_selfupdate_from_url</module>
<module>wagon_modify_repositories</module>
<module>wagon_check_repositories</module>
<module>prepare_progress</module>
@@ -68,60 +68,7 @@
<module>wagon_kickoff</module>
<module>wagon_rpmcopy</module>
<module>suseconfig_after_update</module>
- <module>suse_register_after_update</module>
- <module>finished</module>
- </modules>
- <proposals config:type="list">
- <proposal>wagon_proposal</proposal>
- </proposals>
- </subworkflow>
-
- <!--
- manual + suse_register workflow: User selected 'Customer Center'
- -->
- <subworkflow>
- <name>manual_suse_register</name>
- <modules config:type="list">
- <module>welcome</module>
- <module>update_online_mechanism</module>
- <module>install_migration_products</module>
- <!-- Workflow is switched after this module -->
- <module>update_url_dialog</module>
- <module>suse_register_workflow</module>
- <module>wagon_modify_repositories</module>
- <module>wagon_check_repositories</module>
- <module>prepare_progress</module>
- <module>point_of_no_return</module>
- <module>wagon_kickoff</module>
- <module>wagon_rpmcopy</module>
- <module>suseconfig_after_update</module>
- <module>suse_register_after_update</module>
- <module>finished</module>
- </modules>
- <proposals config:type="list">
- <proposal>wagon_proposal</proposal>
- </proposals>
- </subworkflow>
-
- <!--
- manual + custom_url workflow: User selected 'Custom URL'
- -->
- <subworkflow>
- <name>manual_custom_url</name>
- <modules config:type="list">
- <module>welcome</module>
- <module>update_online_mechanism</module>
- <module>install_migration_products</module>
- <!-- Workflow is switched after this module -->
- <module>update_url_dialog</module>
- <module>wagon_manual_url_repositories</module>
- <module>wagon_selfupdate_from_url</module>
- <module>wagon_modify_repositories</module>
- <module>prepare_progress</module>
- <module>point_of_no_return</module>
- <module>wagon_kickoff</module>
- <module>wagon_rpmcopy</module>
- <module>suseconfig_after_update</module>
+ <module>restart_yast_before_registration</module>
<module>suse_register_after_update</module>
<module>finished</module>
</modules>
@@ -144,6 +91,7 @@
<module>wagon_kickoff</module>
<module>wagon_rpmcopy</module>
<module>suseconfig_after_update</module>
+ <module>restart_yast_before_registration</module>
<module>suse_register_after_update</module>
<module>finished</module>
</modules>
@@ -262,8 +210,7 @@
</module>
<!--
- Option B:
- Follows the wagon_ownurl
+ Used by PatchCD
-->
<module>
<label>Migration Configuration</label>
@@ -346,6 +293,17 @@
<execute>inst_suseconfig</execute>
</module>
+ <!--
+ BNC #587506: Restart YaST before registration is called to prevent
+ from crashes caused by backward-incompatible changes in (Perl)
+ libraries used by registration.
+ -->
+ <module>
+ <label>Registration</label>
+ <name>restart_yast_before_registration</name>
+ <execute>wagon_restart_yast</execute>
+ </module>
+
<!-- Register the 'new-product' -->
<module>
<label>Registration</label>
Modified: trunk/wagon/src/modules/Wagon.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/wagon/src/modules/Wagon.ycp?rev=61324&r1=61323&r2=61324&view=diff
==============================================================================
--- trunk/wagon/src/modules/Wagon.ycp (original)
+++ trunk/wagon/src/modules/Wagon.ycp Mon Mar 15 17:17:02 2010
@@ -75,6 +75,29 @@
return update_workflow_type;
}
+ string migration_method = nil;
+
+ global string migration_method_file = sformat ("%1/wagon_migration_method", Directory::vardir);
+
+ global boolean SetMigrationMethod (string m_method) {
+ y2milestone ("Setting migration method: %1", m_method);
+
+ if (m_method == "suse_register" || m_method == "custom") {
+ migration_method = m_method;
+ } else {
+ y2error ("Unknown migration method: %1", m_method);
+ Report::Error (sformat(_("Error switching migration method.
+Unknown migration method: %1"), m_method));
+ return false;
+ }
+
+ return true;
+ }
+
+ global string GetMigrationMethod () {
+ return migration_method;
+ }
+
void ResetWorkflowSteps () {
ProductControl::UnDisableAllModulesAndProposals (Mode::mode(), Stage::stage());
}
@@ -136,13 +159,29 @@
* Handles the optional workflow steps according to the current settigns.
*/
global void AdjustVariableSteps () {
- // BNC #579905: Check modified repositories manually.
- if (check_repositories_manually != false) {
- y2milestone ("Enabling module %1", check_repos_module);
- ProductControl::EnableModule (check_repos_module);
- } else {
- y2milestone ("Disabling module %1", check_repos_module);
- ProductControl::DisableModule (check_repos_module);
+ y2milestone ("Adjusting variable steps to '%1' migration method", migration_method);
+
+ // BNC #587506: enable/disable steps according to selected method
+ //
+ // User will not have to enter migration repositories manually
+ // registration takes care about it
+ if (migration_method == "suse_register") {
+ ProductControl::DisableModule ("wagon_manual_url_repositories");
+ ProductControl::EnableModule ("suse_register_workflow");
+
+ // BNC #579905: Check modified repositories manually.
+ if (check_repositories_manually != false) {
+ y2milestone ("Enabling module %1", check_repos_module);
+ ProductControl::EnableModule (check_repos_module);
+ } else {
+ y2milestone ("Disabling module %1", check_repos_module);
+ ProductControl::DisableModule (check_repos_module);
+ }
+ // User has chosen to enter all migration repositories manually
+ } else if (migration_method == "custom") {
+ ProductControl::DisableModule ("wagon_check_repositories");
+ ProductControl::DisableModule ("suse_register_workflow");
+ ProductControl::EnableModule ("wagon_manual_url_repositories");
}
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org