summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2020-11-27 14:49:23 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2020-11-27 14:49:23 +0900
commite0e41666c5a48c53ab30c943f2b0964a3600eadd (patch)
treee4e3a9e79456e7590a902670017519fa3b2521a6
parent6a68988035ea989055076d81b7ab53c7015c8c32 (diff)
downloadlibsolv-e0e41666c5a48c53ab30c943f2b0964a3600eadd.tar.gz
libsolv-e0e41666c5a48c53ab30c943f2b0964a3600eadd.tar.bz2
libsolv-e0e41666c5a48c53ab30c943f2b0964a3600eadd.zip
Imported Upstream version 0.7.13upstream/0.7.13
-rw-r--r--NEWS3
-rw-r--r--VERSION.cmake2
-rw-r--r--ext/repo_conda.c39
-rw-r--r--package/libsolv.changes6
-rw-r--r--src/repo.c2
-rw-r--r--src/repodata.c2
6 files changed, 35 insertions, 19 deletions
diff --git a/NEWS b/NEWS
index 9bdc2d8..7ed259d 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@
This file contains the major changes between
libsolv versions:
+Version 0.7.13
+- fix solvable swapping messing up uninternalized idarrays
+
Version 0.7.12
- conda: support packages.conda repositories
- conda: de-priorize track features
diff --git a/VERSION.cmake b/VERSION.cmake
index ffa76f3..80aed44 100644
--- a/VERSION.cmake
+++ b/VERSION.cmake
@@ -49,5 +49,5 @@ SET(LIBSOLVEXT_SOVERSION "1")
SET(LIBSOLV_MAJOR "0")
SET(LIBSOLV_MINOR "7")
-SET(LIBSOLV_PATCH "12")
+SET(LIBSOLV_PATCH "13")
diff --git a/ext/repo_conda.c b/ext/repo_conda.c
index f58da0f..6e9a963 100644
--- a/ext/repo_conda.c
+++ b/ext/repo_conda.c
@@ -64,7 +64,7 @@ parse_otherdeps(struct parsedata *pd, struct solv_jsonparser *jp, Id handle, Id
}
static int
-parse_trackfeatures(struct parsedata *pd, struct solv_jsonparser *jp, Id handle)
+parse_trackfeatures_array(struct parsedata *pd, struct solv_jsonparser *jp, Id handle)
{
int type = JP_ARRAY;
while (type > 0 && (type = jsonparser_parse(jp)) > 0 && type != JP_ARRAY_END)
@@ -87,10 +87,25 @@ parse_trackfeatures(struct parsedata *pd, struct solv_jsonparser *jp, Id handle)
return type;
}
+static void
+parse_trackfeatures_string(struct parsedata *pd, const char *p, Id handle)
+{
+ const char *pe;
+ for (; *p; p++)
+ {
+ if (*p == ' ' || *p == '\t' || *p == ',')
+ continue;
+ pe = p + 1;
+ while (*pe && *pe != ' ' && *pe != '\t' && *pe != ',')
+ pe++;
+ repodata_add_idarray(pd->data, handle, SOLVABLE_TRACK_FEATURES, pool_strn2id(pd->pool, p, pe - p, 1));
+ p = pe - 1;
+ }
+}
+
static void
-swap_solvables(Repo *repo, Repodata *data, Id pa, Id pb)
+swap_solvables(Pool *pool, Repodata *data, Id pa, Id pb)
{
- Pool *pool = repo->pool;
Solvable tmp;
tmp = pool->solvables[pa];
@@ -170,21 +185,9 @@ parse_package(struct parsedata *pd, struct solv_jsonparser *jp, char *kfn)
repodata_set_num(data, handle, SOLVABLE_BUILDTIME, ts);
}
else if (type == JP_STRING && !strcmp(jp->key, "track_features"))
- {
- char *p = jp->value, *pe;
- for (; *p; p++)
- {
- if (*p == ' ' || *p == '\t' || *p == ',')
- continue;
- pe = p + 1;
- while (*pe && *pe != ' ' && *pe != '\t' && *pe != ',')
- pe++;
- repodata_add_idarray(data, handle, SOLVABLE_TRACK_FEATURES, pool_strn2id(pool, p, pe - p, 1));
- p = pe - 1;
- }
- }
+ parse_trackfeatures_string(pd, jp->value, handle);
else if (type == JP_ARRAY && !strcmp(jp->key, "track_features"))
- type = parse_trackfeatures(pd, jp, handle);
+ type = parse_trackfeatures_array(pd, jp, handle);
else
type = jsonparser_skip(jp, type);
}
@@ -212,7 +215,7 @@ parse_package(struct parsedata *pd, struct solv_jsonparser *jp, char *kfn)
if (fndata[0] && fndata[0] < fntype)
{
/* replace old package */
- swap_solvables(pd->repo, data, handle, fndata[1]);
+ swap_solvables(pool, data, handle, fndata[1]);
repo_free_solvable(pd->repo, handle, 1);
handle = fndata[1];
}
diff --git a/package/libsolv.changes b/package/libsolv.changes
index caccbeb..5aec357 100644
--- a/package/libsolv.changes
+++ b/package/libsolv.changes
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Fri Apr 24 12:00:30 CEST 2020 - mls@suse.de
+
+- Fix solvable swapping messing up idarrays
+- bump version to 0.7.13
+
+-------------------------------------------------------------------
Mon Apr 20 17:24:21 CEST 2020 - mls@suse.de
- fix ruleinfo of complex dependencies returning the wrong origin
diff --git a/src/repo.c b/src/repo.c
index 45e8681..b266d8d 100644
--- a/src/repo.c
+++ b/src/repo.c
@@ -213,6 +213,8 @@ repo_free_solvable_block(Repo *repo, Id start, int count, int reuseids)
int j;
for (j = dstart; j < dend; j++)
data->attrs[j - data->start] = solv_free(data->attrs[j - data->start]);
+ if (data->lasthandle >= dstart && data->lasthandle < dend)
+ data->lasthandle = 0;
}
if (data->incoreoffset)
memset(data->incoreoffset + (dstart - data->start), 0, (dend - dstart) * sizeof(Id));
diff --git a/src/repodata.c b/src/repodata.c
index 0580cff..4e75b6d 100644
--- a/src/repodata.c
+++ b/src/repodata.c
@@ -3100,6 +3100,8 @@ repodata_swap_attrs(Repodata *data, Id dest, Id src)
tmpattrs = data->attrs[dest - data->start];
data->attrs[dest - data->start] = data->attrs[src - data->start];
data->attrs[src - data->start] = tmpattrs;
+ if (data->lasthandle == src || data->lasthandle == dest)
+ data->lasthandle = 0;
}