Author: locilka
Date: Wed Feb 3 15:08:41 2010
New Revision: 60673
URL: http://svn.opensuse.org/viewcvs/yast?rev=60673&view=rev
Log:
- Checking repositories after registration, offering to rerun
the registration if no changes in the list of registered
repositories were made (BNC #575102).
- 2.17.8.4
Added:
branches/SuSE-Code-11-Branch/wagon/src/clients/wagon_registration_handler.ycp
Modified:
branches/SuSE-Code-11-Branch/wagon/VERSION
branches/SuSE-Code-11-Branch/wagon/package/yast2-wagon.changes
branches/SuSE-Code-11-Branch/wagon/src/clients/wagon_point_of_no_return.ycp
branches/SuSE-Code-11-Branch/wagon/src/config/online_migration.xml
branches/SuSE-Code-11-Branch/wagon/src/modules/Wagon.ycp
Modified: branches/SuSE-Code-11-Branch/wagon/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/wagon/VERSION?rev=60673&r1=60672&r2=60673&view=diff
==============================================================================
--- branches/SuSE-Code-11-Branch/wagon/VERSION (original)
+++ branches/SuSE-Code-11-Branch/wagon/VERSION Wed Feb 3 15:08:41 2010
@@ -1 +1 @@
-2.17.8.3
+2.17.8.4
Modified: branches/SuSE-Code-11-Branch/wagon/package/yast2-wagon.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/wagon/package/yast2-wagon.changes?rev=60673&r1=60672&r2=60673&view=diff
==============================================================================
--- branches/SuSE-Code-11-Branch/wagon/package/yast2-wagon.changes (original)
+++ branches/SuSE-Code-11-Branch/wagon/package/yast2-wagon.changes Wed Feb 3 15:08:41 2010
@@ -2,6 +2,10 @@
Wed Feb 3 09:43:21 CET 2010 - locilka@suse.cz
- Adapted RPM depenencies to prevent from crashes (BNC #551613).
+- Checking repositories after registration, offering to rerun
+ the registration if no changes in the list of registered
+ repositories were made (BNC #575102).
+- 2.17.8.4
-------------------------------------------------------------------
Fri Jan 29 16:35:00 CET 2010 - locilka@suse.cz
Modified: branches/SuSE-Code-11-Branch/wagon/src/clients/wagon_point_of_no_return.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/wagon/src/clients/wagon_point_of_no_return.ycp?rev=60673&r1=60672&r2=60673&view=diff
==============================================================================
--- branches/SuSE-Code-11-Branch/wagon/src/clients/wagon_point_of_no_return.ycp (original)
+++ branches/SuSE-Code-11-Branch/wagon/src/clients/wagon_point_of_no_return.ycp Wed Feb 3 15:08:41 2010
@@ -35,5 +35,9 @@
y2warning ("From this point, wagon cannot revert products anymore!");
Wagon::abort_can_revert_products = false;
+ // @see BNC 575102
+ y2milestone ("Reseting repos_already_registered flag");
+ Wagon::repos_already_registered = false;
+
return `auto;
}
Added: branches/SuSE-Code-11-Branch/wagon/src/clients/wagon_registration_handler.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/wagon/src/clients/wagon_registration_handler.ycp?rev=60673&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/wagon/src/clients/wagon_registration_handler.ycp (added)
+++ branches/SuSE-Code-11-Branch/wagon/src/clients/wagon_registration_handler.ycp Wed Feb 3 15:08:41 2010
@@ -0,0 +1,98 @@
+/**
+ * File:
+ * clients/wagon_registration_handler.ycp
+ *
+ * Module:
+ * Wagon
+ *
+ * Authors:
+ * Lukas Ocilka
+ *
+ * Summary:
+ * Online Migration Tool
+ *
+ * $Id:$
+ *
+ */
+
+{
+ /**
+ * This is a handler scipt for registration that checks whether registration
+ * did its job and whether or not has user skipped it.
+ * See more in BNC #575102.
+ */
+
+ import "Wagon";
+ import "Popup";
+
+ textdomain "wagon";
+
+ list <string> GetCurrentlyEnabledReposByAlias () {
+ list <string> ret = [];
+ map repo_data = $[];
+
+ Wagon::InitPkg();
+ foreach (integer repo_id, Pkg::SourceGetCurrent (true /* enabled only */), {
+ repo_data = Pkg::SourceGeneralData (repo_id);
+ if (repo_data == nil || repo_data == $[]) {
+ y2error ("Erroneous repo ID: %1 - no repo data: %2", repo_id, repo_data);
+ return;
+ }
+ ret = add (ret, repo_data["alias"]:"");
+ });
+
+ return sort (ret);
+ }
+
+ // all repository aliases
+ list <string> all_repos = GetCurrentlyEnabledReposByAlias();
+
+ symbol ret = `auto;
+
+ while (true) {
+ ret = (symbol) WFM::CallFunction ("inst_suse_register", WFM::Args());
+
+ // `abort, `cancel, `back ...
+ // Just return the symbol
+ if (ret != `next) {
+ y2milestone ("Registration returned %1", ret);
+ break;
+ }
+ // --> `next
+
+ // Registration must have done something with repositories
+ // e.g., register new ones, disable old ones - that's wanted
+ if (all_repos != GetCurrentlyEnabledReposByAlias()) {
+ Wagon::repos_already_registered = true;
+ y2milestone ("List of repositories has changed");
+ break;
+ }
+
+ // Registration was called again
+ if (Wagon::repos_already_registered == true) {
+ y2milestone ("Repos already registered");
+ break;
+ }
+
+ // Never called before, nothing changed
+ if (Popup::AnyQuestion (
+ // dialog caption
+ _("Warning"),
+ // pop-up question
+ _("No changes were made to list of the registered repositories.
+This means that you might have skipped the registration or there might
+have been an error in configuration. Eventually, repositories might
+have been already added before.
+
+Do you want to rerun the registration?"),
+ _("&Yes"),
+ _("&No, Skip It"),
+ `focus_yes
+ ) == false) {
+ y2warning ("User does not want to rerun the registration");
+ break;
+ }
+ }
+
+ return ret;
+}
Modified: branches/SuSE-Code-11-Branch/wagon/src/config/online_migration.xml
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/wagon/src/config/online_migration.xml?rev=60673&r1=60672&r2=60673&view=diff
==============================================================================
--- branches/SuSE-Code-11-Branch/wagon/src/config/online_migration.xml (original)
+++ branches/SuSE-Code-11-Branch/wagon/src/config/online_migration.xml Wed Feb 3 15:08:41 2010
@@ -228,6 +228,7 @@
<!-- Offer several possibilities how to set update repository URL -->
<module>
+ <label>Migration Configuration</label>
<name>update_url_dialog</name>
<execute>wagon_update_url</execute>
</module>
@@ -238,8 +239,9 @@
(*) Offered in wagon_update_url if not running via applet
-->
<module>
+ <label>Migration Configuration</label>
<name>suse_register_workflow</name>
- <execute>inst_suse_register</execute>
+ <execute>wagon_registration_handler</execute>
</module>
<!--
@@ -247,6 +249,7 @@
(*) Offered in wagon_update_url if not running via applet
-->
<module>
+ <label>Migration Configuration</label>
<name>wagon_custom_url</name>
<execute>wagon_custom_url</execute>
</module>
@@ -256,11 +259,13 @@
Follows the wagon_ownurl
-->
<module>
+ <label>Migration Configuration</label>
<name>wagon_selfupdate_from_url</name>
<execute>wagon_selfupdate</execute>
</module>
<module>
+ <label>Migration Configuration</label>
<name>wagon_modify_repositories</name>
<execute>wagon_modify_repositories</execute>
</module>
@@ -283,28 +288,33 @@
<!-- Download slideshow, count download sizes, ... -->
<module>
+ <label>Update</label>
<name>prepare_progress</name>
<execute>inst_prepareprogress</execute>
</module>
<!-- From this point, some possibilities are simply 'impossible' ;) -->
<module>
+ <label>Update</label>
<name>point_of_no_return</name>
<execute>wagon_point_of_no_return</execute>
</module>
<module>
+ <label>Update</label>
<name>wagon_kickoff</name>
<execute>inst_kickoff</execute>
</module>
<!-- Upgrade the packages -->
<module>
+ <label>Update</label>
<name>wagon_rpmcopy</name>
<execute>inst_rpmcopy</execute>
</module>
<module>
+ <label>Update</label>
<name>suseconfig_after_update</name>
<execute>inst_suseconfig</execute>
</module>
@@ -313,7 +323,7 @@
<module>
<label>Registration</label>
<name>suse_register_after_update</name>
- <execute>inst_suse_register</execute>
+ <execute>wagon_registration_handler</execute>
</module>
<!-- Congratulate, Inform user to reboot etc. -->
Modified: branches/SuSE-Code-11-Branch/wagon/src/modules/Wagon.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/wagon/src/modules/Wagon.ycp?rev=60673&r1=60672&r2=60673&view=diff
==============================================================================
--- branches/SuSE-Code-11-Branch/wagon/src/modules/Wagon.ycp (original)
+++ branches/SuSE-Code-11-Branch/wagon/src/modules/Wagon.ycp Wed Feb 3 15:08:41 2010
@@ -52,6 +52,10 @@
// revert to the old products
global boolean abort_can_revert_products = true;
+ // Registration can be skipped, this variable tells whether some repos were already
+ // added by registration
+ global boolean repos_already_registered = false;
+
global void SetUpdateWorkflow (string new_update_workflow_type) {
// FIXME: check
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org