Author: jsrain
Date: Thu Sep 30 17:26:12 2010
New Revision: 62510
URL: http://svn.opensuse.org/viewcvs/yast?rev=62510&view=rev
Log:
added missing file
Added:
branches/tmp/jsrain/unattended-migration/update/src/clients/inst_update_partition_auto.ycp
Added: branches/tmp/jsrain/unattended-migration/update/src/clients/inst_update_partition_auto.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsrain/unattended-migration/update/src/clients/inst_update_partition_auto.ycp?rev=62510&view=auto
==============================================================================
--- branches/tmp/jsrain/unattended-migration/update/src/clients/inst_update_partition_auto.ycp (added)
+++ branches/tmp/jsrain/unattended-migration/update/src/clients/inst_update_partition_auto.ycp Thu Sep 30 17:26:12 2010
@@ -0,0 +1,76 @@
+/**
+ * Module: inst_update_partition.ycp
+ *
+ * Authors: Stefan Schubert
+ * Arvin Schnell
+ *
+ * Purpose: Select root partition for update or booting.
+ * RootPart::rootPartitions must be filled before
+ * calling this module.
+ *
+ * $Id:$
+ */
+{
+textdomain "update";
+
+import "ProductControl";
+import "RootPart";
+
+include "update/rootpart.ycp";
+
+if (RootPart::Mounted ()) {
+ Update::Detach ();
+ RootPart::UnmountPartitions (false);
+}
+
+RootPart::Detect ();
+// if there is only one suitable partition which can be mounted, use it without asking
+string target_system = "";
+
+
+map partitions = filter (string name, map p, RootPart::rootPartitions, {
+ return true;
+ return p[`valid]:false;
+});
+
+if (size (partitions) == 1)
+{
+ y2milestone ("Auto-mounting system located at %1", target_system);
+ RootPart::selectedRootPartition = target_system;
+ RootPart::targetOk = RootPart::mount_target ();
+
+ // Not mounted correctly
+ if (! RootPart::targetOk) {
+ // error report
+ Report::Error (_("Failed to mount target system"));
+ UmountMountedPartition();
+ // Correctly mounted but incomplete installation found
+ } else if (RootPart::IncompleteInstallationDetected (Installation::destdir)) {
+ Report::Error (_("A possibly incomplete installation has been detected."));
+ UmountMountedPartition();
+ }
+ else if (!(Pkg::TargetInitialize (Installation::destdir) && Pkg::TargetLoad()))
+ {
+ Report::Error ("Initializing the target system failed");
+ UmountMountedPartition();
+ Pkg::TargetFinish();
+ }
+ else
+ {
+ return `next;
+ }
+}
+symbol ret = RootPartitionDialog (`update_dialog);
+
+if (ret == `next)
+{
+ ret = ProductControl::RunFrom (
+ ProductControl::CurrentStep () + 1,
+ false);
+ if (ret == `next)
+ ret = `finish;
+}
+
+return ret;
+
+}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org