summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/CMakeLists.txt1
-rw-r--r--ext/pool_parserpmrichdep.c20
-rw-r--r--ext/repo_deb.c4
-rw-r--r--ext/repo_mdk.c73
-rw-r--r--ext/repo_rpmdb.c3
-rw-r--r--ext/testcase.c7
-rw-r--r--ext/testcase.h6
7 files changed, 45 insertions, 69 deletions
diff --git a/ext/CMakeLists.txt b/ext/CMakeLists.txt
index 360c7dc..ad52495 100644
--- a/ext/CMakeLists.txt
+++ b/ext/CMakeLists.txt
@@ -128,6 +128,7 @@ ENDIF (DISABLE_SHARED)
SET_TARGET_PROPERTIES(libsolvext PROPERTIES OUTPUT_NAME "solvext")
SET_TARGET_PROPERTIES(libsolvext PROPERTIES SOVERSION ${LIBSOLVEXT_SOVERSION})
+SET_TARGET_PROPERTIES(libsolvext PROPERTIES INSTALL_NAME_DIR ${LIB_INSTALL_DIR})
INSTALL (FILES ${libsolvext_HEADERS} DESTINATION "${INCLUDE_INSTALL_DIR}/solv")
INSTALL (TARGETS libsolvext LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
diff --git a/ext/pool_parserpmrichdep.c b/ext/pool_parserpmrichdep.c
index 742823a..d3e559e 100644
--- a/ext/pool_parserpmrichdep.c
+++ b/ext/pool_parserpmrichdep.c
@@ -12,25 +12,15 @@
#include "pool.h"
#include "pool_parserpmrichdep.h"
-#define REL_THEN 0
-#define REL_ELSE 0
-
static struct RichOpComp {
const char *n;
int l;
Id fl;
} RichOps[] = {
- { "&&", 2, REL_AND },
- { "&", 1, REL_AND },
- { "AND", 3, REL_AND },
- { "||", 2, REL_OR },
- { "|", 1, REL_OR },
- { "OR", 2, REL_OR },
- { "IF", 2, REL_COND },
- { "THEN", 4, REL_THEN },
- { "?", 1, REL_THEN },
- { "ELSE", 4, REL_ELSE },
- { ":", 1, REL_ELSE },
+ { "and", 3, REL_AND },
+ { "or", 2, REL_OR },
+ { "if", 2, REL_COND },
+ { "else", 4, REL_ELSE },
{ NULL, 0, 0},
};
@@ -116,7 +106,7 @@ parseRichDep(Pool *pool, const char **depp, Id chainfl)
fl = op->fl;
if (!fl)
return 0;
- if (chainfl == REL_THEN && fl == REL_ELSE)
+ if (chainfl == REL_COND && fl == REL_ELSE)
chainfl = 0;
if (chainfl && fl != chainfl)
return 0;
diff --git a/ext/repo_deb.c b/ext/repo_deb.c
index 26c73b0..35dcc84 100644
--- a/ext/repo_deb.c
+++ b/ext/repo_deb.c
@@ -475,7 +475,7 @@ repo_add_deb(Repo *repo, const char *deb, int flags)
return 0;
}
l = fread(buf, 1, sizeof(buf), fp);
- if (l < 8 + 60 || strncmp((char *)buf, "!<arch>\ndebian-binary ", 8 + 16) != 0)
+ if (l < 8 + 60 || (strncmp((char *)buf, "!<arch>\ndebian-binary ", 8 + 16) != 0 && strncmp((char *)buf, "!<arch>\ndebian-binary/ ", 8 + 16) != 0))
{
pool_error(pool, -1, "%s: not a deb package", deb);
fclose(fp);
@@ -495,7 +495,7 @@ repo_add_deb(Repo *repo, const char *deb, int flags)
fclose(fp);
return 0;
}
- if (strncmp((char *)buf + 8 + 60 + vlen, "control.tar.gz ", 16) != 0)
+ if (strncmp((char *)buf + 8 + 60 + vlen, "control.tar.gz ", 16) != 0 && strncmp((char *)buf + 8 + 60 + vlen, "control.tar.gz/ ", 16) != 0)
{
pool_error(pool, -1, "%s: control.tar.gz is not second entry", deb);
fclose(fp);
diff --git a/ext/repo_mdk.c b/ext/repo_mdk.c
index 1bf6f17..3d0a91d 100644
--- a/ext/repo_mdk.c
+++ b/ext/repo_mdk.c
@@ -136,6 +136,8 @@ repo_add_mdk(Repo *repo, FILE *fp, int flags)
char *arch;
char *version;
char *filename;
+ char *disttag = 0;
+ char *distepoch = 0;
if ((epochstr = strchr(nvra, '@')) != 0)
{
char *sizestr;
@@ -146,14 +148,23 @@ repo_add_mdk(Repo *repo, FILE *fp, int flags)
*sizestr++ = 0;
if ((groupstr = strchr(sizestr, '@')) != 0)
{
- char *n;
*groupstr++ = 0;
- if ((n = strchr(groupstr, '@')) != 0)
- *n = 0;
+ if ((disttag = strchr(groupstr, '@')) != 0)
+ {
+ *disttag++ = 0;
+ if ((distepoch = strchr(disttag, '@')) != 0)
+ {
+ char *n;
+ *distepoch++ = 0;
+ if ((n = strchr(distepoch, '@')) != 0)
+ *n = 0;
+ }
+ }
if (*groupstr)
repodata_set_poolstr(data, s - pool->solvables, SOLVABLE_GROUP, groupstr);
}
- repodata_set_num(data, s - pool->solvables, SOLVABLE_INSTALLSIZE, strtoull(sizestr, 0, 10));
+ if (*sizestr)
+ repodata_set_num(data, s - pool->solvables, SOLVABLE_INSTALLSIZE, strtoull(sizestr, 0, 10));
}
}
filename = pool_tmpjoin(pool, nvra, ".rpm", 0);
@@ -163,47 +174,21 @@ repo_add_mdk(Repo *repo, FILE *fp, int flags)
*arch++ = 0;
s->arch = pool_str2id(pool, arch, 1);
}
- /* argh, do we have a distepoch or not, check self-provides */
- if (s->provides)
+ if (disttag && *disttag)
{
- Id id, lastid, *idp = s->repo->idarraydata + s->provides;
- lastid = 0;
- for (idp = s->repo->idarraydata + s->provides; (id = *idp) != 0; idp++)
- {
- const char *evr, *name;
- int namel;
- Reldep *rd;
- if (!ISRELDEP(id))
- continue;
- rd = GETRELDEP(pool, id);
- if (rd->flags != REL_EQ)
- continue;
- name = pool_id2str(pool, rd->name);
- namel = strlen(name);
- if (strncmp(name, nvra, namel) != 0 || nvra[namel] != '-')
- continue;
- evr = pool_id2str(pool, rd->evr);
- evr = strrchr(evr, '-');
- if (evr && strchr(evr, ':') != 0)
- lastid = id;
- }
- if (lastid)
- {
- /* self provides found, and it contains a distepoch */
- /* replace with self-provides distepoch to get rid of the disttag */
- char *nvradistepoch = strrchr(nvra, '-');
- if (nvradistepoch)
- {
- Reldep *rd = GETRELDEP(pool, lastid);
- const char *evr = pool_id2str(pool, rd->evr);
- evr = strrchr(evr, '-');
- if (evr && (evr = strchr(evr, ':')) != 0)
- {
- if (strlen(evr) < strlen(nvradistepoch))
- strcpy(nvradistepoch, evr);
- }
- }
- }
+ /* strip disttag from release */
+ char *n = strrchr(nvra, '-');
+ if (n && !strncmp(n + 1, disttag, strlen(disttag)))
+ *n = 0;
+ }
+ if (distepoch && *distepoch)
+ {
+ /* add distepoch */
+ int le = strlen(distepoch);
+ int ln = strlen(nvra);
+ nvra[ln++] = ':';
+ memmove(nvra + ln, distepoch, le); /* may overlap */
+ nvra[le + ln] = 0;
}
version = strrchr(nvra, '-');
if (version)
diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c
index 71c69ab..d49f9d8 100644
--- a/ext/repo_rpmdb.c
+++ b/ext/repo_rpmdb.c
@@ -150,7 +150,6 @@
#define DEP_STRONG (1 << 27)
#define DEP_PRE_IN ((1 << 6) | (1 << 9) | (1 << 10))
#define DEP_PRE_UN ((1 << 6) | (1 << 11) | (1 << 12))
-#define DEP_RICH (1 << 29)
#define FILEFLAG_GHOST (1 << 6)
@@ -537,7 +536,7 @@ makedeps(Pool *pool, Repo *repo, RpmHead *rpmhead, int tagn, int tagv, int tagf,
if (!strncmp(n[i], "rpmlib(", 7))
continue;
#ifdef ENABLE_COMPLEX_DEPS
- if ((f[i] & (DEP_RICH|DEP_LESS| DEP_EQUAL|DEP_GREATER)) == DEP_RICH && n[i][0] == '(')
+ if ((f[i] & (DEP_LESS|DEP_EQUAL|DEP_GREATER)) == 0 && n[i][0] == '(')
{
id = pool_parserpmrichdep(pool, n[i]);
if (id)
diff --git a/ext/testcase.c b/ext/testcase.c
index 251cd2f..e4346fe 100644
--- a/ext/testcase.c
+++ b/ext/testcase.c
@@ -378,6 +378,7 @@ struct oplist {
{ REL_COND, "<IF>" },
{ REL_COMPAT, "compat >=" },
{ REL_KIND, "<KIND>" },
+ { REL_ELSE, "<ELSE>" },
{ REL_LT, "<" },
{ 0, 0 }
};
@@ -2006,7 +2007,7 @@ testcase_solverresult(Solver *solv, int resultflags)
int
-testcase_write(Solver *solv, char *dir, int resultflags, const char *testcasename, const char *resultname)
+testcase_write(Solver *solv, const char *dir, int resultflags, const char *testcasename, const char *resultname)
{
Pool *pool = solv->pool;
Repo *repo;
@@ -2332,7 +2333,7 @@ str2resultflags(Pool *pool, char *s) /* modifies the string! */
}
Solver *
-testcase_read(Pool *pool, FILE *fp, char *testcase, Queue *job, char **resultp, int *resultflagsp)
+testcase_read(Pool *pool, FILE *fp, const char *testcase, Queue *job, char **resultp, int *resultflagsp)
{
Solver *solv;
char *buf, *bufp;
@@ -2750,7 +2751,7 @@ testcase_read(Pool *pool, FILE *fp, char *testcase, Queue *job, char **resultp,
}
char *
-testcase_resultdiff(char *result1, char *result2)
+testcase_resultdiff(const char *result1, const char *result2)
{
Strqueue sq1, sq2, osq;
char *r;
diff --git a/ext/testcase.h b/ext/testcase.h
index 78f78b0..4903e6c 100644
--- a/ext/testcase.h
+++ b/ext/testcase.h
@@ -32,6 +32,6 @@ extern const char *testcase_getsolverflags(Solver *solv);
extern int testcase_setsolverflags(Solver *solv, const char *str);
extern void testcase_resetsolverflags(Solver *solv);
extern char *testcase_solverresult(Solver *solv, int flags);
-extern int testcase_write(Solver *solv, char *dir, int resultflags, const char *testcasename, const char *resultname);
-extern Solver *testcase_read(Pool *pool, FILE *fp, char *testcase, Queue *job, char **resultp, int *resultflagsp);
-extern char *testcase_resultdiff(char *result1, char *result2);
+extern int testcase_write(Solver *solv, const char *dir, int resultflags, const char *testcasename, const char *resultname);
+extern Solver *testcase_read(Pool *pool, FILE *fp, const char *testcase, Queue *job, char **resultp, int *resultflagsp);
+extern char *testcase_resultdiff(const char *result1, const char *result2);