Mailinglist Archive: yast-commit (233 mails)
| < Previous | Next > |
[yast-commit] r63230 - in /trunk/autoinstallation: ./ package/ src/clients/ src/modules/
- From: jsrain@xxxxxxxxxxxxxxxxx
- Date: Wed, 19 Jan 2011 14:16:36 -0000
- Message-id: <20110119141636.6102A32550@svn2.opensuse.org>
Author: jsrain
Date: Wed Jan 19 15:16:35 2011
New Revision: 63230
URL: http://svn.opensuse.org/viewcvs/yast?rev=63230&view=rev
Log:
- adaptations for unattended migration (fate#310481)
Added:
trunk/autoinstallation/src/clients/inst_autosetup_upgrade.ycp
trunk/autoinstallation/src/clients/inst_store_upgrade_software.ycp
Modified:
trunk/autoinstallation/VERSION
trunk/autoinstallation/autoyast2.spec.in
trunk/autoinstallation/package/autoyast2.changes
trunk/autoinstallation/src/clients/Makefile.am
trunk/autoinstallation/src/clients/autoinst_scripts1_finish.ycp
trunk/autoinstallation/src/clients/autoinst_scripts2_finish.ycp
trunk/autoinstallation/src/clients/inst_autoconfigure.ycp
trunk/autoinstallation/src/clients/inst_autoinit.ycp
trunk/autoinstallation/src/modules/AutoInstall.ycp
trunk/autoinstallation/src/modules/AutoinstConfig.ycp
Modified: trunk/autoinstallation/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/VERSION?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/VERSION (original)
+++ trunk/autoinstallation/VERSION Wed Jan 19 15:16:35 2011
@@ -1 +1 @@
-2.20.3
+2.20.4
Modified: trunk/autoinstallation/autoyast2.spec.in
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/autoyast2.spec.in?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/autoyast2.spec.in (original)
+++ trunk/autoinstallation/autoyast2.spec.in Wed Jan 19 15:16:35 2011
@@ -204,6 +204,9 @@
@clientdir@/autoinst_scripts1_finish.ycp
@clientdir@/autoinst_scripts2_finish.ycp
@clientdir@/ayast_probe.ycp
+@clientdir@/inst_autosetup_upgrade.ycp
+@clientdir@/inst_store_upgrade_software.ycp
+
@yncludedir@/autoinstall/xml.ycp
@yncludedir@/autoinstall/ask.ycp
Modified: trunk/autoinstallation/package/autoyast2.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/package/autoyast2.changes?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/package/autoyast2.changes (original)
+++ trunk/autoinstallation/package/autoyast2.changes Wed Jan 19 15:16:35 2011
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Jan 19 15:15:20 CET 2011 - jsrain@xxxxxxx
+
+- adaptations for unattended migration (fate#310481)
+- 2.20.4
+
+-------------------------------------------------------------------
Tue Jan 4 11:04:33 UTC 2011 - lslezak@xxxxxxx
- fixed build (wrong mount call params)
Modified: trunk/autoinstallation/src/clients/Makefile.am
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/Makefile.am?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/clients/Makefile.am (original)
+++ trunk/autoinstallation/src/clients/Makefile.am Wed Jan 19 15:16:35 2011
@@ -13,6 +13,8 @@
inst_autoinit.ycp \
inst_autopost.ycp \
inst_autosetup.ycp \
+ inst_autosetup_upgrade.ycp \
+ inst_store_upgrade_software.ycp \
report_auto.ycp \
scripts_auto.ycp \
software_auto.ycp \
Modified: trunk/autoinstallation/src/clients/autoinst_scripts1_finish.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/autoinst_scripts1_finish.ycp?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/clients/autoinst_scripts1_finish.ycp (original)
+++ trunk/autoinstallation/src/clients/autoinst_scripts1_finish.ycp Wed Jan 19
15:16:35 2011
@@ -42,7 +42,7 @@
"steps" : 1,
// progress step title
"title" : _("Executing autoinstall scripts in the installation
environment..."),
- "when" : [ `autoinst ],
+ "when" : [ `autoinst, `autoupg ],
];
}
else if (func == "Write")
Modified: trunk/autoinstallation/src/clients/autoinst_scripts2_finish.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/autoinst_scripts2_finish.ycp?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/clients/autoinst_scripts2_finish.ycp (original)
+++ trunk/autoinstallation/src/clients/autoinst_scripts2_finish.ycp Wed Jan 19
15:16:35 2011
@@ -40,7 +40,7 @@
"steps" : 1,
// progress step title
"title" : _("Executing autoinstall scripts in the installation
environment..."),
- "when" : [ `autoinst ],
+ "when" : [ `autoinst, `autoupg ],
];
}
else if (func == "Write")
Modified: trunk/autoinstallation/src/clients/inst_autoconfigure.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/inst_autoconfigure.ycp?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/clients/inst_autoconfigure.ycp (original)
+++ trunk/autoinstallation/src/clients/inst_autoconfigure.ycp Wed Jan 19
15:16:35 2011
@@ -112,10 +112,13 @@
y2milestone("Order: %1", maplist(map d, deps, ``(d["res"]:"")));
- if (!haskey(Profile::current , "networking") ) {
- removeNetwork(); // no networking section -> no network
- } else if( Profile::current["networking","keep_install_network"]:false ==
false ) {
- removeNetwork(); // networking section without keeping the install
network
+ // keep network on AutoYaST ugprade
+ if (! Mode::autoupgrade()) {
+ if (!haskey(Profile::current , "networking") ) {
+ removeNetwork(); // no networking section -> no network
+ } else if( Profile::current["networking","keep_install_network"]:false
== false ) {
+ removeNetwork(); // networking section without keeping the install
network
+ }
}
foreach(map r, deps,
Modified: trunk/autoinstallation/src/clients/inst_autoinit.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/inst_autoinit.ycp?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/clients/inst_autoinit.ycp (original)
+++ trunk/autoinstallation/src/clients/inst_autoinit.ycp Wed Jan 19 15:16:35
2011
@@ -23,6 +23,7 @@
// import "Arch";
import "Call";
import "Console";
+ import "Mode";
import "Popup";
@@ -165,10 +166,22 @@
}
Progress::Title(_("Probing hardware..."));
- WFM::CallFunction("inst_system_analysis", [] );
+
+ if (! (Mode::autoupgrade() && AutoinstConfig::ProfileInRootPart))
+ WFM::CallFunction("inst_system_analysis", [] );
AutoInstallRules::ProbeRules();
if( ! profileFetched ) {
+
+
+ // if profile is defined, first read it, then probe hardware
+ any autoinstall = SCR::Read(.etc.install_inf.AutoYaST);
+ if (Mode::autoupgrade() && ! (autoinstall != nil && is ( autoinstall ,
string ) && (string)autoinstall != ""))
+ {
+ AutoinstConfig::ParseCmdLine("file:///mnt/root/autoupg.xml");
+ AutoinstConfig::ProfileInRootPart = true;
+ }
+
symbol ret = processProfile();
if( ret != `ok ) {
return ret;
Added: trunk/autoinstallation/src/clients/inst_autosetup_upgrade.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/inst_autosetup_upgrade.ycp?rev=63230&view=auto
==============================================================================
--- trunk/autoinstallation/src/clients/inst_autosetup_upgrade.ycp (added)
+++ trunk/autoinstallation/src/clients/inst_autosetup_upgrade.ycp Wed Jan 19
15:16:35 2011
@@ -0,0 +1,434 @@
+/**
+ * File: clients/inst_autosetup.ycp
+ * Package: Auto-installation
+ * Summary: Setup and prepare system for auto-installation
+ * Authors: Anas Nashif <nashif@xxxxxxx>
+ * Uwe Gansert <ug@xxxxxxx>
+ *
+ * $Id: inst_autosetup.ycp 61521 2010-03-29 09:10:07Z ug $
+ */
+
+{
+ textdomain "autoinst";
+
+ import "AutoinstConfig";
+ import "AutoInstall";
+ import "Installation";
+ import "Profile";
+ import "Progress";
+ import "Report";
+ import "AutoinstStorage";
+ import "AutoinstScripts";
+ import "AutoinstGeneral";
+ import "AutoinstSoftware";
+ import "Bootloader";
+ import "BootCommon";
+ import "Popup";
+ import "RunlevelEd";
+ import "Arch";
+ import "AutoinstLVM";
+ import "AutoinstRAID";
+ import "Storage";
+ import "Timezone";
+ import "Keyboard";
+ import "Call";
+ import "ProductControl";
+ import "LanUdevAuto";
+ import "Language";
+ import "Console";
+
+ include "bootloader/routines/autoinstall.ycp";
+ include "autoinstall/ask.ycp";
+
+ define symbol readModified() {
+ if (SCR::Read(.target.size, AutoinstConfig::modified_profile) > 0 ) {
+ if (! Profile::ReadXML( AutoinstConfig::modified_profile ) ||
Profile::current == $[] ) {
+ Popup::Error(_("Error while parsing the control file.
+Check the log files for more details or fix the
+control file and try again.
+"));
+ return `abort;
+ }
+ string cpcmd = sformat("mv %1 %2","/tmp/profile/autoinst.xml",
"/tmp/profile/pre-autoinst.xml");
+ y2milestone("copy original profile: %1",cpcmd);
+ SCR::Execute(.target.bash, cpcmd);
+
+ cpcmd = sformat("mv %1 %2", AutoinstConfig::modified_profile,
"/tmp/profile/autoinst.xml");
+ y2milestone("moving modified profile: %1",cpcmd);
+ SCR::Execute(.target.bash, cpcmd);
+ return `found;
+ }
+ return `not_found;
+ }
+
+ string help_text = _("<P>Please wait while the system is prepared for
autoinstallation.</P>");
+ list<string> progress_stages =
+ [
+ _("Configure General Settings "),
+ _("Execute pre-install user scripts"),
+ _("Set up language"),
+ _("Configure Software selections"),
+ ];
+
+ list<string> progress_descriptions =
+ [
+ _("Configuring general settings..."),
+ _("Executing pre-install user scripts..."),
+ _("Configuring Software selections...")
+ ];
+
+ Progress::New(
+ _("Preparing System for Automated Installation"),
+ "", // progress_title
+ size( progress_stages ), // progress bar length
+ progress_stages,
+ progress_descriptions,
+ help_text );
+
+
+ if(UI::PollInput() == `abort)
+ if (Popup::ConfirmAbort (`painless))
+ return `abort;
+ Progress::NextStage();
+
+
+ // configure general settings
+
+
+
+
+
+ if(UI::PollInput() == `abort)
+ if (Popup::ConfirmAbort (`painless))
+ return `abort;
+
+ Progress::NextStage();
+
+ // Pre-Scripts
+ AutoinstScripts::Import(Profile::current["scripts"]:$[]);
+ AutoinstScripts::Write("pre-scripts", false);
+
+ // Reread Profile in case it was modified in pre-script
+ // User has to create the new profile in a pre-defined
+ // location for easy processing in pre-script.
+
+ if( readModified() == `abort )
+ return `abort;
+
+ //
+ // Partitioning and Storage
+ ////////////////////////////////////////////////////////////////////////
+
+ boolean modified = true;
+ do {
+ askDialog();
+ // Pre-Scripts
+ AutoinstScripts::Import(Profile::current["scripts"]:$[]);
+ AutoinstScripts::Write("pre-scripts", false);
+ symbol ret = readModified();
+ if( ret == `abort )
+ return `abort;
+ if( ret == `not_found )
+ modified = false;
+ } while( modified == true );
+
+ // reimport scripts, for the case <ask> has changed them
+ AutoinstScripts::Import(Profile::current["scripts"]:$[]);
+ //
+ // Set Mouse and other workflow variables
+ //
+ AutoinstGeneral::Import(Profile::current["general"]:$[]);
+ y2milestone("general: %1", Profile::current["general"]:$[] );
+ AutoinstGeneral::Write();
+
+ if( haskey( Profile::current, "add-on" ) ) {
+ Call::Function("add-on_auto", ["Import",
Profile::current["add-on"]:$[]] );
+ Call::Function("add-on_auto", ["Write"]);
+ }
+
+ boolean use_utf8 = true; // utf8 is default
+
+ map displayinfo = UI::GetDisplayInfo();
+ if ( ! displayinfo["HasFullUtf8Support"]:true )
+ {
+ use_utf8 = false; // fallback to ascii
+ }
+
+
+ //
+ // Set it in the Language module.
+ //
+ Progress::NextStep();
+ Progress::Title(_("Configuring language..."));
+ Language::Import( Profile::current["language"]:$[] );
+
+ //
+ // Set Console font
+ //
+ Installation::encoding = Console::SelectFont( Language::language );
+
+ if (displayinfo["HasFullUtf8Support"]:true)
+ {
+ Installation::encoding = "UTF-8";
+ }
+
+ UI::SetLanguage (Language::language, Installation::encoding);
+ WFM::SetLanguage (Language::language, "UTF-8");
+
+ if( haskey( Profile::current, "timezone" ) )
+ Timezone::Import(Profile::current["timezone"]:$[]);
+ if( haskey( Profile::current, "keyboard" ) )
+ Keyboard::Import(Profile::current["keyboard"]:$[]);
+
+
+ // one can override the <confirm> option by the commandline parameter
y2confirm
+ string tmp = (string)SCR::Read (.target.string, "/proc/cmdline");
+ if (tmp != nil && contains (splitstring (tmp, " \n"), "y2confirm")) {
+ AutoinstConfig::Confirm = true;
+ y2milestone("y2confirm found and confirm turned on");
+ }
+
+
+ if(UI::PollInput() == `abort)
+ if (Popup::ConfirmAbort (`painless))
+ return `abort;
+
+ // moved here from autoinit for fate #301193
+ // needs testing
+ if( Arch::s390 () && AutoinstConfig::remoteProfile == true ) {
+ y2milestone("arch=s390 and remote_profile=true");
+ if( haskey(Profile::current, "dasd") ) {
+ y2milestone("dasd found");
+ Call::Function("dasd_auto", ["Import",
Profile::current["dasd"]:$[] ]);
+ }
+ if( haskey(Profile::current, "zfcp") ) {
+ y2milestone("zfcp found");
+ Call::Function("zfcp_auto", ["Import",
Profile::current["zfcp"]:$[] ]);
+ }
+ }
+
+ Progress::NextStage();
+
+ Storage::ReReadTargetMap();
+
+ if (! (Mode::autoupgrade() && AutoinstConfig::ProfileInRootPart)) {
+ if (`abort == WFM::CallFunction("inst_update_partition_auto", []))
+ return `abort;
+ }
+
+
+ // Software
+
+ if(UI::PollInput() == `abort)
+ if (Popup::ConfirmAbort (`painless))
+ return `abort;
+
+ Progress::NextStage();
+
+ // initialize package manager
+ import "Packages";
+ import "PackageCallbacks";
+ import "Update";
+ import "RootPart";
+ import "ProductFeatures";
+ import "Product";
+
+// FIXME FIXME FIXME copy-paste from update_proposal
+ map <string, any> GetUpdateConf () {
+ // 'nil' values are skipped, in that case, ZYPP uses own default values
+ map <string, boolean> ret = $[];
+
+// not supported by libzypp anymore
+// if (Update::deleteOldPackages != nil) {
+// ret["delete_unmaintained"] = Update::deleteOldPackages;
+// }
+
+ if (Update::silentlyDowngradePackages != nil) {
+ ret["silent_downgrades"] = Update::silentlyDowngradePackages;
+ }
+
+ y2milestone ("Using update configuration: %1", ret);
+
+ return ret;
+ }
+
+ Packages::Init(true);
+
+ // initialize target
+ if (true)
+ {
+ PackageCallbacks::SetConvertDBCallbacks ();
+
+ Pkg::TargetInit (Installation::destdir, false);
+
+ Update::GetProductName ();
+ }
+
+ // FATE #301990, Bugzilla #238488
+ // Set initial update-related (packages/patches) values from control
file
+ Update::InitUpdate();
+
+ // some products are listed in media control file and at least one is
compatible
+ // with system just being updated
+ boolean update_not_possible = false;
+
+ // FATE #301844
+ y2milestone ("Previous '%1', New '%2' RootPart",
+ RootPart::previousRootPartition, RootPart::selectedRootPartition);
+ if (RootPart::previousRootPartition !=
RootPart::selectedRootPartition) {
+ RootPart::previousRootPartition = RootPart::selectedRootPartition;
+
+ // check whether update is possible
+ // reset deleteOldPackages and onlyUpdateInstalled in respect to
the selected system
+ Update::Reset();
+ if (! Update::IsProductSupportedForUpgrade()) {
+ y2milestone ("Upgrade is not supported");
+ update_not_possible = true;
+ }
+ }
+
+ // this is new - override the default upgrade mode
+ if (Profile::current["upgrade","only_installed_packages"]:nil != nil)
+ Update::onlyUpdateInstalled =
Profile::current["upgrade","only_installed_packages"]:true;
+
+ // connect target with package manager
+ if (!Update::did_init1)
+ {
+ Update::did_init1 = true;
+
+ if (size (Pkg::ResolvableProperties ("", `pattern, "")) > 0)
+ {
+ y2milestone ("No base selection found, but patterns found...");
+ Packages::using_patterns = true;
+ }
+
+ list<string> restore = [];
+ list<map<string,any> > selected = Pkg::ResolvableProperties ("",
`product, "");
+ foreach (map<string,any> s, selected, {
+ restore = add (restore, s["name"]:"");
+ });
+
+ Pkg::PkgApplReset ();
+
+ // bnc #300540
+ // bnc #391785
+ // Drops packages after PkgApplReset, not before (that would null
that)
+ Update::DropObsoletePackages();
+
+ foreach (string res, restore, {
+ Pkg::ResolvableInstall (res, `product);
+ });
+ if (! Update::onlyUpdateInstalled)
+ {
+ if (Packages::using_patterns)
+ {
+ Update::SetDesktopPattern ();
+ }
+ else
+ {
+ Update::ProposeSelection ();
+ }
+ }
+
+ if (Update::onlyUpdateInstalled) // just
consider already installed packages
+ {
+ Pkg::SetSelection (""); // -> don't
select any additional selections
+ }
+ else if (Packages::using_patterns)
+ {
+ if (! ProductFeatures::GetBooleanFeature ("software",
+ "only_update_installed"))
+ {
+ foreach (string pat, Product::patterns, {
+ y2milestone("Pre-select pattern %1", pat);
+ Pkg::ResolvableInstall( pat, `pattern );
+ });
+ }
+
+ }
+ else // update
selections too
+ {
+ Pkg::SetSelection (Update::selected_selection); // -> set the
base selection (minimal, default, ....)
+
+ if (!Update::manual_interaction)
+ {
+ // now compare installed (old) selections against
available (new) selections
+ // and set all selections which are installed (old) and
available (new)
+ // as 'to be installed' -> UI will show "to be updated"
for these selections
+
+ list<string> available_addons = Pkg::GetSelections
(`available, "");
+ list<string> installed_addons = Pkg::GetSelections
(`installed, "");
+
+ foreach (string installed, installed_addons,
+ {
+ if (contains (available_addons, installed)) // we
have a newer selection for an installed one
+ {
+ Pkg::SetSelection (installed); //
update this selection too (selection solving included)
+ }
+ });
+ }
+ }
+
+ Packages::SelectProduct();
+ Pkg::ActivateSelections (); // now
go through all selected selections and select their packages
+ // bnc #382208
+
+ // bnc#582702 - do not select kernel on update, leave that on
dependencies like 'zypper dup'
+ // therefore commented line below out
+// Packages::SelectKernelPackages ();
+
+ // FATE #301990, Bugzilla #238488
+ // Control the upgrade process better
+ map <symbol, integer> update_sum
+ = Pkg::PkgUpdateAll (GetUpdateConf());
+ y2milestone ("Update summary: %1", update_sum);
+ Update::unknown_packages = update_sum[`ProblemListSze]:0;
+
+ list<string> sys_patterns = Packages::ComputeSystemPatternList ();
+ foreach (string pat, sys_patterns, {
+ Pkg::ResolvableInstall (pat, `pattern);
+ });
+ // this is new, (de)select stuff from the profile
+ list<string> packages = Profile::current["software","packages"]:[];
+ list<string> patterns = Profile::current["software","patterns"]:[];
+ list<string> remove_packages =
Profile::current["software","remove-packages"]:[];
+ list<string> remove_patterns =
Profile::current["software","remove-patterns"]:[];
+ foreach (string p, remove_patterns, {
+ Pkg::ResolvableRemove (p, `pattern);
+ });
+ foreach (string p, remove_packages, {
+ Pkg::ResolvableRemove (p, `package);
+ });
+ foreach (string p, patterns, {
+ Pkg::ResolvableInstall (p, `pattern);
+ });
+ foreach (string p, packages, {
+ Pkg::ResolvableInstall (p, `package);
+ });
+ // old stuff again here
+ if (Pkg::PkgSolve (!Update::onlyUpdateInstalled))
+ Update::solve_errors = 0;
+ else
+ {
+ Update::solve_errors = Pkg::PkgSolveErrors ();
+ if (Profile::current["upgrade","stop_on_solver_conflict"]:true)
+ AutoinstConfig::Confirm = true;
+ }
+
+ }
+
+ // Backup
+ y2internal ("Backup: %1", Profile::current["backup"]:nil);
+ Installation::update_backup_modified =
Profile::current["backup","modified"]:true;
+ y2internal ("Backup modified: %1", Installation::update_backup_modified);
+ Installation::update_backup_sysconfig =
Profile::current["backup","sysconfig"]:true;
+ Installation::update_remove_old_backups =
Profile::current["backup","remove_old"]:false;
+
+ AutoInstall::TurnOff();
+ Progress::Finish();
+
+ symbol ret = ProductControl::RunFrom ( ProductControl::CurrentStep () + 1,
true);
+ if (ret == `next)
+ return `finish;
+ return ret;
+}
Added: trunk/autoinstallation/src/clients/inst_store_upgrade_software.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/inst_store_upgrade_software.ycp?rev=63230&view=auto
==============================================================================
--- trunk/autoinstallation/src/clients/inst_store_upgrade_software.ycp (added)
+++ trunk/autoinstallation/src/clients/inst_store_upgrade_software.ycp Wed Jan
19 15:16:35 2011
@@ -0,0 +1,64 @@
+{
+ import "GetInstArgs";
+ import "Popup";
+ import "Profile";
+ import "Installation";
+
+ if ( GetInstArgs::going_back())
+ return `auto;
+
+ // find out status of patterns
+ list<map<string,any> > patterns = Pkg::ResolvableProperties ("", `pattern,
"");
+ patterns = filter (map<string,any> p, patterns, {
+ return p["transact_by"]:nil == `user || p["transact_by"]:nil ==
`app_high;
+ });
+
+ list<string> patterns_to_remove = [];
+ list<string> patterns_to_install = maplist (map<string,any> p, patterns, {
+ if (p["status"]:nil == `selected || p["status"]:nil == `installed)
+ return p["name"]:"";
+ else if (p["status"]:nil == `removed || p["status"]:nil == `available)
+ patterns_to_remove = add (patterns_to_remove, p["name"]:"");
+ return nil;
+ });
+ patterns_to_install = filter (string p, patterns_to_install, {
+ return p != nil;
+ });
+ y2milestone ("Patterns to install: %1", patterns_to_install);
+ y2milestone ("Patterns to remove: %1", patterns_to_remove);
+
+ // find out status of packages
+ list<map<string,any> > packages = Pkg::ResolvableProperties ("", `package,
"");
+ packages = filter (map<string,any> p, packages, {
+ return p["transact_by"]:nil == `user || p["transact_by"]:nil ==
`app_high;
+ });
+
+ list<string> packages_to_remove = [];
+ list<string> packages_to_install = maplist (map<string,any> p, packages, {
+ if (p["status"]:nil == `selected || p["status"]:nil == `installed)
+ return p["name"]:"";
+ else if (p["status"]:nil == `removed || p["status"]:nil == `available)
+ packages_to_remove = add (packages_to_remove, p["name"]:"");
+ return nil;
+ });
+ packages_to_install = filter (string p, packages_to_install, {
+ return p != nil;
+ });
+ y2milestone ("Packages to install: %1", packages_to_install);
+ y2milestone ("Packages to remove: %1", packages_to_remove);
+
+ map software = $[
+ "packages": packages_to_install,
+ "patterns": patterns_to_install,
+ "remove-packages": packages_to_remove,
+ "remove-patterns": patterns_to_remove,
+ ];
+
+ Profile::current["software"] = software;
+ // /root exists during upgrade
+ Profile::Save (Installation::destdir + "/root/autoupg_updated.xml");
+
+
+ return `auto;
+}
+
Modified: trunk/autoinstallation/src/modules/AutoInstall.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/modules/AutoInstall.ycp?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/modules/AutoInstall.ycp (original)
+++ trunk/autoinstallation/src/modules/AutoInstall.ycp Wed Jan 19 15:16:35 2011
@@ -162,7 +162,7 @@
*/
global define boolean Save()
{
- if (Mode::autoinst ())
+ if (Mode::autoinst () || Mode::autoupgrade())
return (Profile::SaveProfileStructure(
AutoinstConfig::parsedControlFile ));
else
return true;
Modified: trunk/autoinstallation/src/modules/AutoinstConfig.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/modules/AutoinstConfig.ycp?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/modules/AutoinstConfig.ycp (original)
+++ trunk/autoinstallation/src/modules/AutoinstConfig.ycp Wed Jan 19 15:16:35
2011
@@ -167,6 +167,11 @@
//
global boolean RebootMsg = false;
+ //
+ // AutoYaST profile is stored in the root partition (for upgrade)
+ //
+ global boolean ProfileInRootPart = false;
+
//
// remote profile (invented for pre-probing of s390)
@@ -369,7 +374,7 @@
*/
global define void AutoinstConfig ()
``{
- if (Mode::autoinst () && Stage::initial() )
+ if ((Mode::autoinst ()|| Mode::autoupgrade ()) && Stage::initial() )
{
any autoinstall = SCR::Read(.etc.install_inf.AutoYaST);
if (autoinstall != nil && is ( autoinstall , string ) )
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
Date: Wed Jan 19 15:16:35 2011
New Revision: 63230
URL: http://svn.opensuse.org/viewcvs/yast?rev=63230&view=rev
Log:
- adaptations for unattended migration (fate#310481)
Added:
trunk/autoinstallation/src/clients/inst_autosetup_upgrade.ycp
trunk/autoinstallation/src/clients/inst_store_upgrade_software.ycp
Modified:
trunk/autoinstallation/VERSION
trunk/autoinstallation/autoyast2.spec.in
trunk/autoinstallation/package/autoyast2.changes
trunk/autoinstallation/src/clients/Makefile.am
trunk/autoinstallation/src/clients/autoinst_scripts1_finish.ycp
trunk/autoinstallation/src/clients/autoinst_scripts2_finish.ycp
trunk/autoinstallation/src/clients/inst_autoconfigure.ycp
trunk/autoinstallation/src/clients/inst_autoinit.ycp
trunk/autoinstallation/src/modules/AutoInstall.ycp
trunk/autoinstallation/src/modules/AutoinstConfig.ycp
Modified: trunk/autoinstallation/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/VERSION?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/VERSION (original)
+++ trunk/autoinstallation/VERSION Wed Jan 19 15:16:35 2011
@@ -1 +1 @@
-2.20.3
+2.20.4
Modified: trunk/autoinstallation/autoyast2.spec.in
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/autoyast2.spec.in?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/autoyast2.spec.in (original)
+++ trunk/autoinstallation/autoyast2.spec.in Wed Jan 19 15:16:35 2011
@@ -204,6 +204,9 @@
@clientdir@/autoinst_scripts1_finish.ycp
@clientdir@/autoinst_scripts2_finish.ycp
@clientdir@/ayast_probe.ycp
+@clientdir@/inst_autosetup_upgrade.ycp
+@clientdir@/inst_store_upgrade_software.ycp
+
@yncludedir@/autoinstall/xml.ycp
@yncludedir@/autoinstall/ask.ycp
Modified: trunk/autoinstallation/package/autoyast2.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/package/autoyast2.changes?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/package/autoyast2.changes (original)
+++ trunk/autoinstallation/package/autoyast2.changes Wed Jan 19 15:16:35 2011
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Jan 19 15:15:20 CET 2011 - jsrain@xxxxxxx
+
+- adaptations for unattended migration (fate#310481)
+- 2.20.4
+
+-------------------------------------------------------------------
Tue Jan 4 11:04:33 UTC 2011 - lslezak@xxxxxxx
- fixed build (wrong mount call params)
Modified: trunk/autoinstallation/src/clients/Makefile.am
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/Makefile.am?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/clients/Makefile.am (original)
+++ trunk/autoinstallation/src/clients/Makefile.am Wed Jan 19 15:16:35 2011
@@ -13,6 +13,8 @@
inst_autoinit.ycp \
inst_autopost.ycp \
inst_autosetup.ycp \
+ inst_autosetup_upgrade.ycp \
+ inst_store_upgrade_software.ycp \
report_auto.ycp \
scripts_auto.ycp \
software_auto.ycp \
Modified: trunk/autoinstallation/src/clients/autoinst_scripts1_finish.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/autoinst_scripts1_finish.ycp?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/clients/autoinst_scripts1_finish.ycp (original)
+++ trunk/autoinstallation/src/clients/autoinst_scripts1_finish.ycp Wed Jan 19
15:16:35 2011
@@ -42,7 +42,7 @@
"steps" : 1,
// progress step title
"title" : _("Executing autoinstall scripts in the installation
environment..."),
- "when" : [ `autoinst ],
+ "when" : [ `autoinst, `autoupg ],
];
}
else if (func == "Write")
Modified: trunk/autoinstallation/src/clients/autoinst_scripts2_finish.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/autoinst_scripts2_finish.ycp?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/clients/autoinst_scripts2_finish.ycp (original)
+++ trunk/autoinstallation/src/clients/autoinst_scripts2_finish.ycp Wed Jan 19
15:16:35 2011
@@ -40,7 +40,7 @@
"steps" : 1,
// progress step title
"title" : _("Executing autoinstall scripts in the installation
environment..."),
- "when" : [ `autoinst ],
+ "when" : [ `autoinst, `autoupg ],
];
}
else if (func == "Write")
Modified: trunk/autoinstallation/src/clients/inst_autoconfigure.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/inst_autoconfigure.ycp?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/clients/inst_autoconfigure.ycp (original)
+++ trunk/autoinstallation/src/clients/inst_autoconfigure.ycp Wed Jan 19
15:16:35 2011
@@ -112,10 +112,13 @@
y2milestone("Order: %1", maplist(map d, deps, ``(d["res"]:"")));
- if (!haskey(Profile::current , "networking") ) {
- removeNetwork(); // no networking section -> no network
- } else if( Profile::current["networking","keep_install_network"]:false ==
false ) {
- removeNetwork(); // networking section without keeping the install
network
+ // keep network on AutoYaST ugprade
+ if (! Mode::autoupgrade()) {
+ if (!haskey(Profile::current , "networking") ) {
+ removeNetwork(); // no networking section -> no network
+ } else if( Profile::current["networking","keep_install_network"]:false
== false ) {
+ removeNetwork(); // networking section without keeping the install
network
+ }
}
foreach(map r, deps,
Modified: trunk/autoinstallation/src/clients/inst_autoinit.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/inst_autoinit.ycp?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/clients/inst_autoinit.ycp (original)
+++ trunk/autoinstallation/src/clients/inst_autoinit.ycp Wed Jan 19 15:16:35
2011
@@ -23,6 +23,7 @@
// import "Arch";
import "Call";
import "Console";
+ import "Mode";
import "Popup";
@@ -165,10 +166,22 @@
}
Progress::Title(_("Probing hardware..."));
- WFM::CallFunction("inst_system_analysis", [] );
+
+ if (! (Mode::autoupgrade() && AutoinstConfig::ProfileInRootPart))
+ WFM::CallFunction("inst_system_analysis", [] );
AutoInstallRules::ProbeRules();
if( ! profileFetched ) {
+
+
+ // if profile is defined, first read it, then probe hardware
+ any autoinstall = SCR::Read(.etc.install_inf.AutoYaST);
+ if (Mode::autoupgrade() && ! (autoinstall != nil && is ( autoinstall ,
string ) && (string)autoinstall != ""))
+ {
+ AutoinstConfig::ParseCmdLine("file:///mnt/root/autoupg.xml");
+ AutoinstConfig::ProfileInRootPart = true;
+ }
+
symbol ret = processProfile();
if( ret != `ok ) {
return ret;
Added: trunk/autoinstallation/src/clients/inst_autosetup_upgrade.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/inst_autosetup_upgrade.ycp?rev=63230&view=auto
==============================================================================
--- trunk/autoinstallation/src/clients/inst_autosetup_upgrade.ycp (added)
+++ trunk/autoinstallation/src/clients/inst_autosetup_upgrade.ycp Wed Jan 19
15:16:35 2011
@@ -0,0 +1,434 @@
+/**
+ * File: clients/inst_autosetup.ycp
+ * Package: Auto-installation
+ * Summary: Setup and prepare system for auto-installation
+ * Authors: Anas Nashif <nashif@xxxxxxx>
+ * Uwe Gansert <ug@xxxxxxx>
+ *
+ * $Id: inst_autosetup.ycp 61521 2010-03-29 09:10:07Z ug $
+ */
+
+{
+ textdomain "autoinst";
+
+ import "AutoinstConfig";
+ import "AutoInstall";
+ import "Installation";
+ import "Profile";
+ import "Progress";
+ import "Report";
+ import "AutoinstStorage";
+ import "AutoinstScripts";
+ import "AutoinstGeneral";
+ import "AutoinstSoftware";
+ import "Bootloader";
+ import "BootCommon";
+ import "Popup";
+ import "RunlevelEd";
+ import "Arch";
+ import "AutoinstLVM";
+ import "AutoinstRAID";
+ import "Storage";
+ import "Timezone";
+ import "Keyboard";
+ import "Call";
+ import "ProductControl";
+ import "LanUdevAuto";
+ import "Language";
+ import "Console";
+
+ include "bootloader/routines/autoinstall.ycp";
+ include "autoinstall/ask.ycp";
+
+ define symbol readModified() {
+ if (SCR::Read(.target.size, AutoinstConfig::modified_profile) > 0 ) {
+ if (! Profile::ReadXML( AutoinstConfig::modified_profile ) ||
Profile::current == $[] ) {
+ Popup::Error(_("Error while parsing the control file.
+Check the log files for more details or fix the
+control file and try again.
+"));
+ return `abort;
+ }
+ string cpcmd = sformat("mv %1 %2","/tmp/profile/autoinst.xml",
"/tmp/profile/pre-autoinst.xml");
+ y2milestone("copy original profile: %1",cpcmd);
+ SCR::Execute(.target.bash, cpcmd);
+
+ cpcmd = sformat("mv %1 %2", AutoinstConfig::modified_profile,
"/tmp/profile/autoinst.xml");
+ y2milestone("moving modified profile: %1",cpcmd);
+ SCR::Execute(.target.bash, cpcmd);
+ return `found;
+ }
+ return `not_found;
+ }
+
+ string help_text = _("<P>Please wait while the system is prepared for
autoinstallation.</P>");
+ list<string> progress_stages =
+ [
+ _("Configure General Settings "),
+ _("Execute pre-install user scripts"),
+ _("Set up language"),
+ _("Configure Software selections"),
+ ];
+
+ list<string> progress_descriptions =
+ [
+ _("Configuring general settings..."),
+ _("Executing pre-install user scripts..."),
+ _("Configuring Software selections...")
+ ];
+
+ Progress::New(
+ _("Preparing System for Automated Installation"),
+ "", // progress_title
+ size( progress_stages ), // progress bar length
+ progress_stages,
+ progress_descriptions,
+ help_text );
+
+
+ if(UI::PollInput() == `abort)
+ if (Popup::ConfirmAbort (`painless))
+ return `abort;
+ Progress::NextStage();
+
+
+ // configure general settings
+
+
+
+
+
+ if(UI::PollInput() == `abort)
+ if (Popup::ConfirmAbort (`painless))
+ return `abort;
+
+ Progress::NextStage();
+
+ // Pre-Scripts
+ AutoinstScripts::Import(Profile::current["scripts"]:$[]);
+ AutoinstScripts::Write("pre-scripts", false);
+
+ // Reread Profile in case it was modified in pre-script
+ // User has to create the new profile in a pre-defined
+ // location for easy processing in pre-script.
+
+ if( readModified() == `abort )
+ return `abort;
+
+ //
+ // Partitioning and Storage
+ ////////////////////////////////////////////////////////////////////////
+
+ boolean modified = true;
+ do {
+ askDialog();
+ // Pre-Scripts
+ AutoinstScripts::Import(Profile::current["scripts"]:$[]);
+ AutoinstScripts::Write("pre-scripts", false);
+ symbol ret = readModified();
+ if( ret == `abort )
+ return `abort;
+ if( ret == `not_found )
+ modified = false;
+ } while( modified == true );
+
+ // reimport scripts, for the case <ask> has changed them
+ AutoinstScripts::Import(Profile::current["scripts"]:$[]);
+ //
+ // Set Mouse and other workflow variables
+ //
+ AutoinstGeneral::Import(Profile::current["general"]:$[]);
+ y2milestone("general: %1", Profile::current["general"]:$[] );
+ AutoinstGeneral::Write();
+
+ if( haskey( Profile::current, "add-on" ) ) {
+ Call::Function("add-on_auto", ["Import",
Profile::current["add-on"]:$[]] );
+ Call::Function("add-on_auto", ["Write"]);
+ }
+
+ boolean use_utf8 = true; // utf8 is default
+
+ map displayinfo = UI::GetDisplayInfo();
+ if ( ! displayinfo["HasFullUtf8Support"]:true )
+ {
+ use_utf8 = false; // fallback to ascii
+ }
+
+
+ //
+ // Set it in the Language module.
+ //
+ Progress::NextStep();
+ Progress::Title(_("Configuring language..."));
+ Language::Import( Profile::current["language"]:$[] );
+
+ //
+ // Set Console font
+ //
+ Installation::encoding = Console::SelectFont( Language::language );
+
+ if (displayinfo["HasFullUtf8Support"]:true)
+ {
+ Installation::encoding = "UTF-8";
+ }
+
+ UI::SetLanguage (Language::language, Installation::encoding);
+ WFM::SetLanguage (Language::language, "UTF-8");
+
+ if( haskey( Profile::current, "timezone" ) )
+ Timezone::Import(Profile::current["timezone"]:$[]);
+ if( haskey( Profile::current, "keyboard" ) )
+ Keyboard::Import(Profile::current["keyboard"]:$[]);
+
+
+ // one can override the <confirm> option by the commandline parameter
y2confirm
+ string tmp = (string)SCR::Read (.target.string, "/proc/cmdline");
+ if (tmp != nil && contains (splitstring (tmp, " \n"), "y2confirm")) {
+ AutoinstConfig::Confirm = true;
+ y2milestone("y2confirm found and confirm turned on");
+ }
+
+
+ if(UI::PollInput() == `abort)
+ if (Popup::ConfirmAbort (`painless))
+ return `abort;
+
+ // moved here from autoinit for fate #301193
+ // needs testing
+ if( Arch::s390 () && AutoinstConfig::remoteProfile == true ) {
+ y2milestone("arch=s390 and remote_profile=true");
+ if( haskey(Profile::current, "dasd") ) {
+ y2milestone("dasd found");
+ Call::Function("dasd_auto", ["Import",
Profile::current["dasd"]:$[] ]);
+ }
+ if( haskey(Profile::current, "zfcp") ) {
+ y2milestone("zfcp found");
+ Call::Function("zfcp_auto", ["Import",
Profile::current["zfcp"]:$[] ]);
+ }
+ }
+
+ Progress::NextStage();
+
+ Storage::ReReadTargetMap();
+
+ if (! (Mode::autoupgrade() && AutoinstConfig::ProfileInRootPart)) {
+ if (`abort == WFM::CallFunction("inst_update_partition_auto", []))
+ return `abort;
+ }
+
+
+ // Software
+
+ if(UI::PollInput() == `abort)
+ if (Popup::ConfirmAbort (`painless))
+ return `abort;
+
+ Progress::NextStage();
+
+ // initialize package manager
+ import "Packages";
+ import "PackageCallbacks";
+ import "Update";
+ import "RootPart";
+ import "ProductFeatures";
+ import "Product";
+
+// FIXME FIXME FIXME copy-paste from update_proposal
+ map <string, any> GetUpdateConf () {
+ // 'nil' values are skipped, in that case, ZYPP uses own default values
+ map <string, boolean> ret = $[];
+
+// not supported by libzypp anymore
+// if (Update::deleteOldPackages != nil) {
+// ret["delete_unmaintained"] = Update::deleteOldPackages;
+// }
+
+ if (Update::silentlyDowngradePackages != nil) {
+ ret["silent_downgrades"] = Update::silentlyDowngradePackages;
+ }
+
+ y2milestone ("Using update configuration: %1", ret);
+
+ return ret;
+ }
+
+ Packages::Init(true);
+
+ // initialize target
+ if (true)
+ {
+ PackageCallbacks::SetConvertDBCallbacks ();
+
+ Pkg::TargetInit (Installation::destdir, false);
+
+ Update::GetProductName ();
+ }
+
+ // FATE #301990, Bugzilla #238488
+ // Set initial update-related (packages/patches) values from control
file
+ Update::InitUpdate();
+
+ // some products are listed in media control file and at least one is
compatible
+ // with system just being updated
+ boolean update_not_possible = false;
+
+ // FATE #301844
+ y2milestone ("Previous '%1', New '%2' RootPart",
+ RootPart::previousRootPartition, RootPart::selectedRootPartition);
+ if (RootPart::previousRootPartition !=
RootPart::selectedRootPartition) {
+ RootPart::previousRootPartition = RootPart::selectedRootPartition;
+
+ // check whether update is possible
+ // reset deleteOldPackages and onlyUpdateInstalled in respect to
the selected system
+ Update::Reset();
+ if (! Update::IsProductSupportedForUpgrade()) {
+ y2milestone ("Upgrade is not supported");
+ update_not_possible = true;
+ }
+ }
+
+ // this is new - override the default upgrade mode
+ if (Profile::current["upgrade","only_installed_packages"]:nil != nil)
+ Update::onlyUpdateInstalled =
Profile::current["upgrade","only_installed_packages"]:true;
+
+ // connect target with package manager
+ if (!Update::did_init1)
+ {
+ Update::did_init1 = true;
+
+ if (size (Pkg::ResolvableProperties ("", `pattern, "")) > 0)
+ {
+ y2milestone ("No base selection found, but patterns found...");
+ Packages::using_patterns = true;
+ }
+
+ list<string> restore = [];
+ list<map<string,any> > selected = Pkg::ResolvableProperties ("",
`product, "");
+ foreach (map<string,any> s, selected, {
+ restore = add (restore, s["name"]:"");
+ });
+
+ Pkg::PkgApplReset ();
+
+ // bnc #300540
+ // bnc #391785
+ // Drops packages after PkgApplReset, not before (that would null
that)
+ Update::DropObsoletePackages();
+
+ foreach (string res, restore, {
+ Pkg::ResolvableInstall (res, `product);
+ });
+ if (! Update::onlyUpdateInstalled)
+ {
+ if (Packages::using_patterns)
+ {
+ Update::SetDesktopPattern ();
+ }
+ else
+ {
+ Update::ProposeSelection ();
+ }
+ }
+
+ if (Update::onlyUpdateInstalled) // just
consider already installed packages
+ {
+ Pkg::SetSelection (""); // -> don't
select any additional selections
+ }
+ else if (Packages::using_patterns)
+ {
+ if (! ProductFeatures::GetBooleanFeature ("software",
+ "only_update_installed"))
+ {
+ foreach (string pat, Product::patterns, {
+ y2milestone("Pre-select pattern %1", pat);
+ Pkg::ResolvableInstall( pat, `pattern );
+ });
+ }
+
+ }
+ else // update
selections too
+ {
+ Pkg::SetSelection (Update::selected_selection); // -> set the
base selection (minimal, default, ....)
+
+ if (!Update::manual_interaction)
+ {
+ // now compare installed (old) selections against
available (new) selections
+ // and set all selections which are installed (old) and
available (new)
+ // as 'to be installed' -> UI will show "to be updated"
for these selections
+
+ list<string> available_addons = Pkg::GetSelections
(`available, "");
+ list<string> installed_addons = Pkg::GetSelections
(`installed, "");
+
+ foreach (string installed, installed_addons,
+ {
+ if (contains (available_addons, installed)) // we
have a newer selection for an installed one
+ {
+ Pkg::SetSelection (installed); //
update this selection too (selection solving included)
+ }
+ });
+ }
+ }
+
+ Packages::SelectProduct();
+ Pkg::ActivateSelections (); // now
go through all selected selections and select their packages
+ // bnc #382208
+
+ // bnc#582702 - do not select kernel on update, leave that on
dependencies like 'zypper dup'
+ // therefore commented line below out
+// Packages::SelectKernelPackages ();
+
+ // FATE #301990, Bugzilla #238488
+ // Control the upgrade process better
+ map <symbol, integer> update_sum
+ = Pkg::PkgUpdateAll (GetUpdateConf());
+ y2milestone ("Update summary: %1", update_sum);
+ Update::unknown_packages = update_sum[`ProblemListSze]:0;
+
+ list<string> sys_patterns = Packages::ComputeSystemPatternList ();
+ foreach (string pat, sys_patterns, {
+ Pkg::ResolvableInstall (pat, `pattern);
+ });
+ // this is new, (de)select stuff from the profile
+ list<string> packages = Profile::current["software","packages"]:[];
+ list<string> patterns = Profile::current["software","patterns"]:[];
+ list<string> remove_packages =
Profile::current["software","remove-packages"]:[];
+ list<string> remove_patterns =
Profile::current["software","remove-patterns"]:[];
+ foreach (string p, remove_patterns, {
+ Pkg::ResolvableRemove (p, `pattern);
+ });
+ foreach (string p, remove_packages, {
+ Pkg::ResolvableRemove (p, `package);
+ });
+ foreach (string p, patterns, {
+ Pkg::ResolvableInstall (p, `pattern);
+ });
+ foreach (string p, packages, {
+ Pkg::ResolvableInstall (p, `package);
+ });
+ // old stuff again here
+ if (Pkg::PkgSolve (!Update::onlyUpdateInstalled))
+ Update::solve_errors = 0;
+ else
+ {
+ Update::solve_errors = Pkg::PkgSolveErrors ();
+ if (Profile::current["upgrade","stop_on_solver_conflict"]:true)
+ AutoinstConfig::Confirm = true;
+ }
+
+ }
+
+ // Backup
+ y2internal ("Backup: %1", Profile::current["backup"]:nil);
+ Installation::update_backup_modified =
Profile::current["backup","modified"]:true;
+ y2internal ("Backup modified: %1", Installation::update_backup_modified);
+ Installation::update_backup_sysconfig =
Profile::current["backup","sysconfig"]:true;
+ Installation::update_remove_old_backups =
Profile::current["backup","remove_old"]:false;
+
+ AutoInstall::TurnOff();
+ Progress::Finish();
+
+ symbol ret = ProductControl::RunFrom ( ProductControl::CurrentStep () + 1,
true);
+ if (ret == `next)
+ return `finish;
+ return ret;
+}
Added: trunk/autoinstallation/src/clients/inst_store_upgrade_software.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/inst_store_upgrade_software.ycp?rev=63230&view=auto
==============================================================================
--- trunk/autoinstallation/src/clients/inst_store_upgrade_software.ycp (added)
+++ trunk/autoinstallation/src/clients/inst_store_upgrade_software.ycp Wed Jan
19 15:16:35 2011
@@ -0,0 +1,64 @@
+{
+ import "GetInstArgs";
+ import "Popup";
+ import "Profile";
+ import "Installation";
+
+ if ( GetInstArgs::going_back())
+ return `auto;
+
+ // find out status of patterns
+ list<map<string,any> > patterns = Pkg::ResolvableProperties ("", `pattern,
"");
+ patterns = filter (map<string,any> p, patterns, {
+ return p["transact_by"]:nil == `user || p["transact_by"]:nil ==
`app_high;
+ });
+
+ list<string> patterns_to_remove = [];
+ list<string> patterns_to_install = maplist (map<string,any> p, patterns, {
+ if (p["status"]:nil == `selected || p["status"]:nil == `installed)
+ return p["name"]:"";
+ else if (p["status"]:nil == `removed || p["status"]:nil == `available)
+ patterns_to_remove = add (patterns_to_remove, p["name"]:"");
+ return nil;
+ });
+ patterns_to_install = filter (string p, patterns_to_install, {
+ return p != nil;
+ });
+ y2milestone ("Patterns to install: %1", patterns_to_install);
+ y2milestone ("Patterns to remove: %1", patterns_to_remove);
+
+ // find out status of packages
+ list<map<string,any> > packages = Pkg::ResolvableProperties ("", `package,
"");
+ packages = filter (map<string,any> p, packages, {
+ return p["transact_by"]:nil == `user || p["transact_by"]:nil ==
`app_high;
+ });
+
+ list<string> packages_to_remove = [];
+ list<string> packages_to_install = maplist (map<string,any> p, packages, {
+ if (p["status"]:nil == `selected || p["status"]:nil == `installed)
+ return p["name"]:"";
+ else if (p["status"]:nil == `removed || p["status"]:nil == `available)
+ packages_to_remove = add (packages_to_remove, p["name"]:"");
+ return nil;
+ });
+ packages_to_install = filter (string p, packages_to_install, {
+ return p != nil;
+ });
+ y2milestone ("Packages to install: %1", packages_to_install);
+ y2milestone ("Packages to remove: %1", packages_to_remove);
+
+ map software = $[
+ "packages": packages_to_install,
+ "patterns": patterns_to_install,
+ "remove-packages": packages_to_remove,
+ "remove-patterns": patterns_to_remove,
+ ];
+
+ Profile::current["software"] = software;
+ // /root exists during upgrade
+ Profile::Save (Installation::destdir + "/root/autoupg_updated.xml");
+
+
+ return `auto;
+}
+
Modified: trunk/autoinstallation/src/modules/AutoInstall.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/modules/AutoInstall.ycp?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/modules/AutoInstall.ycp (original)
+++ trunk/autoinstallation/src/modules/AutoInstall.ycp Wed Jan 19 15:16:35 2011
@@ -162,7 +162,7 @@
*/
global define boolean Save()
{
- if (Mode::autoinst ())
+ if (Mode::autoinst () || Mode::autoupgrade())
return (Profile::SaveProfileStructure(
AutoinstConfig::parsedControlFile ));
else
return true;
Modified: trunk/autoinstallation/src/modules/AutoinstConfig.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/modules/AutoinstConfig.ycp?rev=63230&r1=63229&r2=63230&view=diff
==============================================================================
--- trunk/autoinstallation/src/modules/AutoinstConfig.ycp (original)
+++ trunk/autoinstallation/src/modules/AutoinstConfig.ycp Wed Jan 19 15:16:35
2011
@@ -167,6 +167,11 @@
//
global boolean RebootMsg = false;
+ //
+ // AutoYaST profile is stored in the root partition (for upgrade)
+ //
+ global boolean ProfileInRootPart = false;
+
//
// remote profile (invented for pre-probing of s390)
@@ -369,7 +374,7 @@
*/
global define void AutoinstConfig ()
``{
- if (Mode::autoinst () && Stage::initial() )
+ if ((Mode::autoinst ()|| Mode::autoupgrade ()) && Stage::initial() )
{
any autoinstall = SCR::Read(.etc.install_inf.AutoYaST);
if (autoinstall != nil && is ( autoinstall , string ) )
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
| < Previous | Next > |