From: DongHun Kwak Date: Thu, 23 Dec 2021 05:47:06 +0000 (+0900) Subject: Imported Upstream version 0.7.18 X-Git-Tag: upstream/0.7.18^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9c08bb3b899936e1eb9b6ab9d0cef17501ad6bab;hp=de92b8ea19562961f973960c0f8f5aec7f6d9c75;p=platform%2Fupstream%2Flibsolv.git Imported Upstream version 0.7.18 --- diff --git a/.travis.yml b/.travis.yml index a115095..4e8fd75 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,12 @@ matrix: apt: packages: - cmake + - os: linux + arch: ppc64le + addons: + apt: + packages: + - cmake - os: osx osx_image: xcode9.4 compiler: clang diff --git a/NEWS b/NEWS index 7e91d66..a627131 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,13 @@ This file contains the major changes between libsolv versions: +Version 0.7.18 +- selected bug fixes: + * fixed regex code on win32 + * fixed memory leak in choice rule generation +- new features: + * repo_add_conda: add flag to skip v2 packages + Version 0.7.17 - selected bug fixes: * repo_write: fix handling of nested flexarray diff --git a/VERSION.cmake b/VERSION.cmake index adf18d2..8a96a14 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 "17") +SET(LIBSOLV_PATCH "18") diff --git a/ext/repo_conda.c b/ext/repo_conda.c index 6e9a963..c35dc62 100644 --- a/ext/repo_conda.c +++ b/ext/repo_conda.c @@ -258,7 +258,7 @@ parse_packages2(struct parsedata *pd, struct solv_jsonparser *jp) } static int -parse_main(struct parsedata *pd, struct solv_jsonparser *jp) +parse_main(struct parsedata *pd, struct solv_jsonparser *jp, int flags) { int type = JP_OBJECT; while (type > 0 && (type = jsonparser_parse(jp)) > 0 && type != JP_OBJECT_END) @@ -267,9 +267,9 @@ parse_main(struct parsedata *pd, struct solv_jsonparser *jp) type = parse_packages(pd, jp); else if (type == JP_ARRAY && !strcmp("packages", jp->key)) type = parse_packages2(pd, jp); - else if (type == JP_OBJECT && !strcmp("packages.conda", jp->key)) + else if (type == JP_OBJECT && !strcmp("packages.conda", jp->key) && !(flags & CONDA_ADD_USE_ONLY_TAR_BZ2)) type = parse_packages(pd, jp); - else if (type == JP_ARRAY && !strcmp("packages.conda", jp->key)) + else if (type == JP_ARRAY && !strcmp("packages.conda", jp->key) && !(flags & CONDA_ADD_USE_ONLY_TAR_BZ2)) type = parse_packages2(pd, jp); else type = jsonparser_skip(jp, type); @@ -298,7 +298,7 @@ repo_add_conda(Repo *repo, FILE *fp, int flags) jsonparser_init(&jp, fp); if ((type = jsonparser_parse(&jp)) != JP_OBJECT) ret = pool_error(pool, -1, "repository does not start with an object"); - else if ((type = parse_main(&pd, &jp)) != JP_OBJECT_END) + else if ((type = parse_main(&pd, &jp, flags)) != JP_OBJECT_END) ret = pool_error(pool, -1, "parse error line %d", jp.line); jsonparser_free(&jp); diff --git a/ext/repo_conda.h b/ext/repo_conda.h index 7e90a3d..fa626f1 100644 --- a/ext/repo_conda.h +++ b/ext/repo_conda.h @@ -5,4 +5,6 @@ * for further information */ +#define CONDA_ADD_USE_ONLY_TAR_BZ2 (1 << 8) + extern int repo_add_conda(Repo *repo, FILE *fp, int flags); diff --git a/package/libsolv.changes b/package/libsolv.changes index d477d71..32ec121 100644 --- a/package/libsolv.changes +++ b/package/libsolv.changes @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Fri Mar 26 14:17:46 CET 2021 - mls@suse.de + +- fixed regex code on win32 +- fixed memory leak in choice rule generation +- repo_add_conda: add flag to skip v2 packages +- bump version to 0.7.18 + +------------------------------------------------------------------- Tue Jan 19 15:09:12 CET 2021 - mls@suse.de - repo_write: fix handling of nested flexarray diff --git a/src/rules.c b/src/rules.c index b3609bb..b1b5f09 100644 --- a/src/rules.c +++ b/src/rules.c @@ -3339,7 +3339,6 @@ solver_addchoicerules(Solver *solv) return; } now = solv_timems(0); - solv->choicerules_info = solv_calloc(solv->pkgrules_end, sizeof(Id)); queue_init(&q); queue_init(&qi); queue_init(&qcheck); diff --git a/win32/regex.h b/win32/regex.h index 7996b58..06a1090 100644 --- a/win32/regex.h +++ b/win32/regex.h @@ -12,7 +12,8 @@ extern "C" { #define CHARCLASS_NAME_MAX 14 #define RE_DUP_MAX 255 -typedef size_t regoff_t; +#include +typedef SSIZE_T regoff_t; // #include typedef struct re_pattern_buffer { diff --git a/win32/regexec.c b/win32/regexec.c index f22586e..61e40a5 100644 --- a/win32/regexec.c +++ b/win32/regexec.c @@ -231,7 +231,7 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, pbytes = sizeof(*reach_pos) * tnfa->num_states; xbytes = sizeof(regoff_t) * num_tags; total_bytes = - (sizeof(long) - 1) * 4 /* for alignment paddings */ + (sizeof(size_t) - 1) * 4 /* for alignment paddings */ + (rbytes + xbytes * tnfa->num_states) * 2 + tbytes + pbytes; /* Allocate the memory. */ @@ -242,16 +242,16 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, /* Get the various pointers within tmp_buf (properly aligned). */ tmp_tags = (void *)buf; tmp_buf = buf + tbytes; - tmp_buf += ALIGN(tmp_buf, long); + tmp_buf += ALIGN(tmp_buf, size_t); reach_next = (void *)tmp_buf; tmp_buf += rbytes; - tmp_buf += ALIGN(tmp_buf, long); + tmp_buf += ALIGN(tmp_buf, size_t); reach = (void *)tmp_buf; tmp_buf += rbytes; - tmp_buf += ALIGN(tmp_buf, long); + tmp_buf += ALIGN(tmp_buf, size_t); reach_pos = (void *)tmp_buf; tmp_buf += pbytes; - tmp_buf += ALIGN(tmp_buf, long); + tmp_buf += ALIGN(tmp_buf, size_t); for (i = 0; i < tnfa->num_states; i++) { reach[i].tags = (void *)tmp_buf; diff --git a/win32/tre-mem.c b/win32/tre-mem.c index 0fbf7b2..327515b 100644 --- a/win32/tre-mem.c +++ b/win32/tre-mem.c @@ -143,7 +143,7 @@ tre_mem_alloc_impl(tre_mem_t mem, int provided, void *provided_block, } /* Make sure the next pointer will be aligned. */ - size += ALIGN(mem->ptr + size, long); + size += ALIGN(mem->ptr + size, size_t); /* Allocate from current block. */ ptr = mem->ptr; diff --git a/win32/tre.h b/win32/tre.h index c07c959..390df94 100644 --- a/win32/tre.h +++ b/win32/tre.h @@ -32,6 +32,7 @@ #include #include #include +#include #undef TRE_MBSTATE @@ -77,8 +78,8 @@ typedef wctype_t tre_ctype_t; /* Returns number of bytes to add to (char *)ptr to make it properly aligned for the type. */ #define ALIGN(ptr, type) \ - ((((long)ptr) % sizeof(type)) \ - ? (sizeof(type) - (((long)ptr) % sizeof(type))) \ + ((((uintptr_t)ptr) % sizeof(type)) \ + ? (sizeof(type) - (((uintptr_t)ptr) % sizeof(type))) \ : 0) #undef MAX