From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70518 invoked by alias); 24 Feb 2018 13:49:02 -0000 Mailing-List: contact cygwin-apps-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cygwin-apps-cvs-owner@sourceware.org Received: (qmail 70453 invoked by uid 9795); 24 Feb 2018 13:49:02 -0000 Date: Sat, 24 Feb 2018 13:49:00 -0000 Message-ID: <20180224134902.70424.qmail@sourceware.org> From: jturney@sourceware.org To: cygwin-apps-cvs@sourceware.org Subject: [setup - the official Cygwin setup program] branch master, updated. release_2.889 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 29cca4de205ff68f886c95bb9e8f6f6fe9150578 X-Git-Newrev: a6c216b7b652a131e7fe5d8f46fbbc17b7b29d1f X-SW-Source: 2018-q1/txt/msg00045.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=a6c216b7b652a131e7fe5d8f46fbbc17b7b29d1f commit a6c216b7b652a131e7fe5d8f46fbbc17b7b29d1f Author: Jon Turney 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 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);