diff options
author | Michael Schroeder <mls@suse.de> | 2013-10-18 11:54:07 +0200 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2013-10-18 11:54:07 +0200 |
commit | a279f08fdca157613bc673ea7fa16fc333043d7d (patch) | |
tree | 1f808ff240fe07bcd8421185b761a890df93f84b | |
parent | 1fe6dc5d83d94adb96658ad86ac2a27011711c72 (diff) | |
download | libsolv-a279f08fdca157613bc673ea7fa16fc333043d7d.tar.gz libsolv-a279f08fdca157613bc673ea7fa16fc333043d7d.tar.bz2 libsolv-a279f08fdca157613bc673ea7fa16fc333043d7d.zip |
support debian multiarch annotation
-rw-r--r-- | ext/repo_deb.c | 9 | ||||
-rw-r--r-- | src/pool.c | 11 | ||||
-rw-r--r-- | src/pool.h | 3 | ||||
-rw-r--r-- | src/poolid.c | 2 |
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); @@ -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) @@ -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: |