summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Weinhold <ingo_weinhold@gmx.de>2013-03-30 13:22:24 +0000
committerMichael Schroeder <mls@suse.de>2013-04-16 11:09:45 +0200
commiteb880a653d94ae7f2a98813c8f7861404fc05a51 (patch)
treeb9b604310d362af1dec64a6b08a5f87e73ea532a
parenta9b6445cf5cc2d53b03cf4d618ded29ee56b6f5f (diff)
downloadlibsolv-eb880a653d94ae7f2a98813c8f7861404fc05a51.tar.gz
libsolv-eb880a653d94ae7f2a98813c8f7861404fc05a51.tar.bz2
libsolv-eb880a653d94ae7f2a98813c8f7861404fc05a51.zip
Add support for Haiku compat version comparison
-rw-r--r--src/pool.c13
-rw-r--r--src/pool.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/pool.c b/src/pool.c
index 2bcb71c..f5dfc40 100644
--- a/src/pool.c
+++ b/src/pool.c
@@ -611,6 +611,19 @@ pool_match_flags_evr(Pool *pool, int pflags, Id pevr, int flags, int evr)
return 1; /* both rels show in the same direction */
if (pevr == evr)
return (flags & pflags & REL_EQ) ? 1 : 0;
+ if (ISRELDEP(pevr))
+ {
+ Reldep *range = GETRELDEP(pool, pevr);
+ if (range->flags != REL_COMPAT)
+ return 0; /* unsupported */
+ /* range->name is the backwards compatibility version, range->evr the
+ actual version. If flags are '>=' or '>', we match the compatibility
+ version as well, otherwise only the actual version. */
+ if (!(flags & REL_GT) || (flags & REL_LT))
+ return pool_match_flags_evr(pool, REL_EQ, range->evr, flags, evr);
+ return pool_match_flags_evr(pool, REL_LT | REL_EQ, range->evr, flags, evr) &&
+ pool_match_flags_evr(pool, REL_GT | REL_EQ, range->name, REL_EQ, evr);
+ }
switch (pool_evrcmp(pool, pevr, evr, EVRCMP_DEPCMP))
{
case -2:
diff --git a/src/pool.h b/src/pool.h
index bed2052..b40c88d 100644
--- a/src/pool.h
+++ b/src/pool.h
@@ -202,6 +202,7 @@ struct _Pool {
#define REL_ARCH 20
#define REL_FILECONFLICT 21
#define REL_COND 22
+#define REL_COMPAT 23
#if !defined(__GNUC__) && !defined(__attribute__)
# define __attribute__(x)