Author: locilka
Date: Tue Oct 23 14:08:40 2007
New Revision: 41522
URL: http://svn.opensuse.org/viewcvs/yast?rev=41522&view=rev
Log:
- Enhancing upgrade mode to preselect patterns according to list
already of installed selections (selections were dropped).
- 2.13.3
Modified:
trunk/pos-installation/VERSION
trunk/pos-installation/package/yast2-pos-installation.changes
trunk/pos-installation/src/clients/inst_slepos_server_selection.ycp
Modified: trunk/pos-installation/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/VERSION?rev=41522&r1=41521&r2=41522&view=diff
==============================================================================
--- trunk/pos-installation/VERSION (original)
+++ trunk/pos-installation/VERSION Tue Oct 23 14:08:40 2007
@@ -1 +1 @@
-2.13.2
+2.13.3
Modified: trunk/pos-installation/package/yast2-pos-installation.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/package/yast2-pos-installation.changes?rev=41522&r1=41521&r2=41522&view=diff
==============================================================================
--- trunk/pos-installation/package/yast2-pos-installation.changes (original)
+++ trunk/pos-installation/package/yast2-pos-installation.changes Tue Oct 23 14:08:40 2007
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Tue Oct 23 14:04:42 CEST 2007 - locilka@suse.cz
+
+- Enhancing upgrade mode to preselect patterns according to list
+ already of installed selections (selections were dropped).
+- 2.13.3
+
+-------------------------------------------------------------------
Mon Oct 15 12:38:05 CEST 2007 - locilka@suse.cz
- Changing location of migration control file to /etc/SLEPOS.
Modified: trunk/pos-installation/src/clients/inst_slepos_server_selection.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pos-installation/src/clients/inst_slepos_server_selection.ycp?rev=41522&r1=41521&r2=41522&view=diff
==============================================================================
--- trunk/pos-installation/src/clients/inst_slepos_server_selection.ycp (original)
+++ trunk/pos-installation/src/clients/inst_slepos_server_selection.ycp Tue Oct 23 14:08:40 2007
@@ -13,6 +13,9 @@
import "Report";
import "Stage";
import "PackageCallbacks";
+ import "Directory";
+ import "String";
+ import "FileUtils";
if (Mode::normal())
Wizard::CreateDialog();
@@ -38,6 +41,20 @@
],
];
+ /**
+ * Describes mapping of old selections to new patterns for the upgrade case.
+ *
+ * @struct $[
+ * "selection_name" : [ "list", "of", "new", "patterns", ... ],
+ * ...
+ * ]
+ */
+ map selections_to_patterns = $[
+ "SLRS-Server" : [ "SLEPOS_Server_Admin", "SLEPOS_Server_Branch" ],
+ "SLRS_Image" : [ "SLEPOS_Image" ],
+ "SLRS_Image_Server" : [ "SLEPOS_Image_Server" ],
+ ];
+
list <string> all_patterns_in_selection = [];
void InitTargetNow () {
@@ -58,11 +75,128 @@
return pattern_label;
}
+ string already_proposed = Directory::tmpdir + "/SLEPOS_upgrade_already_proposed";
+
+ void ProposeUpgrade () {
+ if (FileUtils::Exists (already_proposed)) {
+ y2milestone ("Already proposed");
+ return;
+ } else {
+ y2milestone ("Proposing upgrade");
+ SCR::Execute (.target.bash, sformat ("touch '%1'", String::Quote (already_proposed)));
+ }
+
+ string selections_stored_in = Installation::destdir + "/var/adm/YaST/SelDB/";
+
+ list <string> selections_in_use = [];
+ if (FileUtils::Exists (selections_stored_in)) {
+ selections_in_use = (list <string>) SCR::Read (.target.dir, selections_stored_in);
+ y2milestone ("Selections currently in use: %1", selections_in_use);
+ } else {
+ y2warning ("Directory %1 doesn't exist", selections_stored_in);
+ }
+
+ boolean need_to_solve = false;;
+
+ // check all selections in use
+ foreach (string one_selection, selections_in_use, {
+ if (! regexpmatch (one_selection, "^.*\.sel$")) {
+ y2warning ("Not a selection: %1", one_selection);
+ return;
+ }
+
+ one_selection = regexpsub (one_selection, "^(.*)\.sel$", "\\1");
+
+ // there's no need to handle that selection
+ if (! haskey (selections_to_patterns, one_selection)) return;
+
+ list <string> patterns_affected = selections_to_patterns[one_selection]:[];
+
+ // internal error, wrong definition
+ if (patterns_affected == [] || patterns_affected == nil) {
+ y2error ("Wrong definition of patterns affected! %1", patterns_affected);
+ return;
+ }
+
+ foreach (string one_pattern_name, patterns_affected, {
+ if (one_pattern_name == nil || one_pattern_name == "") {
+ y2error ("Wrong pattern for %1 -> %2", one_selection, one_pattern_name);
+ return;
+ }
+
+ list