This is the mail archive of the
cygwin-apps-cvs
mailing list for the cygwin-apps project.
[setup - the official Cygwin setup program] branch master, updated. release_2.889
- From: jturney at sourceware dot org
- To: cygwin-apps-cvs at sourceware dot org
- Date: 24 Feb 2018 13:49:02 -0000
- Subject: [setup - the official Cygwin setup program] branch master, updated. release_2.889
https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=a6c216b7b652a131e7fe5d8f46fbbc17b7b29d1f
commit a6c216b7b652a131e7fe5d8f46fbbc17b7b29d1f
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date: Wed Feb 21 21:31:20 2018 +0000
Avoid a crash if we try to uninstall an unknown package
This can happen if the solver decides it wants to uninstall 'base'.
https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=f4bddeea3e68719f5334d55c3e416634cf1d080e
commit f4bddeea3e68719f5334d55c3e416634cf1d080e
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date: Wed Feb 21 21:29:20 2018 +0000
A package provides what it obsoletes, as well as itself.
This is needed to allow a package which obsoletes an installed package to
get installed.
Will need to revisit this when we implement explicit provides: in setup.ini.
Diff:
---
install.cc | 6 ++++--
libsolv.cc | 4 ++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/install.cc b/install.cc
index 3dd491e..37dea6f 100644
--- a/install.cc
+++ b/install.cc
@@ -881,7 +881,8 @@ do_install_thread (HINSTANCE h, HWND owner)
i != uninstall_q.end (); ++i)
{
packagemeta *pkgm = db.findBinary (PackageSpecification(i->Name()));
- myInstaller.preremoveOne (*pkgm);
+ if (pkgm)
+ myInstaller.preremoveOne (*pkgm);
Progress.SetBar2(std::distance(uninstall_q.begin(), i) + 1, uninstall_q.size());
}
@@ -890,7 +891,8 @@ do_install_thread (HINSTANCE h, HWND owner)
i != uninstall_q.end (); ++i)
{
packagemeta *pkgm = db.findBinary (PackageSpecification(i->Name()));
- myInstaller.uninstallOne (*pkgm);
+ if (pkgm)
+ myInstaller.uninstallOne (*pkgm);
Progress.SetBar2(std::distance(uninstall_q.begin(), i) + 1, uninstall_q.size());
}
diff --git a/libsolv.cc b/libsolv.cc
index 135d9af..0dc7557 100644
--- a/libsolv.cc
+++ b/libsolv.cc
@@ -438,6 +438,10 @@ SolverPool::addPackage(const std::string& pkgname, const addPackageData &pkgdata
solvable->arch = (pkgdata.type == package_binary) ? ARCH_ANY : ARCH_SRC;
solvable->evr = pool_str2id(repo->pool, pkgdata.version.c_str(), 1);
solvable->vendor = pool_str2id(repo->pool, pkgdata.vendor.c_str(), 1);
+ /* in the absence of specific provides, we provide what we obsolete */
+ if (pkgdata.obsoletes)
+ solvable->provides = makedeps(repo, pkgdata.obsoletes);
+ /* we always provide ourselves */
solvable->provides = repo_addid_dep(repo, solvable->provides, pool_rel2id(pool, solvable->name, solvable->evr, REL_EQ, 1), 0);
if (pkgdata.requires)
solvable->requires = makedeps(repo, pkgdata.requires);