Mailinglist Archive: yast-commit (396 mails)

< Previous Next >
[yast-commit] r65201 - in /trunk/installation: package/yast2-installation.changes src/clients/inst_extrasources.ycp yast2-installation.spec.in
Author: lslezak
Date: Thu Aug 4 13:55:27 2011
New Revision: 65201

URL: http://svn.opensuse.org/viewcvs/yast?rev=65201&view=rev
Log:
- extraurls: check whether there is an update candidate in the
added extra repositories - openSUSE DVD does not contain all
packages, packages from OSS repository which are not on DVD
medium were not upgraded and were left in the old version even
after adding new OSS repository with updated version (bnc#693230)

Modified:
trunk/installation/package/yast2-installation.changes
trunk/installation/src/clients/inst_extrasources.ycp
trunk/installation/yast2-installation.spec.in

Modified: trunk/installation/package/yast2-installation.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/installation/package/yast2-installation.changes?rev=65201&r1=65200&r2=65201&view=diff
==============================================================================
--- trunk/installation/package/yast2-installation.changes (original)
+++ trunk/installation/package/yast2-installation.changes Thu Aug 4 13:55:27
2011
@@ -1,4 +1,13 @@
-------------------------------------------------------------------
+Thu Aug 4 11:37:02 UTC 2011 - lslezak@xxxxxxx
+
+- extraurls: check whether there is an update candidate in the
+ added extra repositories - openSUSE DVD does not contain all
+ packages, packages from OSS repository which are not on DVD
+ medium were not upgraded and were left in the old version even
+ after adding new OSS repository with updated version (bnc#693230)
+
+-------------------------------------------------------------------
Wed Aug 3 13:19:50 UTC 2011 - lslezak@xxxxxxx

- cleanup: removed obsoleted SourceManager::SyncAddedAndDeleted()

Modified: trunk/installation/src/clients/inst_extrasources.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/installation/src/clients/inst_extrasources.ycp?rev=65201&r1=65200&r2=65201&view=diff
==============================================================================
--- trunk/installation/src/clients/inst_extrasources.ycp (original)
+++ trunk/installation/src/clients/inst_extrasources.ycp Thu Aug 4 13:55:27
2011
@@ -25,6 +25,9 @@
import "ProductControl";
import "Installation";
import "PackageCallbacks";
+import "NetworkService";
+import "PackagesUI";
+import "Popup";

/**
* Returns list of maps of repositories to register. See bnc #381360.
@@ -150,6 +153,87 @@
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 number of available updates
+integer UpgradesAvailable(list<integer> repos)
+{
+ integer ret = 0;
+
+ 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);
+
+ ret = ret + 1;
+ }
+ });
+
+ y2milestone("Available upgrades: %1", ret);
+
+ return ret;
+}

//////////////////////////////////////////

@@ -187,6 +271,77 @@
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);
+
+ integer upgrades_avail = UpgradesAvailable(check_repos);
+
+ if (upgrades_avail > 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, {
+ 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?");
+
+ if (Popup::YesNo(message))
+ {
+ // 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;

Modified: trunk/installation/yast2-installation.spec.in
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/installation/yast2-installation.spec.in?rev=65201&r1=65200&r2=65201&view=diff
==============================================================================
--- trunk/installation/yast2-installation.spec.in (original)
+++ trunk/installation/yast2-installation.spec.in Thu Aug 4 13:55:27 2011
@@ -18,8 +18,8 @@
# PackageCallbacks::RegisterEmptyProgressCallbacks()
BuildRequires: yast2 >= 2.16.52

-# Pkg::SourceProvideDigestedFile()
-BuildRequires: yast2-pkg-bindings >= 2.17.25
+# Pkg::Add/RemoveUpgradeRepo()
+BuildRequires: yast2-pkg-bindings >= 2.21.2

# Unified progress bar (done by visnov)
BuildRequires: yast2-packager >= 2.17.9
@@ -37,6 +37,9 @@
# Pkg::SourceProvideDigestedFile()
Conflicts: yast2-pkg-bindings < 2.17.25

+# Pkg::Add/RemoveUpgradeRepo()
+Requires: yast2-pkg-bindings >= 2.21.2
+
# Mouse-related scripts moved to yast2-mouse
Conflicts: yast2-mouse < 2.18.0


--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages