Mailinglist Archive: yast-commit (459 mails)

< Previous Next >
[yast-commit] r60672 - in /trunk/wagon: package/yast2-wagon.changes src/clients/wagon_point_of_no_return.ycp src/clients/wagon_registration_handler.ycp src/config/online_migration.xml src/modules/Wagon.ycp
  • From: locilka@xxxxxxxxxxxxxxxx
  • Date: Wed, 03 Feb 2010 14:08:11 -0000
  • Message-id: <E1Ncftr-0003M8-6v@xxxxxxxxxxxxxxxx>
Author: locilka
Date: Wed Feb 3 15:08:10 2010
New Revision: 60672

URL: http://svn.opensuse.org/viewcvs/yast?rev=60672&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).


Added:
trunk/wagon/src/clients/wagon_registration_handler.ycp
Modified:
trunk/wagon/package/yast2-wagon.changes
trunk/wagon/src/clients/wagon_point_of_no_return.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=60672&r1=60671&r2=60672&view=diff
==============================================================================
--- trunk/wagon/package/yast2-wagon.changes (original)
+++ trunk/wagon/package/yast2-wagon.changes Wed Feb 3 15:08:10 2010
@@ -2,6 +2,9 @@
Wed Feb 3 09:43:21 CET 2010 - locilka@xxxxxxx

- 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).

-------------------------------------------------------------------
Fri Jan 29 16:35:00 CET 2010 - locilka@xxxxxxx

Modified: trunk/wagon/src/clients/wagon_point_of_no_return.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/wagon/src/clients/wagon_point_of_no_return.ycp?rev=60672&r1=60671&r2=60672&view=diff
==============================================================================
--- trunk/wagon/src/clients/wagon_point_of_no_return.ycp (original)
+++ trunk/wagon/src/clients/wagon_point_of_no_return.ycp Wed Feb 3 15:08:10
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: trunk/wagon/src/clients/wagon_registration_handler.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/wagon/src/clients/wagon_registration_handler.ycp?rev=60672&view=auto
==============================================================================
--- trunk/wagon/src/clients/wagon_registration_handler.ycp (added)
+++ trunk/wagon/src/clients/wagon_registration_handler.ycp Wed Feb 3 15:08:10
2010
@@ -0,0 +1,98 @@
+/**
+ * File:
+ * clients/wagon_registration_handler.ycp
+ *
+ * Module:
+ * Wagon
+ *
+ * Authors:
+ * Lukas Ocilka <locilka@xxxxxxx>
+ *
+ * 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: trunk/wagon/src/config/online_migration.xml
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/wagon/src/config/online_migration.xml?rev=60672&r1=60671&r2=60672&view=diff
==============================================================================
--- trunk/wagon/src/config/online_migration.xml (original)
+++ trunk/wagon/src/config/online_migration.xml Wed Feb 3 15:08:10 2010
@@ -229,6 +229,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>
@@ -239,8 +240,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>

<!--
@@ -248,6 +250,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>
@@ -257,11 +260,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>
@@ -284,28 +289,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>
@@ -314,7 +324,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: trunk/wagon/src/modules/Wagon.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/wagon/src/modules/Wagon.ycp?rev=60672&r1=60671&r2=60672&view=diff
==============================================================================
--- trunk/wagon/src/modules/Wagon.ycp (original)
+++ trunk/wagon/src/modules/Wagon.ycp Wed Feb 3 15:08:10 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@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages