Author: jsuchome
Date: Tue May 12 15:58:09 2009
New Revision: 57140
URL: http://svn.opensuse.org/viewcvs/yast?rev=57140&view=rev
Log:
- rewritten for new installation and migration setup (fate#303644)
- new clients for 1st stage (inst_slepos_initialization) and for
2nd stage (inst_slepos_detection, inst_slepos_migration)
- added POSInstallation module to store data during workflow
- 2.17.1
Added:
branches/SuSE-Code-11-Branch/pos-installation/control/installation.xml
branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_detection.ycp (with props)
branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_initialization.ycp (with props)
branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_migration.ycp (with props)
branches/SuSE-Code-11-Branch/pos-installation/src/modules/
branches/SuSE-Code-11-Branch/pos-installation/src/modules/Makefile.am
branches/SuSE-Code-11-Branch/pos-installation/src/modules/POSInstallation.ycp (with props)
Removed:
branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_data_migration.ycp
Modified:
branches/SuSE-Code-11-Branch/pos-installation/MAINTAINER
branches/SuSE-Code-11-Branch/pos-installation/VERSION
branches/SuSE-Code-11-Branch/pos-installation/control/Makefile.am
branches/SuSE-Code-11-Branch/pos-installation/package/yast2-pos-installation.changes
branches/SuSE-Code-11-Branch/pos-installation/src/Makefile.am
branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_server_selection.ycp
branches/SuSE-Code-11-Branch/pos-installation/yast2-pos-installation.spec.in
Modified: branches/SuSE-Code-11-Branch/pos-installation/MAINTAINER
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/pos-installation/MAINTAINER?rev=57140&r1=57139&r2=57140&view=diff
==============================================================================
--- branches/SuSE-Code-11-Branch/pos-installation/MAINTAINER (original)
+++ branches/SuSE-Code-11-Branch/pos-installation/MAINTAINER Tue May 12 15:58:09 2009
@@ -1 +1 @@
-Lukas Ocilka
+Jiri Suchomel
Modified: branches/SuSE-Code-11-Branch/pos-installation/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/pos-installation/VERSION?rev=57140&r1=57139&r2=57140&view=diff
==============================================================================
--- branches/SuSE-Code-11-Branch/pos-installation/VERSION (original)
+++ branches/SuSE-Code-11-Branch/pos-installation/VERSION Tue May 12 15:58:09 2009
@@ -1 +1 @@
-2.17.0
+2.17.1
Modified: branches/SuSE-Code-11-Branch/pos-installation/control/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/pos-installation/control/Makefile.am?rev=57140&r1=57139&r2=57140&view=diff
==============================================================================
--- branches/SuSE-Code-11-Branch/pos-installation/control/Makefile.am (original)
+++ branches/SuSE-Code-11-Branch/pos-installation/control/Makefile.am Tue May 12 15:58:09 2009
@@ -4,7 +4,7 @@
controldir = /etc/SLEPOS
-control_DATA = slepos_migration.xml
+control_DATA = installation.xml
EXTRA_DIST = $(control_DATA) $(product_DATA)
Added: branches/SuSE-Code-11-Branch/pos-installation/control/installation.xml
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/pos-installation/control/installation.xml?rev=57140&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/pos-installation/control/installation.xml (added)
+++ branches/SuSE-Code-11-Branch/pos-installation/control/installation.xml Tue May 12 15:58:09 2009
@@ -0,0 +1,138 @@
+<?xml version="1.0"?>
+<!DOCTYPE productDefines SYSTEM "/usr/share/YaST2/control/control.dtd">
+<productDefines xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
+ <textdomain>control-SLEPOS</textdomain>
+
+
+ <workflows config:type="list">
+
+ <!-- Workflow for the Add-On installation
+ on a running system -->
+ <workflow>
+ <defaults>
+ no
+ no
+ </defaults>
+
+ <stage>normal</stage>
+ <mode>installation,normal</mode>
+
+ <modules config:type="list">
+ <module>
+ <label>Server Type Selection</label>
+ <name>inst_slepos_server_selection</name>
+ no
+ yes
+ </module>
+ <module>
+ <label>Install Software</label>
+ <name>inst_rpmcopy</name>
+ yes
+ yes
+ </module>
+ </modules>
+ </workflow>
+ </workflows>
+
+ <update>
+
+ <workflows config:type="list">
+ <!-- Workflow for the Update process: First Stage -->
+ <workflow>
+ <defaults>
+ yes
+ yes
+ </defaults>
+
+ <!-- First Stage - Installation -->
+ <stage>initial</stage>
+ <mode>update</mode>
+
+ <!-- Installation: Insert -->
+ <!-- Hidden step !!! -->
+
+
+ <before>initial_update_proposal</before>
+ <modules config:type="list">
+ <module>
+ <name>inst_slepos_initialization</name>
+ </module>
+ </modules>
+
+
+ </workflow>
+
+ <!-- Workflow for the Update process: Second Stage -->
+ <workflow>
+ <defaults>
+ yes
+ yes
+ </defaults>
+
+ <!-- Second Stage - Update -->
+ <stage>continue</stage>
+ <mode>update</mode>
+
+ <!-- Update: Insert new steps -->
+
+
+ <before>release_notes</before>
+ <modules config:type="list">
+ <module>
+ <label>POS Setup</label>
+ <name>inst_slepos_detection</name>
+ </module>
+ <module>
+ <name>inst_slepos_server_selection</name>
+ </module>
+ <module>
+ <name>inst_slepos_migration</name>
+ </module>
+ </modules>
+
+
+ </workflow>
+
+ <!-- Workflow for the New installation - First Stage
+ (nothing to be done here...)
+
+ <workflow>
+ <stage>initial</stage>
+ <mode>installation</mode>
+ </workflow>
+ -->
+
+ <!-- Workflow for the New installation: Second Stage -->
+ <workflow>
+ <defaults>
+ yes
+ yes
+ </defaults>
+
+ <!-- Second Stage - Update -->
+ <stage>continue</stage>
+ <mode>update</mode>
+
+ <!-- Update: Replace Services step -->
+
+
+ <replace>continue_service_proposal</replace>
+
+
+ <label>POS Setup</label>
+ <name>inst_slepos_detection</name>
+
+
+ <name>inst_slepos_server_selection</name>
+
+
+ <name>inst_slepos_migration</name>
+
+
+
+
+ </workflow>
+
+ </workflows>
+ </update>
+</productDefines>
Modified: branches/SuSE-Code-11-Branch/pos-installation/package/yast2-pos-installation.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/pos-installation/package/yast2-pos-installation.changes?rev=57140&r1=57139&r2=57140&view=diff
==============================================================================
--- branches/SuSE-Code-11-Branch/pos-installation/package/yast2-pos-installation.changes (original)
+++ branches/SuSE-Code-11-Branch/pos-installation/package/yast2-pos-installation.changes Tue May 12 15:58:09 2009
@@ -1,4 +1,13 @@
-------------------------------------------------------------------
+Tue May 12 07:58:36 CEST 2009 - jsuchome@suse.cz
+
+- rewritten for new installation and migration setup (fate#303644)
+- new clients for 1st stage (inst_slepos_initialization) and for
+ 2nd stage (inst_slepos_detection, inst_slepos_migration)
+- added POSInstallation module to store data during workflow
+- 2.17.1
+
+-------------------------------------------------------------------
Thu Feb 26 10:21:23 CET 2009 - locilka@suse.cz
- Adapted to SLE 11 Codebase.
Modified: branches/SuSE-Code-11-Branch/pos-installation/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/pos-installation/src/Makefile.am?rev=57140&r1=57139&r2=57140&view=diff
==============================================================================
--- branches/SuSE-Code-11-Branch/pos-installation/src/Makefile.am (original)
+++ branches/SuSE-Code-11-Branch/pos-installation/src/Makefile.am Tue May 12 15:58:09 2009
@@ -2,4 +2,4 @@
# Makefile.am for installation/src
#
-SUBDIRS = clients
+SUBDIRS = clients modules
Added: branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_detection.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_detection.ycp?rev=57140&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_detection.ycp (added)
+++ branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_detection.ycp Tue May 12 15:58:09 2009
@@ -0,0 +1,207 @@
+/**
+ * Package: POS Installation
+ * Summary: Initialization of current SLEPOS status
+ * Authors: Jiri Suchomel
+ *
+ *
+ * This client should be called during 2nd stage of installation or update
+ * of SLES11 together with SLEPOS
+ */
+{
+ textdomain "slepos-installation";
+
+ import "Directory";
+ import "FileUtils";
+ import "Label";
+ import "Mode";
+ import "Popup";
+ import "POSInstallation";
+ import "Stage";
+ import "String";
+ import "Wizard";
+
+ y2milestone ("SLEPOS detection client (%1, %2)", Mode::mode (), Stage::stage ());
+
+ any dialog_ret = `auto;
+
+ if (Mode::update ())
+ {
+ if (FileUtils::Exists ("/root/inst-sys/imported/SuSE-release"))
+ {
+ POSInstallation::suse_release_path = "/root/inst-sys/imported/SuSE-release";
+ y2milestone ("old SuSE-release found");
+ }
+ }
+
+ // just for testing...
+ if (Mode::normal()) Wizard::CreateDialog();
+
+
+ // there are 2 possible situations:
+ // 1. normal SLES11 installation
+ // 2. update from SLE10
+
+ // FIXME nezapomenout inicializovat target&source (az v dalsich krocich)
+
+ // FIXME dat si pozor, at nedelem nektere veci opakovane... (Next & Back): if (!GetInstArgs::going_back ())
+
+ // regular installation of SLES11
+ if (!Mode::update ())
+ {
+ // path to file or directory with data for detection script
+ string file_path = POSInstallation::file_path;
+ string dir_path = POSInstallation::dir_path;
+
+ // FIXME maybe move this part to standalone client...
+
+ // ask for nlpos9 data... :
+ /*
+ zde to probiha podobneji jako u migrace sleposu10, jen je tu navic moznost
+ predat konfiguraci offline BS, ktera slouzi pro konfiguraci BS na slepos11
+ pro offline ldap, detekci tohoto zpusobu si jiz obstara sam migracni
+ skript, je treba jen dopsat do yast komentare text navic pro tuto moznost.
+
+ */
+ term cont = `RadioButtonGroup (`id ("migration_data"), `opt (`notify), `VBox (
+ `Left (`RadioButton (`id ("rb_file"), `opt (`notify), _("Path to archive file"))),
+ `HBox (
+ `HSpacing (3),
+ `HBox (
+ `InputField (`id ("file_path"),`opt (`hstretch), "", file_path),
+ `PushButton (`id ("browse_file"), Label::BrowseButton ())
+ )
+ ),
+ `VSpacing (),
+ `Left (`RadioButton (`id ("rb_dir"), `opt (`notify), _("Path to backup directory"))),
+ `HBox (
+ `HSpacing (3),
+ `HBox (
+ `InputField (`id ("dir_path"),`opt (`hstretch), "", dir_path),
+ `PushButton (`id ("browse_dir"), Label::BrowseButton ())
+ )
+ )
+ ));
+ cont = `HBox (`HSpacing (3), cont, `HSpacing (3));
+
+ // help text
+ string help = _("<p>Enter EITHER nlpos9 migration data, OR SLES11 offline data (whatever it is)....
+ Or nothing, if you don't understand the request.</p>");
+
+ // Dialog caption
+ Wizard::SetContentsButtons (_("Entering Migration Data"), cont, help,
+ Label::BackButton(), Label::NextButton());
+ Wizard::SetTitleIcon ("yast-software");
+
+ UI::ChangeWidget (`id ("file_path"), `Enabled, file_path != "");
+ UI::ChangeWidget (`id ("browse_file"), `Enabled, file_path != "");
+ UI::ChangeWidget (`id ("dir_path"), `Enabled, dir_path != "");
+ UI::ChangeWidget (`id ("browse_dir"), `Enabled, dir_path != "");
+
+ any ret = `next;
+ while (true) {
+ ret = UI::UserInput();
+
+ if (ret == "rb_file" || ret == "rb_dir")
+ {
+ UI::ChangeWidget (`id ("file_path"), `Enabled, ret == "rb_file");
+ UI::ChangeWidget (`id ("browse_file"), `Enabled, ret == "rb_file");
+ UI::ChangeWidget (`id ("dir_path"), `Enabled, ret == "rb_dir");
+ UI::ChangeWidget (`id ("browse_dir"), `Enabled, ret == "rb_dir");
+ }
+ if (ret == "browse_file")
+ {
+ // file location popup label
+ string selected = UI::AskForExistingFile (file_path, "", _("Path to File"));
+ if (selected != nil)
+ {
+ file_path = selected;
+ UI::ChangeWidget (`id ("file_path"), `Value, file_path);
+ }
+ }
+ if (ret == "browse_dir")
+ {
+ // directory location popup label
+ string selected = UI::AskForExistingDirectory (dir_path, _("Path to Directory"));
+ if (selected != nil)
+ {
+ dir_path = selected;
+ UI::ChangeWidget (`id ("dir_path"), `Value, dir_path);
+ }
+ }
+ if (ret == `next)
+ {
+ // FIXME validate
+ // reset the possible value of the string which won't be used
+ if (UI::QueryWidget (`id ("migration_data"), `Value) == "rb_file")
+ dir_path = "";
+ else
+ file_path = "";
+
+ POSInstallation::dir_path = dir_path;
+ POSInstallation::file_path = file_path;
+ dialog_ret = `next;
+ break;
+ }
+ else if (ret == `back) {
+ dialog_ret = `back;
+ break;
+ }
+ else if (ret == `abort || ret == `cancel) {
+ if (Popup::ConfirmAbort (`incomplete))
+ {
+ dialog_ret = `abort;
+ break;
+ }
+ else continue;
+ }
+ }
+ }
+ // the rest of workflow is common to SLES11 installation and update from SLES10
+
+ /*
+ Now, SLEPOS slepos11_get_deploy_type.sh script should detect the type of installation:
+ AS (Admin Server),
+ BS (Branch Server)
+ IS (Image Server)
+
+ 'slepos11_get_deploy_type.sh [<-f file.tar.gz>|<-d backup_directory>] [-o SuSE-release]'
+ return: sum of (AS:1, BS:2, IS:4)
+ */
+
+ string get_type_cmd = POSInstallation::get_type_cmd;
+
+ if (POSInstallation::file_path!= "")
+ get_type_cmd = get_type_cmd + " -f " + POSInstallation::file_path;
+ else if (POSInstallation::dir_path != "")
+ get_type_cmd = get_type_cmd + " -d " + POSInstallation::dir_path;
+
+ if (POSInstallation::suse_release_path != "")
+ get_type_cmd = get_type_cmd + " -o " + POSInstallation::suse_release_path;
+
+ get_type_cmd = String::Quote (get_type_cmd);
+
+ // detection should be fast, no need for progress and/or background
+ map out = (map) SCR::Execute (.target.bash_output, get_type_cmd);
+ integer ret = 0;
+ if (out["stderr"]:"" == "" && out["exit"]:0 > 0 && out["exit"]:0 < 8)
+ ret = out["exit"]:0;
+
+ y2milestone ("output of '%1': %2", get_type_cmd, out);
+
+ // reset the map with detected servers...
+ map detected = $[];
+
+ if ((ret | 1) == ret)
+ detected["SLEPOS_Server_Admin"] = true;
+ if ((ret | 2) == ret)
+ detected["SLEPOS_Server_Branch"]= true;
+ if ((ret | 4) == ret)
+ detected["SLEPOS_Image_Server"] = true;
+
+ // ... and save new one
+ POSInstallation::detected = detected;
+
+ if (Mode::normal()) Wizard::CloseDialog();
+
+ return dialog_ret;
+}
Added: branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_initialization.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_initialization.ycp?rev=57140&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_initialization.ycp (added)
+++ branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_initialization.ycp Tue May 12 15:58:09 2009
@@ -0,0 +1,39 @@
+/**
+ * This client should be called at the beginning of update with SLESPOS 11 Add-On,
+ * to silently perform some initialization steps before the real update starts
+ */
+
+{
+ import "Directory";
+ import "GetInstArgs";
+ import "Mode";
+ import "Installation";
+ import "Stage";
+ import "String";
+
+ y2milestone ("SLEPOS initializaton (%1, %2)", Mode::mode (), Stage::stage ());
+
+ if (!Mode::update () || !Stage::initial ())
+ {
+ y2milestone ("this should only run in first stage of update: exiting");
+ return `auto;
+ }
+
+ // save old /etc/SuSE-release, so we can find it in 2nd stage
+ // it will be in /root/inst-sys/imported after installation
+ if (!GetInstArgs::going_back ())
+ {
+ SCR::Execute (.target.mkdir, "/root/imported");
+ map out = (map) SCR::Execute (.target.bash_output, sformat (
+ "cp '%1/etc/SuSE-release' /root/imported",
+ String::Quote (Installation::destdir))
+ );
+ if (out["exit"]:1 != 0)
+ {
+ y2error ("saving old SuSE-release failed: %1", out);
+ }
+ else
+ y2milestone ("SuSE-release copied to /root/imported");
+ }
+ return `auto;
+}
Added: branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_migration.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_migration.ycp?rev=57140&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_migration.ycp (added)
+++ branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_migration.ycp Tue May 12 15:58:09 2009
@@ -0,0 +1,251 @@
+/**
+ * Package: POS Installation
+ * Summary: Migration of old SLEPOS data
+ * Authors: Jiri Suchomel
+ *
+ * This client should be called during 2nd stage of installation or update
+ * of SLES11 together with SLEPOS
+ */
+
+{
+ textdomain "slepos-installation";
+
+ import "Directory";
+ import "GetInstArgs";
+ import "Label";
+ import "Mode";
+ import "Popup";
+ import "POSInstallation";
+ import "Stage";
+ import "String";
+ import "Wizard";
+
+ y2milestone ("SLEPOS migration client (%1, %2)", Mode::mode (), Stage::stage ());
+
+ symbol dialog_ret = `auto;
+
+ if (size (POSInstallation::for_migration) < 1)
+ {
+ y2milestone ("nothing to migrate: skipping...");
+ return `auto;
+ }
+ if (GetInstArgs::going_back ())
+ {
+ y2milestone ("nothing to do when going back...");
+ return `back;
+ }
+
+
+ if (Mode::normal())
+ Wizard::CreateDialog();
+
+ term cont = `HBox (`HSpacing (3), `VBox (
+ `VSpacing (),
+ `ReplacePoint (`id (`rp_current),
+ // progress bar label
+ `ProgressBar (`id (`current_progress), _("Migration Step Progress"))
+ ),
+ `VSpacing (0.2),
+ `ReplacePoint (`id(`rp_total),
+ // progress bar label
+ `ProgressBar (`id (`total_progress ), _("Migration Progress"))
+ ),
+ `VSpacing (),
+ `ReplacePoint (`id (`rp_label),
+ `Label ("")
+ )
+ ), `HSpacing (3));
+
+ integer process_id = -1;
+ string log_file = (string)SCR::Read(.target.tmpdir) + "/slepos_migration.log";
+ integer tasks_passed = -1;
+ integer tasks = 0;
+
+ // read the migrate script output and show progress
+ void update_progress () {
+
+ string line = (string)SCR::Read (.process.read_line, process_id);
+ if (line != nil && line != "")
+ {
+ y2internal ("new line: '%1'", line);
+
+ // read total number of tasks
+ if (substring (line, 0, 6) == "tasks:")
+ {
+ list<string> l = splitstring (line, " ");
+ tasks = tointeger (l[1]:"0");
+ if (tasks == nil)
+ tasks = 0;
+ UI::ReplaceWidget (`id(`rp_total),
+ // progress bar label
+ `ProgressBar (`id (`total_progress ), _("Migration Progress"), tasks)
+ );
+ }
+ // update current task label
+ else if (substring (line, 0, 5) == "task:")
+ {
+ list<string> l = splitstring (line, " ");
+ l = remove (l, 0);
+ string current = mergestring (l, " ");
+ UI::ReplaceWidget (`id(`rp_current),
+ // progress bar label
+ `ProgressBar (`id (`current_progress), current, 100)
+ );
+ tasks_passed = tasks_passed + 1;
+ UI::ChangeWidget (`id (`total_progress), `Value, tasks_passed);
+ UI::ChangeWidget (`id (`current_progress), `Value, 0);
+ }
+ else if (substring (line, 0, 9) == "position:")
+ {
+ list<string> l = splitstring (line, " ");
+ integer pos = tointeger (l[1]:"0");
+ if (pos == nil)
+ pos = 0;
+ UI::ChangeWidget (`id (`current_progress), `Value, pos);
+ }
+ }
+ string err = (string)SCR::Read (.process.read_line_stderr, process_id);
+ if (err!= nil && err != "")
+ y2warning ("error output: '%1'", err);
+ }
+
+ Wizard::SetContentsButtons (
+ // TRANSLATORS: Dialog caption
+ _("POS Data Migration"),
+ cont,
+ // TRANSLATORS: Dialog help
+ _("<p>FIXME</p>"),
+ Label::BackButton(),
+ Label::NextButton()
+ );
+
+
+ Wizard::SetTitleIcon ("yast-software");
+ Wizard::DisableNextButton ();
+ Wizard::DisableBackButton ();
+ // FIXME Abort button is disabled at this time?
+
+ string migrate_cmd = POSInstallation::migrate_cmd;
+
+ if (POSInstallation::file_path!= "")
+ migrate_cmd = migrate_cmd + " -f " + POSInstallation::file_path;
+ else if (POSInstallation::dir_path != "")
+ migrate_cmd = migrate_cmd + " -d " + POSInstallation::dir_path;
+
+ if (POSInstallation::suse_release_path != "")
+ migrate_cmd = migrate_cmd + " -o " + POSInstallation::suse_release_path;
+
+ integer deploy_type = 0;
+ if (POSInstallation::for_migration["SLEPOS_Server_Admin"]:false)
+ deploy_type = 1;
+ if (POSInstallation::for_migration["SLEPOS_Server_Branch"]:false)
+ deploy_type = deploy_type + 2;
+ if (POSInstallation::for_migration["SLEPOS_Image_Server"]:false)
+ deploy_type = deploy_type + 4;
+
+ migrate_cmd = sformat ("%1 -t %2", migrate_cmd, deploy_type);
+ migrate_cmd = migrate_cmd + " -l " + log_file;
+ migrate_cmd = String::Quote (migrate_cmd);
+
+ y2milestone ("migrate command: '%1'", migrate_cmd);
+
+ process_id = (integer) SCR::Execute (.process.start_shell, migrate_cmd);
+ any ret = nil;
+
+ // error log
+ string details = "";
+
+ while (true) {
+ ret = UI::PollInput();
+
+ if (SCR::Read(.process.running, process_id) != true)
+ {
+ update_progress ();
+
+ integer status = (integer) SCR::Read (.process.status, process_id);
+ if (status != 0)
+ {
+ UI::ReplaceWidget (`id (`rp_label), `HBox (
+ // text label (action result)
+ `Left (`Label (_("Migration process failed."))),
+ // push button label
+ `PushButton (`id (`details), _("Show details..."))
+ ));
+ details = (string) SCR::Read (.target.string, log_file);
+ if (details == nil)
+ details = "";
+ }
+ else
+ {
+ // all progress bars to end
+ UI::ChangeWidget (`id (`current_progress), `Value, 100);
+ UI::ChangeWidget (`id (`total_progress), `Value, tasks);
+
+ UI::ReplaceWidget (`id (`rp_label),
+ // text label (action result)
+ `Left (`Label (_("Migration was successfull.")))
+ );
+ }
+ Wizard::EnableNextButton ();
+ Wizard::EnableBackButton ();
+ break;
+ }
+ else
+ {
+ update_progress ();
+ }
+ if (ret == `abort || ret == `cancel)
+ {
+ // yes/no popup FIXME
+ if (Popup::YesNo (_("Cancel migration?")))
+ {
+ SCR::Execute (.process.kill, process_id, 15);
+ sleep (100);
+ SCR::Execute (.process.kill, process_id);
+ break;
+ }
+ }
+ sleep (500);
+ }
+
+ while (true)
+ {
+ ret = UI::UserInput();
+ if (ret == `details)
+ {
+ UI::OpenDialog (`opt(`decorated), `HBox (`HSpacing(1.5), `VBox (
+ `HSpacing (80),
+ `VSpacing (),
+ // log view label
+ `LogView (`id (`details), _("Error log"), 12, 0),
+ `VSpacing (),
+ `PushButton (Label::OKButton ()),
+ `VSpacing (0.2)
+ ), `HSpacing(1.5)));
+ UI::ChangeWidget (`id (`details), `Value, details);
+ UI::UserInput();
+ UI::CloseDialog ();
+ continue;
+ }
+ if (ret == `next)
+ {
+ dialog_ret = `next;
+ break;
+ } else if (ret == `back) {
+ dialog_ret = `back;
+ break;
+ } else if (ret == `abort || ret == `cancel) {
+ if (Popup::ConfirmAbort (`incomplete)) {
+ dialog_ret = `abort;
+ break;
+ } else {
+ continue;
+ }
+ }
+ }
+
+ if (Mode::normal())
+ Wizard::CloseDialog();
+
+ return dialog_ret;
+}
Modified: branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_server_selection.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_server_selection.ycp?rev=57140&r1=57139&r2=57140&view=diff
==============================================================================
--- branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_server_selection.ycp (original)
+++ branches/SuSE-Code-11-Branch/pos-installation/src/clients/inst_slepos_server_selection.ycp Tue May 12 15:58:09 2009
@@ -1,330 +1,263 @@
/**
+ * Package: POS Installation
+ * Summary: Installation of SLEPOS packages
+ * Authors: Lukas Ocilka
+ * Jiri Suchomel
+ *
+ * This client should be called during 2nd stage of installation or update
+ * of SLES11 together with SLEPOS
*/
{
textdomain "slepos-installation";
- import "Wizard";
+ import "GetInstArgs";
import "Label";
- import "Popup";
- import "Installation";
import "Mode";
+ import "PackageCallbacks";
+ import "PackagesUI";
+ import "Popup";
+ import "POSInstallation";
import "Report";
import "Stage";
- import "PackageCallbacks";
- import "Directory";
- import "String";
- import "FileUtils";
+ import "Wizard";
+
+ y2milestone ("SLEPOS installation client (%1, %2)", Mode::mode (), Stage::stage ());
if (Mode::normal())
Wizard::CreateDialog();
list