public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
* [setup - the official Cygwin setup program] branch master, updated. release_2.889
@ 2018-02-24 13:49 jturney
0 siblings, 0 replies; only message in thread
From: jturney @ 2018-02-24 13:49 UTC (permalink / raw)
To: cygwin-apps-cvs
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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-02-24 13:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-24 13:49 [setup - the official Cygwin setup program] branch master, updated. release_2.889 jturney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).