From: Ken Brown <kbrown@cornell.edu>
To: cygwin-apps@cygwin.com
Subject: Re: [setup topic/libsolv] Does "obsoletes:" work?
Date: Sat, 21 Oct 2017 20:19:00 -0000 [thread overview]
Message-ID: <2ec4937d-5932-a47a-964d-b3fc8c030da3@cornell.edu> (raw)
In-Reply-To: <8344e55f-2036-187b-7cb9-819d2cdb0e99@cornell.edu>
[-- Attachment #1: Type: text/plain, Size: 666 bytes --]
On 10/20/2017 6:24 PM, Ken Brown wrote:
> Jon,
>
> Have you ever tested the "obsoletes:" feature of setup/libsolv? I tried
> adding an "obsoletes:" line to setup.ini, and it didn't seem to have any
> effect.
It turns out that it *is* working (after a minor fix, attached), but not
always as I expect. Suppose A requires B and C obsoletes B. Then the
"obsoletes" statement appears to have no effect. If I remove the
dependence of A on B, then setup does propose uninstalling B and
installing C.
I guess the issue is that libsolv interprets "C obsoletes B" as
"uninstall B and install C", and it won't uninstall B while something
requires it.
Ken
[-- Attachment #2: 0001-Fix-parsing-of-setup.ini.patch --]
[-- Type: text/plain, Size: 1369 bytes --]
From af9829d2ee35686cf0f6e82c8fb04265b1f50f82 Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Sat, 21 Oct 2017 12:49:34 -0400
Subject: [PATCH] Fix parsing of setup.ini
Reset "obsoletes" between packages. Also add a debugging statement.
---
IniDBBuilderPackage.cc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/IniDBBuilderPackage.cc b/IniDBBuilderPackage.cc
index 3bc7b86..4e41659 100644
--- a/IniDBBuilderPackage.cc
+++ b/IniDBBuilderPackage.cc
@@ -85,6 +85,7 @@ IniDBBuilderPackage::buildPackage (const std::string& _name)
cbpv.spkg = PackageSpecification();
cbpv.spkg_id = packageversion();
cbpv.requires = NULL;
+ cbpv.obsoletes = NULL;
cbpv.archive = packagesource();
currentSpec = NULL;
@@ -157,6 +158,7 @@ IniDBBuilderPackage::buildPackageSource (const std::string& path,
SolverPool::addPackageData cspv = cbpv;
cspv.type = package_source;
cspv.requires = NULL;
+ cspv.obsoletes = NULL;
/* set archive path, size, mirror, hash */
cspv.archive = packagesource();
@@ -229,6 +231,9 @@ IniDBBuilderPackage::buildBeginBuildDepends ()
void
IniDBBuilderPackage::buildBeginObsoletes ()
{
+#if DEBUG
+ Log (LOG_BABBLE) << "Beginning of an obsoletes statement" << endLog;
+#endif
currentSpec = NULL;
obsoletesNodeList = PackageDepends();
currentNodeList = &obsoletesNodeList;
--
2.14.2
next prev parent reply other threads:[~2017-10-21 20:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-20 22:25 Ken Brown
2017-10-21 20:19 ` Ken Brown [this message]
2017-10-23 11:38 ` Jon Turney
2017-10-23 17:44 ` Ken Brown
2017-10-24 20:09 ` Jon Turney
2017-10-24 20:25 ` Ken Brown
2017-10-24 20:37 ` Jon Turney
2017-10-24 21:33 ` Ken Brown
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=2ec4937d-5932-a47a-964d-b3fc8c030da3@cornell.edu \
--to=kbrown@cornell.edu \
--cc=cygwin-apps@cygwin.com \
/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).