[setup topic/libsolv] Does "obsoletes:" work?
Ken Brown
kbrown@cornell.edu
Sat Oct 21 20:19:00 GMT 2017
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
-------------- next part --------------
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
More information about the Cygwin-apps
mailing list