summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2013-10-18 11:54:07 +0200
committerMichael Schroeder <mls@suse.de>2013-10-18 11:54:07 +0200
commita279f08fdca157613bc673ea7fa16fc333043d7d (patch)
tree1f808ff240fe07bcd8421185b761a890df93f84b
parent1fe6dc5d83d94adb96658ad86ac2a27011711c72 (diff)
downloadlibsolv-a279f08fdca157613bc673ea7fa16fc333043d7d.tar.gz
libsolv-a279f08fdca157613bc673ea7fa16fc333043d7d.tar.bz2
libsolv-a279f08fdca157613bc673ea7fa16fc333043d7d.zip
support debian multiarch annotation
-rw-r--r--ext/repo_deb.c9
-rw-r--r--src/pool.c11
-rw-r--r--src/pool.h3
-rw-r--r--src/poolid.c2
4 files changed, 23 insertions, 2 deletions
diff --git a/ext/repo_deb.c b/ext/repo_deb.c
index e9e4e39..370050e 100644
--- a/ext/repo_deb.c
+++ b/ext/repo_deb.c
@@ -122,7 +122,14 @@ parseonedep(Pool *pool, char *p)
while (*p == ' ' || *p == '\t' || *p == '\n')
p++;
}
- name = pool_strn2id(pool, n, ne - n, 1);
+ if (ne - n > 4 && !strncmp(ne - 4, ":any", 4))
+ {
+ /* multiarch annotation */
+ name = pool_strn2id(pool, n, ne - n - 4, 1);
+ name = pool_rel2id(pool, name, ARCH_ANY, REL_MULTIARCH, 1);
+ }
+ else
+ name = pool_strn2id(pool, n, ne - n, 1);
if (e)
{
evr = pool_strn2id(pool, e, ee - e, 1);
diff --git a/src/pool.c b/src/pool.c
index f7b5456..910a9c1 100644
--- a/src/pool.c
+++ b/src/pool.c
@@ -621,6 +621,11 @@ pool_match_nevr_rel(Pool *pool, Solvable *s, Id d)
if (!pool_match_nevr(pool, s, name))
return 0;
return pool_match_nevr(pool, s, evr);
+ case REL_MULTIARCH:
+ if (evr != ARCH_ANY)
+ return 0;
+ /* XXX : need to check for Multi-Arch: allowed! */
+ return pool_match_nevr(pool, s, name);
default:
return 0;
}
@@ -1001,6 +1006,12 @@ pool_addrelproviders(Pool *pool, Id d)
wp = 0;
}
break;
+ case REL_MULTIARCH:
+ if (evr != ARCH_ANY)
+ break;
+ /* XXX : need to check for Multi-Arch: allowed! */
+ wp = pool_whatprovides(pool, name);
+ break;
case REL_KIND:
/* package kind filtering */
if (!name)
diff --git a/src/pool.h b/src/pool.h
index 2227bc2..d29f615 100644
--- a/src/pool.h
+++ b/src/pool.h
@@ -213,7 +213,8 @@ struct _Pool {
#define REL_FILECONFLICT 21
#define REL_COND 22
#define REL_COMPAT 23
-#define REL_KIND 24 /* for filters only */
+#define REL_KIND 24 /* for filters only */
+#define REL_MULTIARCH 25 /* debian multiarch annotation */
#if !defined(__GNUC__) && !defined(__attribute__)
# define __attribute__(x)
diff --git a/src/poolid.c b/src/poolid.c
index 66b6d46..285ecaa 100644
--- a/src/poolid.c
+++ b/src/poolid.c
@@ -180,6 +180,8 @@ pool_id2rel(const Pool *pool, Id id)
return " NAMESPACE "; /* actually not used in dep2str */
case REL_ARCH:
return ".";
+ case REL_MULTIARCH:
+ return ":";
case REL_FILECONFLICT:
return " FILECONFLICT ";
case REL_COND: