This is the mail archive of the cygwin-apps-cvs mailing list for the cygwin-apps project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[setup - the official Cygwin setup program] branch master, updated. release_2.891-13-g5947bc9




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=5947bc929bc772bf067a6b457fc825bbbfc4b0e6

commit 5947bc929bc772bf067a6b457fc825bbbfc4b0e6
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Fri Jul 6 17:16:16 2018 +0100

    Fix SolvableVersion::deplist() to handle version-relations correctly
    
    This was using completely the wrong Id for the version-relation, so it was
    always returning unversioned dependencies

https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=6d23697e7ec026b86b01030a482d546958a82c24

commit 6d23697e7ec026b86b01030a482d546958a82c24
Author: Ken Brown <kbrown@cornell.edu>
Date:   Wed Mar 21 15:38:07 2018 -0400

    Finish providing support for provides: and conflicts:
    
    Introduce member functions SolvableVersion::provides() and
    SolvableVersion::conflicts().  This enables packagedb::read() to access
    provides and conflicts lists from setup.ini.


Diff:
---
 libsolv.cc    |   16 ++++++++++++++--
 libsolv.h     |    4 ++++
 package_db.cc |    6 ++++++
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/libsolv.cc b/libsolv.cc
index 11394a2..63942b2 100644
--- a/libsolv.cc
+++ b/libsolv.cc
@@ -121,6 +121,18 @@ SolvableVersion::obsoletes() const
   return deplist(SOLVABLE_OBSOLETES);
 }
 
+const PackageDepends
+SolvableVersion::provides() const
+{
+  return deplist(SOLVABLE_PROVIDES);
+}
+
+const PackageDepends
+SolvableVersion::conflicts() const
+{
+  return deplist(SOLVABLE_CONFLICTS);
+}
+
 // helper function which returns the deplist for a given key, as a PackageDepends
 const PackageDepends
 SolvableVersion::deplist(Id keyname) const
@@ -147,9 +159,9 @@ SolvableVersion::deplist(Id keyname) const
           const char *name = pool_id2str(pool, q.elements[i]);
           PackageSpecification *spec = new PackageSpecification (name);
 
-          if (ISRELDEP(id))
+          if (ISRELDEP(q.elements[i]))
             {
-              Reldep *rd = GETRELDEP(pool, id);
+              Reldep *rd = GETRELDEP(pool, q.elements[i]);
               spec->setOperator(RelId2Operator(rd->flags));
               spec->setVersion(pool_id2str(pool, rd->evr));
             }
diff --git a/libsolv.h b/libsolv.h
index 7bb0be2..c218ab8 100644
--- a/libsolv.h
+++ b/libsolv.h
@@ -60,6 +60,10 @@ class SolvableVersion
   const PackageDepends depends() const;
   // Return the obsoletes list
   const PackageDepends obsoletes() const;
+  // Return the provides list
+  const PackageDepends provides() const;
+  // Return the conflicts list
+  const PackageDepends conflicts() const;
   bool accessible () const;
   package_type_t Type () const;
   package_stability_t Stability () const;
diff --git a/package_db.cc b/package_db.cc
index 2bbe3b1..2c4757c 100644
--- a/package_db.cc
+++ b/package_db.cc
@@ -146,6 +146,8 @@ packagedb::read ()
                   packageversion pv = findBinaryVersion(PackageSpecification(pkgname, f.ver));
                   PackageDepends dep;
                   PackageDepends obs;
+                  PackageDepends prov;
+                  PackageDepends conf;
                   if (pv)
                     {
                       data.sdesc = pv.SDesc();
@@ -157,6 +159,10 @@ packagedb::read ()
                       data.requires = &dep;
                       obs = pv.obsoletes();
                       data.obsoletes = &obs;
+                      prov = pv.provides();
+                      data.provides = &prov;
+                      conf = pv.conflicts();
+                      data.conflicts = &conf;
                     }
                   else
                     // This version is no longer available.  It could


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]