switch range->name and range->evr in REL_COMPAT deps so that stringification works
authorMichael Schroeder <mls@suse.de>
Tue, 16 Apr 2013 11:19:50 +0000 (13:19 +0200)
committerMichael Schroeder <mls@suse.de>
Tue, 16 Apr 2013 11:19:50 +0000 (13:19 +0200)
ext/repo_haiku.cpp
src/pool.c

index e5b448f..6aeec57 100644 (file)
@@ -56,8 +56,8 @@ static void add_dependency(Repo *repo, Offset &dependencies, const char *name,
 
     if (compatVersion && compatVersion[0] != '\0')
       {
-        versionId = pool_rel2id(pool, pool_str2id(pool, compatVersion, 1),
-          versionId, REL_COMPAT, 1);
+        versionId = pool_rel2id(pool, versionID, pool_str2id(pool, compatVersion, 1),
+          REL_COMPAT, 1);
       }
 
     dependency = pool_rel2id(pool, dependency, versionId, flags, 1);
index 9eddb2b..ffe1fef 100644 (file)
@@ -652,13 +652,13 @@ pool_match_flags_evr(Pool *pool, int pflags, Id pevr, int flags, int evr)
 static int
 pool_match_flags_evr_rel_compat(Pool *pool, Reldep *range, int flags, int evr)
 {
-  /* 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. */
+  /* range->name is the actual version, range->evr the backwards compatibility
+     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);
+    return pool_match_flags_evr(pool, REL_EQ, range->name, flags, evr);
+  return pool_match_flags_evr(pool, REL_LT | REL_EQ, range->name, flags, evr) &&
+         pool_match_flags_evr(pool, REL_GT | REL_EQ, range->evr, REL_EQ, evr);
 }
 #endif