Hello community, here is the log from the commit of package yast2-installation for openSUSE:Factory checked in at Mon Sep 19 18:09:39 CEST 2011.
-------- --- yast2-installation/yast2-installation.changes 2011-09-06 10:58:14.000000000 +0200 +++ yast2-installation/yast2-installation.changes 2011-09-15 14:21:57.000000000 +0200 @@ -1,0 +2,7 @@ +Thu Sep 15 12:16:49 UTC 2011 - [email protected] + +- improved package update check - display only the repositories + with an update available, display package updates in details +- 2.21.18 + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- yast2-installation-2.21.17.tar.bz2 New: ---- yast2-installation-2.21.18.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-installation.spec ++++++ --- /var/tmp/diff_new_pack.Ll0kSF/_old 2011-09-19 18:09:34.000000000 +0200 +++ /var/tmp/diff_new_pack.Ll0kSF/_new 2011-09-19 18:09:34.000000000 +0200 @@ -19,11 +19,11 @@ Name: yast2-installation -Version: 2.21.17 -Release: 1 +Version: 2.21.18 +Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-installation-2.21.17.tar.bz2 +Source0: yast2-installation-2.21.18.tar.bz2 Prefix: /usr @@ -133,7 +133,6 @@ Summary: YaST2 - Installation Parts %package devel-doc - Group: Documentation/HTML Requires: yast2-installation >= 2.15.34 @@ -148,7 +147,7 @@ System installation code as present on installation media. %prep -%setup -n yast2-installation-2.21.17 +%setup -n yast2-installation-2.21.18 %build %{prefix}/bin/y2tool y2autoconf @@ -255,4 +254,5 @@ %doc %{prefix}/share/doc/packages/yast2-installation %exclude %{prefix}/share/doc/packages/yast2-installation/COPYING %exclude %{prefix}/share/doc/packages/yast2-installation/README + %changelog ++++++ yast2-installation-2.21.17.tar.bz2 -> yast2-installation-2.21.18.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-2.21.17/VERSION new/yast2-installation-2.21.18/VERSION --- old/yast2-installation-2.21.17/VERSION 2011-09-06 10:05:43.000000000 +0200 +++ new/yast2-installation-2.21.18/VERSION 2011-09-15 14:18:19.000000000 +0200 @@ -1 +1 @@ -2.21.17 +2.21.18 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-2.21.17/configure new/yast2-installation-2.21.18/configure --- old/yast2-installation-2.21.17/configure 2011-06-23 15:57:13.000000000 +0200 +++ new/yast2-installation-2.21.18/configure 2011-09-15 14:21:06.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for yast2-installation 2.21.5. +# Generated by GNU Autoconf 2.68 for yast2-installation 2.21.18. # # Report bugs to <http://bugs.opensuse.org/>. # @@ -559,8 +559,8 @@ # Identity of this package. PACKAGE_NAME='yast2-installation' PACKAGE_TARNAME='yast2-installation' -PACKAGE_VERSION='2.21.5' -PACKAGE_STRING='yast2-installation 2.21.5' +PACKAGE_VERSION='2.21.18' +PACKAGE_STRING='yast2-installation 2.21.18' PACKAGE_BUGREPORT='http://bugs.opensuse.org/' PACKAGE_URL='' @@ -1240,7 +1240,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures yast2-installation 2.21.5 to adapt to many kinds of systems. +\`configure' configures yast2-installation 2.21.18 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1312,7 +1312,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of yast2-installation 2.21.5:";; + short | recursive ) echo "Configuration of yast2-installation 2.21.18:";; esac cat <<\_ACEOF @@ -1392,7 +1392,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -yast2-installation configure 2.21.5 +yast2-installation configure 2.21.18 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1409,7 +1409,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by yast2-installation $as_me 2.21.5, which was +It was created by yast2-installation $as_me 2.21.18, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2339,7 +2339,7 @@ # Define the identity of the package. PACKAGE='yast2-installation' - VERSION='2.21.5' + VERSION='2.21.18' cat >>confdefs.h <<_ACEOF @@ -2461,7 +2461,7 @@ -VERSION="2.21.5" +VERSION="2.21.18" RPMNAME="yast2-installation" MAINTAINER="Jiří Suchomel <[email protected]>" @@ -3624,7 +3624,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by yast2-installation $as_me 2.21.5, which was +This file was extended by yast2-installation $as_me 2.21.18, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -3677,7 +3677,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -yast2-installation config.status 2.21.5 +yast2-installation config.status 2.21.18 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-2.21.17/configure.in new/yast2-installation-2.21.18/configure.in --- old/yast2-installation-2.21.17/configure.in 2011-06-23 15:57:11.000000000 +0200 +++ new/yast2-installation-2.21.18/configure.in 2011-09-15 14:21:04.000000000 +0200 @@ -3,7 +3,7 @@ dnl -- This file is generated by y2autoconf 2.18.11 - DO NOT EDIT! -- dnl (edit configure.in.in instead) -AC_INIT(yast2-installation, 2.21.5, http://bugs.opensuse.org/, yast2-installation) +AC_INIT(yast2-installation, 2.21.18, http://bugs.opensuse.org/, yast2-installation) dnl Check for presence of file 'RPMNAME' AC_CONFIG_SRCDIR([RPMNAME]) @@ -18,7 +18,7 @@ AM_INIT_AUTOMAKE(tar-ustar -Wno-portability) dnl Important YaST2 variables -VERSION="2.21.5" +VERSION="2.21.18" RPMNAME="yast2-installation" MAINTAINER="Jiří Suchomel <[email protected]>" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-2.21.17/src/clients/inst_extrasources.ycp new/yast2-installation-2.21.18/src/clients/inst_extrasources.ycp --- old/yast2-installation-2.21.17/src/clients/inst_extrasources.ycp 2011-08-05 08:04:24.000000000 +0200 +++ new/yast2-installation-2.21.18/src/clients/inst_extrasources.ycp 2011-09-15 14:21:01.000000000 +0200 @@ -9,7 +9,7 @@ * Adds all sources defined in control file (software->extra_urls) * and stores them at the end. * - * $Id: inst_extrasources.ycp 65201 2011-08-04 11:55:27Z lslezak $ + * $Id: inst_extrasources.ycp 65723 2011-09-15 12:21:00Z lslezak $ */ { @@ -17,17 +17,16 @@ textdomain "installation"; import "GetInstArgs"; -import "SourceManager"; import "Mode"; import "PackageLock"; import "ProductFeatures"; // We need the constructor import "ProductControl"; import "Installation"; -import "PackageCallbacks"; +import "Icon"; import "NetworkService"; import "PackagesUI"; -import "Popup"; +import "Label"; /** * Returns list of maps of repositories to register. See bnc #381360. @@ -214,10 +213,11 @@ } // check if there is a selected package in the requested repositories -// returns number of available updates -integer UpgradesAvailable(list<integer> repos) +// returns list of repositories providing an update (repo IDs) +map<string, any> UpgradesAvailable(list<integer> repos) { - integer ret = 0; + list<integer> ret = []; + list<string> packages = []; foreach (map pkg, Pkg::ResolvableProperties ("", `package, ""), { integer source = pkg["source"]:-1; @@ -225,14 +225,73 @@ { string package = sformat("%1-%2.%3", pkg["name"]:"", pkg["version"]:"", pkg["arch"]:""); y2milestone("Found upgrade to install: %1", package); + packages = add(packages, package); - ret = ret + 1; + if (!contains(ret, source)) + { + ret = add(ret, source); + } } }); - y2milestone("Available upgrades: %1", ret); + y2milestone("Upgrades found in repositories: %1", ret); - return ret; + return $["repositories" : ret, "packages" : packages ]; +} + +// ask user whether to install available package updates +// returns true after confirming +boolean InstallPackages(string msg, string details) +{ + term button_box = `ButtonBox + ( + `PushButton (`id (`yes), `opt (`default, `okButton, `key_F10), Label::YesButton()), + `PushButton (`id (`no), `opt (`cancelButton, `key_F9), Label::NoButton()) + ); + + term dialog = `HBox( + `HSpacing(0.5), + `Top( + `MarginBox(1, 1, + Icon::Image("question", $[]) + ) + ), + `VBox( + `Left(`Label(msg)), + `VSpacing(0.5), + // check box + `Left(`CheckBox(`id(`show), `opt(`notify), _("Show &package updates"), false)), + `ReplacePoint(`id(`info), `Empty()), + button_box + ), + `HSpacing(2) + ); + + UI::OpenDialog(`opt(`decorated), dialog); + + any r = nil; + while (r != `yes && r != `no && r != `cancel) + { + r = UI::UserInput(); + + if (r == `show) + { + if (UI::QueryWidget(`id(`show), `Value ) == true) + { + UI::ReplaceWidget(`id(`info), `RichText(`opt(`plainText), details)); + } + else + { + UI::ReplaceWidget(`id(`info), `Empty() ); + } + } + } + + UI::CloseDialog(); + + y2milestone("User input: %1", r); + + return r == `yes; } ////////////////////////////////////////// @@ -292,21 +351,24 @@ { UpgradeFrom(check_repos); - integer upgrades_avail = UpgradesAvailable(check_repos); + map<string, any> upgrade_info = UpgradesAvailable(check_repos); + list<integer> upgrade_repos = upgrade_info["repositories"]:[]; - if (upgrades_avail > 0) + if (size(upgrade_repos) > 0) { // popup message, list of repositores is appended to the text - string message = _("Package updates have been detected in these additional repositories:\n"); - foreach(integer repo, check_repos, { + string message = _("Package updates have been found in these additional repositories:") + "\n\n"; + foreach(integer repo, upgrade_repos, { map repo_info = Pkg::SourceGeneralData(repo); message = message + sformat("%1 (%2)\n", repo_info["name"]:"", repo_info["url"]:""); }); // yes/no popup question - message = message + "\n" + _("Start the software manager to check and install the updates?"); + message = message + "\n\n" + _("Start the software manager to check and install the updates?"); + + string package_list = mergestring(upgrade_info["packages"]:[], "\n"); - if (Popup::YesNo(message)) + if (InstallPackages(message, package_list)) { // start the software manager symbol ui = PackagesUI::RunPackageSelector($["mode" : `summaryMode]); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-2.21.17/src/clients/inst_extrasources2.ycp new/yast2-installation-2.21.18/src/clients/inst_extrasources2.ycp --- old/yast2-installation-2.21.17/src/clients/inst_extrasources2.ycp 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-installation-2.21.18/src/clients/inst_extrasources2.ycp 2011-09-15 11:31:06.000000000 +0200 @@ -0,0 +1,427 @@ +/** + * File: clients/inst_extrasources.ycp + * Package: yast2-installation + * Summary: Automatically register software repositories from content file + * Authors: Ladislav Slezák <[email protected]> + * Lukas Ocilka <[email protected]> + * + * This client loads the target and initializes the package manager. + * Adds all sources defined in control file (software->extra_urls) + * and stores them at the end. + * + * $Id: inst_extrasources.ycp 65201 2011-08-04 11:55:27Z lslezak $ + */ + +{ + +textdomain "installation"; + +import "GetInstArgs"; +import "Mode"; +import "PackageLock"; +import "ProductFeatures"; +// We need the constructor +import "ProductControl"; +import "Installation"; +import "Icon"; +import "NetworkService"; +import "PackagesUI"; +import "Label"; + +/** + * Returns list of maps of repositories to register. See bnc #381360. + * + * @param registered URLs of already registered repositories (they will be ignored to not register the same repository one more) + * @return list <map> of URLs to register + */ +define list <map> GetURLsToRegister (list <string> registered) +{ + list <map> urls_from_control_file = (list <map>) ProductFeatures::GetFeature ("software", "extra_urls"); + + if (urls_from_control_file == nil) { + y2milestone ("Empty or errorneous software/extra_urls: %1", urls_from_control_file); + return []; + } + + urls_from_control_file = filter (map one_url, urls_from_control_file, { + if (contains (registered, one_url["baseurl"]:"")) { + y2milestone ("Already registered: %1", one_url["baseurl"]:""); + return false; + } + return true; + }); + + y2milestone ("Repositories to register: %1", urls_from_control_file); + return urls_from_control_file; +} + +/** + * Register the installation sources in offline mode (no network connection required). + * The repository metadata will be downloaded by sw_single (or another yast module) when the repostory is enabled + * + * @param list <map> list of the sources to register + * @return list<integer> list of created source IDs + */ +define list <integer> RegisterRepos (list <map> url_list) +{ + list <integer> ret = []; + + foreach (map new_url, url_list, { + if (new_url["baseurl"]:"" == nil || new_url["baseurl"]:"" == "") { + y2error ("Cannot use repository: %1, no 'baseurl' defined", new_url); + return; + } + + map <string,any> repo_prop = $[]; + + // extra repos are disabled by default + repo_prop["enabled"] = new_url["enabled"]:false; + repo_prop["autorefresh"] = new_url["autorefresh"]:true; + + // repository name (try) name, alias, (fallback) baseurl + repo_prop["name"] = new_url["name"]:new_url["alias"]:new_url["baseurl"]:""; + + // repository alias (try) alias, (fallback) baseurl + repo_prop["alias"] = new_url["alias"]:new_url["baseurl"]:""; + + repo_prop["base_urls"] = [new_url["baseurl"]:""]; + + if (haskey (new_url, "prod_dir")) { + repo_prop["prod_dir"] = new_url["prod_dir"]:"/"; + } + + if (haskey (new_url, "priority")) { + repo_prop["priority"] = tointeger (new_url["priority"]:99); + } + + integer new_repo_id = Pkg::RepositoryAdd (repo_prop); + + if (new_repo_id != nil && new_repo_id >= 0) { + y2milestone ("Registered extra repository: %1: %2", new_repo_id, repo_prop); + ret = add (ret, new_repo_id); + } else { + y2error("Cannot register: %1", repo_prop); + } + } + ); + + return ret; +} + +/** + * Returns list of already registered repositories. + * + * @return list <string> of registered repositories + */ +list<string> RegisteredUrls() +{ + // get all registered installation sources + list <integer> srcs = Pkg::SourceGetCurrent (false); + + list<string> ret = []; + foreach(integer src, srcs, + { + map general = Pkg::SourceGeneralData(src); + + string url = general["url"]:""; + + if (url != nil && url != "") + { + ret = add(ret, url); + } + } + ); + + // remove duplicates + ret = toset(ret); + + y2milestone("Registered sources: %1", ret); + + return ret; +} + +// Initialize the package manager +// needed for registered sources and products +boolean InitializePackager () { + if (!PackageLock::Check()) return false; + + // to find out which sources have been already registered + Pkg::SourceStartManager (false); + + // to initialize target because of installed products + return (Pkg::TargetInit (Installation::destdir, false) == true); +} + +// refresh the requested repositories +// returns true on success +boolean RefreshRepositories(list<integer> repos) +{ + boolean ret = true; + + y2milestone("Refreshing repositories %1", repos); + foreach(integer repo, repos, { + ret = ret && Pkg::SourceRefreshNow(repo); + }); + + y2milestone("Refresh succeeded: %1", ret); + + return ret; +} + +// is the repository an update repo? +boolean IsUpdateRepo(integer repo) +{ + y2milestone("Checking whether repository %1 is an update repo...", repo); + boolean ret = false; + + // check if there is a patch available in the repository + foreach (map patch, Pkg::ResolvableProperties ("", `patch, ""), { + if (patch["source"]:-1 == repo) + { + y2milestone("Found patch %1 in the repository", patch["name"]:""); + ret = true; + break; + } + }); + + y2milestone("Repository %1 is update repo: %2", repo, ret); + + return ret; +} + +// mark the repositories for upgrade, run the solver +void UpgradeFrom(list<integer> repos) +{ + foreach(integer repo, repos, { + y2milestone("Adding upgrade repo %1", repo); + Pkg::AddUpgradeRepo(repo); + }); + + Pkg::PkgSolve(true); +} + +// revert the upgrading repos, reset package selection +void RevertUpgradeFrom(list<integer> repos) +{ + foreach(integer repo, repos, { + y2milestone("Removing upgrade repo %1", repo); + Pkg::RemoveUpgradeRepo(repo); + }); + + Pkg::PkgApplReset(); + Pkg::PkgReset(); +} + +// check if there is a selected package in the requested repositories +// returns list of repositories providing an update (repo IDs) +map<string, any> UpgradesAvailable(list<integer> repos) +{ + list<integer> ret = []; + list<string> packages = []; + + foreach (map pkg, Pkg::ResolvableProperties ("", `package, ""), { + integer source = pkg["source"]:-1; + if (pkg["status"]:`none == `selected && contains(repos, source)) + { + string package = sformat("%1-%2.%3", pkg["name"]:"", pkg["version"]:"", pkg["arch"]:""); + y2milestone("Found upgrade to install: %1", package); + packages = add(packages, package); + + if (!contains(ret, source)) + { + ret = add(ret, source); + } + } + }); + + y2milestone("Upgrades found in repositories: %1", ret); + + return $["repositories" : ret, "packages" : packages ]; +} + +boolean InstallPackages(string msg, string details) +{ + term button_box = `ButtonBox + ( + `PushButton (`id (`yes), `opt (`default, `okButton, `key_F10), Label::YesButton()), + `PushButton (`id (`no), `opt (`cancelButton, `key_F9), Label::NoButton()) + ); + + term dialog = `HBox( + `HSpacing(0.5), + `Top( + `MarginBox(1, 1, + Icon::Image("question", $[]) + ) + ), + `VBox( + `Left(`Label(msg)), + `VSpacing(0.5), + // check box + `Left(`CheckBox(`id(`show), `opt(`notify), _("Show &details"), false)), + `ReplacePoint(`id(`info), `Empty()), + button_box + ), + `HSpacing(2) + ); + + UI::OpenDialog(`opt(`decorated), dialog); + + any r = nil; + while (r != `yes && r != `no && r != `cancel) + { + r = UI::UserInput(); + + if (r == `show) + { + if (UI::QueryWidget(`id(`show), `Value ) == true) + { + UI::ReplaceWidget(`id(`info), `RichText(`opt(`plainText), details)); + } + else + { + UI::ReplaceWidget(`id(`info), `Empty() ); + } + } + y2internal("r: %1", r); + } + + UI::CloseDialog(); + + y2milestone("User input: %1", r); + + return r == `yes; +} + +/**/ + +string message = _("Package updates have been detected in these additional repositories:\n\n") + +"openSUSE-12.1-Non-Oss (http://download.opensuse.org/distribution/12.1/repo/oss/) +openSUSE-12.1-Oss (http://download.opensuse.org/distribution/12.1/repo/non-oss/)"; + + message = message + "\n\n" + _("Start the software manager to check and install the updates?"); +string dd = "gsettings-desktop-schemas-lang-3.1.3-1.2.noarch +libwebkitgtk3-lang-1.5.1-2.3.noarch +mozilla-js192-1.9.2.20-1.1.x86_64"; + +y2internal("ret: %1", InstallPackages(message, dd)); + +return `abort; +/**/ + +////////////////////////////////////////// + +if ( GetInstArgs::going_back()) // going backwards? +{ + return `auto; // don't execute this once more +} + +// autoyast mode, user cannot be asked +if (Mode::autoinst()) +{ + y2milestone("Skipping extra source configuration in AutoYaST mode"); + return `auto; +} + +// bugzilla #263289 +if (! InitializePackager()) { + y2error ("Cannot connect to the Packager"); + return `auto; +} + +list <string> already_registered = RegisteredUrls(); + +list <map> register_url = GetURLsToRegister (already_registered); + +// any confirmed source to register? +if (size (register_url) > 0) { + // register (create) the sources + list <integer> added_ids = RegisterRepos (register_url); + + // synchronize the sources if any source has been added + if (size (added_ids) > 0) { + // If any source has been added, store the sources + // bnc #440184 + y2milestone ("Some (%1) sources have been added, storing them...", added_ids); + Pkg::SourceSaveAll(); + } + + // check during upgrade whether the added repositories provide an upgrade for installed package + // (openSUSE DVD does not contain all packages, packages from OSS repository might not have been upgraded, + // see bnc#693230 for details) + if (Mode::update() && size(added_ids) > 0 ) + { + y2milestone("Checking whether there is and update provided by extra (non-update) repo..."); + + // network up? + if (NetworkService::isNetworkRunning()) + { + // refresh the added repositories and load them + if (RefreshRepositories(added_ids) && Pkg::SourceStartManager(true)) + { + // ignore update repositories - the updates will be installed later by online update + list<integer> check_repos = filter(integer repo, added_ids, {return !IsUpdateRepo(repo);}); + + if (size(check_repos) > 0) + { + UpgradeFrom(check_repos); + + map<string, any> upgrade_info = UpgradesAvailable(check_repos); + list<integer> upgrade_repos = upgrade_info["repositories"]:[]; + + if (size(upgrade_repos) > 0) + { + // popup message, list of repositores is appended to the text + string message = _("Package updates have been detected in these additional repositories:") + "\n\n"; + foreach(integer repo, upgrade_repos, { + map repo_info = Pkg::SourceGeneralData(repo); + message = message + sformat("%1 (%2)\n", repo_info["name"]:"", repo_info["url"]:""); + }); + + // yes/no popup question + message = message + "\n\n" + _("Start the software manager to check and install the updates?"); + + string package_list = mergestring(upgrade_info["packages"]:[], "\n"); + + if (InstallPackages(message, package_list)) + { + // start the software manager + symbol ui = PackagesUI::RunPackageSelector($["mode" : `summaryMode]); + y2milestone("Package manager returned: %1", ui); + + if (ui == `accept) + { + // install the packages + y2milestone("Installing packages"); + WFM::call("inst_rpmcopy"); + } + } + else + { + y2milestone("Skipping installation of the available updates"); + } + } + else + { + y2milestone("Everything OK, no available update found"); + } + + RevertUpgradeFrom(check_repos); + } + } + else + { + y2warning("Could not load new repositories"); + } + } + else + { + y2milestone("Network is not running, skipping available updates check"); + } + } +} + +return `auto; + +/* EOF */ +} ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
