aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2012-01-08 10:18:55 +0000
committerJason Woodward2012-01-08 11:51:52 +0000
commit7517a5ba3280de332145985bd6d1f34f656179c2 (patch)
tree41d6e286d76bf3260ba9de70419a6ea59bb2d6eb /src
parentafebb536b69bb7040bee5fc93f84dfeec1bbe904 (diff)
downloadslapt-get-7517a5ba3280de332145985bd6d1f34f656179c2.tar.gz
[HACK] prefer our architecture in x86/x86_64 multilib package comparison
Diffstat (limited to 'src')
-rw-r--r--src/package.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/package.c b/src/package.c
index cce8f06..b0ac4a8 100644
--- a/src/package.c
+++ b/src/package.c
@@ -1146,8 +1146,21 @@ int slapt_cmp_pkg_versions(const char *a, const char *b)
if (a_build != NULL && b_build != NULL) {
/* they are equal if the integer values are equal */
/* for instance, "1rob" and "1" will be equal */
- if (atoi(a_build) == atoi(b_build))
+ if (atoi(a_build) == atoi(b_build)) {
+/* prefer our architecture in x86/x86_64 multilib settings */
+#if defined(__x86_64__)
+ if ((strcmp(a_build,b_build) == 0) && (strcmp(a,b) != 0) && (strstr(a,"-x86_64") != NULL && (strstr(b,"-x86_64-") == NULL)))
+ return greater;
+ if ((strcmp(a_build,b_build) == 0) && (strcmp(a,b) != 0) && (strstr(a,"-x86_64") == NULL && (strstr(b,"-x86_64-") != NULL)))
+ return lesser;
+#elif defined(__i386__)
+ if ((strcmp(a_build,b_build) == 0) && (strcmp(a,b) != 0) && (strstr(a,"-x86_64") == NULL && (strstr(b,"-x86_64-") != NULL)))
+ return greater;
+ if ((strcmp(a_build,b_build) == 0) && (strcmp(a,b) != 0) && (strstr(a,"-x86_64") != NULL && (strstr(b,"-x86_64-") == NULL)))
+ return lesser;
+#endif
return equal;
+ }
if (atoi(a_build) < atoi(b_build))
return greater;