From: Ingo Weinhold Date: Sat, 30 Mar 2013 13:22:24 +0000 (+0000) Subject: Add support for Haiku compat version comparison X-Git-Tag: upstream/0.4.0~183 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb880a653d94ae7f2a98813c8f7861404fc05a51;p=platform%2Fupstream%2Flibsolv.git Add support for Haiku compat version comparison --- 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)