[yast-commit] r67437 - in /trunk/wagon: package/yast2-wagon.changes src/clients/wagon_dup_repositories.ycp src/modules/Wagon.ycp
Author: lslezak Date: Wed Feb 15 12:40:32 2012 New Revision: 67437 URL: http://svn.opensuse.org/viewcvs/yast?rev=67437&view=rev Log: - do full migration only from SP2 repos (but also install patches in addition to minimal migration) (fate#311994) Modified: trunk/wagon/package/yast2-wagon.changes trunk/wagon/src/clients/wagon_dup_repositories.ycp 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=67437&r1=67436&r2=67437&view=diff ============================================================================== --- trunk/wagon/package/yast2-wagon.changes (original) +++ trunk/wagon/package/yast2-wagon.changes Wed Feb 15 12:40:32 2012 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Mon Jan 30 15:19:15 UTC 2012 - lslezak@suse.cz + +- do full migration only from SP2 repos (but also install patches + in addition to minimal migration) (fate#311994) + +------------------------------------------------------------------- Tue Jan 17 14:02:21 UTC 2012 - lslezak@suse.cz - ask user to confirm new licenses at upgrade proposal (bnc#741174) Modified: trunk/wagon/src/clients/wagon_dup_repositories.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/wagon/src/clients/wagon_dup_repositories.ycp?rev=67437&r1=67436&r2=67437&view=diff ============================================================================== --- trunk/wagon/src/clients/wagon_dup_repositories.ycp (original) +++ trunk/wagon/src/clients/wagon_dup_repositories.ycp Wed Feb 15 12:40:32 2012 @@ -156,7 +156,7 @@ // heading text string heading_text = _("Migration Type"); // full migration? - boolean full = sort(Wagon::DupRepos()) == sort(Pkg::SourceGetCurrent(true)); + boolean full = Wagon::MigrationType() == `full; term contents = `VBox( // frame label @@ -168,7 +168,7 @@ // radio button `Left(`RadioButton(`id(`minimal), _("&Minimal - upgrade from repositories added by registration"), !full)), // radio button - `Left(`RadioButton(`id(`full), _("&Full - upgrade from all repositories"), full)) + `Left(`RadioButton(`id(`full), _("&Full - install also available patches in addition to Minimal migration"), full)) ) ) ) @@ -200,6 +200,7 @@ list<integer> prev_dup_repos = Wagon::DupRepos(); boolean prev_manual_selection = Wagon::ManualRepoSelection(); + symbol prev_migration_type = Wagon::MigrationType(); while (true) { // go to advanced config it was used previously @@ -211,17 +212,9 @@ symbol mtype = (symbol) UI::QueryWidget(`id(`migration_type), `CurrentButton); y2milestone("Selected migration type: %1", mtype); - if (mtype == `full) + if (mtype == `full || mtype == `minimal) { - // DUP: all repositories - y2milestone("Selected full migration, using %1 repositories", size(Pkg::SourceGetCurrent(true))); - Wagon::SetDupRepos(Pkg::SourceGetCurrent(true)); - Wagon::SetManualRepoSelection(false); - } - else if (mtype == `minimal) - { - // DUP: only added repositories - y2milestone("Selected minimal migration, using these repositories: %1", Wagon::RegistrationRepos()); + y2milestone("Selected minimal or full migration, using these repositories: %1", Wagon::RegistrationRepos()); map<string, integer> alias_to_id = $[]; foreach(integer repo, Pkg::SourceGetCurrent(true), @@ -240,6 +233,7 @@ Wagon::SetDupRepos(added_repos); Wagon::SetManualRepoSelection(false); + Wagon::SetMigrationType(mtype); } else { @@ -273,6 +267,7 @@ else if (ret == `next) { Wagon::SetManualRepoSelection(true); + Wagon::SetMigrationType(`custom); break; } else if (ret == `back) @@ -292,7 +287,7 @@ } } - if (ret == `next && (prev_dup_repos != Wagon::DupRepos() || prev_manual_selection != Wagon::ManualRepoSelection())) + if (ret == `next && (prev_dup_repos != Wagon::DupRepos() || prev_manual_selection != Wagon::ManualRepoSelection() || prev_migration_type != Wagon::MigrationType())) { y2milestone("DUP repository config has been changed, repropose package selection"); Wagon::ResetDUPProposal(); Modified: trunk/wagon/src/modules/Wagon.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/wagon/src/modules/Wagon.ycp?rev=67437&r1=67436&r2=67437&view=diff ============================================================================== --- trunk/wagon/src/modules/Wagon.ycp (original) +++ trunk/wagon/src/modules/Wagon.ycp Wed Feb 15 12:40:32 2012 @@ -154,6 +154,34 @@ new_registration_repos = repos; } + // migration type, one of `minimal, `full, `custom + symbol migration_type = `minimal; + + // get the current migration type + global symbol MigrationType() + { + return migration_type; + } + + // set the migration type + // @param type Type of migration (`minimal, `full, `custom) + // @return boolean true on success + global boolean SetMigrationType(symbol type) + { + if (contains([`minimal, `full, `custom], type)) + { + migration_type = type; + y2milestone("Setting migration type: %1", type); + return true; + } + else + { + y2error("Invalid migration type: %1", type); + y2warning("Keeping the current type: %1", migration_type); + return false; + } + } + void ResetWorkflowSteps () { ProductControl::UnDisableAllModulesAndProposals (Mode::mode(), Stage::stage()); } @@ -430,65 +458,25 @@ list<integer> repos = Pkg::GetUpgradeRepos(); foreach(integer repo, repos, {Pkg::RemoveUpgradeRepo(repo);}); - // all repositories selected for upgrade? - if (sort(Pkg::SourceGetCurrent(true)) == sort(dup_repos)) - { - // reset solver flags (needed when switching from full DUP to partial DUP - Pkg::SetSolverFlags($["reset" : true]); + // reset solver flags + Pkg::SetSolverFlags($["reset" : true]); - y2milestone("Migration products: %1", migration_products); + // add upgrade repositories + y2milestone("Adding upgrade repos: %1", dup_repos); + foreach(integer repo, dup_repos, {Pkg::AddUpgradeRepo(repo);}); - list<string> product_names = maplist(map prod, Pkg::ResolvableProperties ("", `product, ""), {return prod["name"]:"";}); - // remove duplicates - product_names = toset(product_names); - - foreach(string prod_name, product_names, - { - list<map> products_named = Pkg::ResolvableProperties(prod_name, `product, ""); - y2milestone("Product: %1, resolvables: %2", prod_name, size(products_named)); - - if (size(products_named) > 1) - { - boolean installed = find(map p, products_named, {return p["status"]:`unknown == `installed;}) != nil; - boolean selected = find(map p, products_named, {return p["status"]:`unknown == `selected;}) != nil; - boolean removed = find(map p, products_named, {return p["status"]:`unknown == `removed;}) != nil; - boolean available = find(map p, products_named, {return p["status"]:`unknown == `available;}) != nil; - - y2milestone("Product: %1, installed: %2, selected: %3, removed: %4, available: %5", prod_name, installed, selected, removed, available); - - // force upgrade of installed non-migration products - if (installed && !selected && !removed && available && !contains(migration_products, prod_name)) - { - y2milestone("Found installed product: %1, forcing product upgrade", prod_name); - Pkg::ResolvableInstall(prod_name, `product); - } - } - }); + // be compatible with "zypper dup --from" + Pkg::SetSolverFlags($["ignoreAlreadyRecommended" : true]); - foreach(string prod, migration_products, { - y2milestone("Removing migration product: %1", prod); - Pkg::ResolvableRemove(prod, `product); - }); - - // do full distribution upgrade - map <string, any> update_conf = GetUpdateConf(); - map <symbol, integer> update_sum = Pkg::PkgUpdateAll (update_conf); - y2milestone ("Update configuration: %1, update summary: %2", update_conf, update_sum); + if (MigrationType() == `full) + { + // run the solver to evaluate applicable patches + Pkg::PkgSolve(false); - // also preselect all applicable patches (except optional ones) + // preselect all applicable patches (except optional ones) integer patches = Pkg::ResolvablePreselectPatches(`all); y2milestone("Preselected patches: %1", patches); } - else - { - // do partial DUP - // add upgrade repositories - y2milestone("Adding upgrade repos: %1", dup_repos); - foreach(integer repo, dup_repos, {Pkg::AddUpgradeRepo(repo);}); - - // be compatible with "zypper dup --from" - Pkg::SetSolverFlags($["ignoreAlreadyRecommended" : true]); - } // set the solve error flag for packages proposal Update::solve_errors = Pkg::PkgSolve(true) ? 0 : Pkg::PkgSolveErrors(); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
lslezak@svn2.opensuse.org