public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
From: jturney@sourceware.org
To: cygwin-apps-cvs@sourceware.org
Subject: [setup - the official Cygwin setup program] branch master, updated. release_2.889
Date: Sat, 24 Feb 2018 13:49:00 -0000	[thread overview]
Message-ID: <20180224134902.70424.qmail@sourceware.org> (raw)




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);


                 reply	other threads:[~2018-02-24 13:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180224134902.70424.qmail@sourceware.org \
    --to=jturney@sourceware.org \
    --cc=cygwin-apps-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).