import libsolv-0.7.19-1.el8

This commit is contained in:
CentOS Sources 2021-11-09 04:54:11 -05:00 committed by Stepan Oksanichenko
parent 6bf946f715
commit 11d0d27c78
5 changed files with 118 additions and 152 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/libsolv-0.7.16.tar.gz
SOURCES/libsolv-0.7.19.tar.gz

View File

@ -1 +1 @@
6adefba167c60bbb282bed453bd1b9966311f91d SOURCES/libsolv-0.7.16.tar.gz
b4101632c56b00e0bd8f41d772a7998a3d000a74 SOURCES/libsolv-0.7.19.tar.gz

View File

@ -0,0 +1,30 @@
From 8615575144e6fd3d708a30983ed2415db479ef4c Mon Sep 17 00:00:00 2001
From: Jaroslav Rohel <jrohel@redhat.com>
Date: Thu, 8 Apr 2021 12:17:09 +0200
Subject: [PATCH] Fix: Memory leaks in SWIG generated code (for Python)
There were memory leaks in the `Chksum_from_bin`, `Chksum_add`,
`SolvFp_write` functions wrapper for Python.
The problem was in "freearg" typemap argument defined in "solv.i".
Therefore, the typemap was not applied.
---
bindings/solv.i | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bindings/solv.i b/bindings/solv.i
index 1882b13..3bbeca0 100644
--- a/bindings/solv.i
+++ b/bindings/solv.i
@@ -63,7 +63,7 @@ typedef struct {
$2 = size;
}
-%typemap(freearg,noblock=1,match="in") (const unsigned char *str, int len) {
+%typemap(freearg,noblock=1,match="in") (const unsigned char *str, size_t len) {
if (alloc$argnum == SWIG_NEWOBJ) %delete_array(buf$argnum);
}
--
libgit2 1.0.1

View File

@ -1,62 +0,0 @@
From 0956e7d1b1354860ab0bf7105c4477cb2c61539a Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Mon, 14 Dec 2020 11:12:00 +0100
Subject: [PATCH] testcase_read: error out if repos are added or the system is
changed too late
We must not add new solvables after the considered map was created, the solver
was created, or jobs were added. We may not changed the system after jobs have
been added.
(Jobs may point inside the whatproviedes array, so we must not invalidate this
area.)
---
ext/testcase.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/ext/testcase.c b/ext/testcase.c
index bd0643a8a..b81834faa 100644
--- a/ext/testcase.c
+++ b/ext/testcase.c
@@ -1975,6 +1975,7 @@ testcase_read(Pool *pool, FILE *fp, const char *testcase, Queue *job, char **res
Id *genid = 0;
int ngenid = 0;
Queue autoinstq;
+ int oldjobsize = job ? job->count : 0;
if (resultp)
*resultp = 0;
@@ -2049,6 +2050,21 @@ testcase_read(Pool *pool, FILE *fp, const char *testcase, Queue *job, char **res
int prio, subprio;
const char *rdata;
+ if (pool->considered)
+ {
+ pool_error(pool, 0, "testcase_read: cannot add repos after packages were disabled");
+ continue;
+ }
+ if (solv)
+ {
+ pool_error(pool, 0, "testcase_read: cannot add repos after the solver was created");
+ continue;
+ }
+ if (job && job->count != oldjobsize)
+ {
+ pool_error(pool, 0, "testcase_read: cannot add repos after jobs have been created");
+ continue;
+ }
prepared = 0;
if (!poolflagsreset)
{
@@ -2109,6 +2125,11 @@ testcase_read(Pool *pool, FILE *fp, const char *testcase, Queue *job, char **res
int i;
/* must set the disttype before the arch */
+ if (job && job->count != oldjobsize)
+ {
+ pool_error(pool, 0, "testcase_read: cannot change the system after jobs have been created");
+ continue;
+ }
prepared = 0;
if (strcmp(pieces[2], "*") != 0)
{

View File

@ -1,23 +1,13 @@
%global libname solv
%if (0%{?rhel} && 0%{?rhel} <= 7) || (0%{?fedora} && 0%{?fedora} <= 29)
%bcond_without python2_bindings
%else
%bcond_with python2_bindings
%endif
%if 0%{?rhel} && 0%{?rhel} <= 7
%bcond_with perl_bindings
%bcond_with ruby_bindings
%bcond_with python3_bindings
%else
%bcond_without python_bindings
%bcond_without perl_bindings
%bcond_without ruby_bindings
%bcond_without python3_bindings
%endif
# Creates special prefixed pseudo-packages from appdata metadata
%bcond_without appdata
# Creates special prefixed "group:", "category:" pseudo-packages
%bcond_without comps
%bcond_without conda
# For rich dependencies
%bcond_without complex_deps
%if 0%{?rhel}
@ -27,6 +17,7 @@
%bcond_with arch_repo
# For handling deb + rpm at the same time
%bcond_with multi_semantics
%bcond_with zchunk
%else
%bcond_without helix_repo
%bcond_without suse_repo
@ -34,16 +25,19 @@
%bcond_without arch_repo
# For handling deb + rpm at the same time
%bcond_without multi_semantics
%bcond_without zstd
%bcond_without zchunk
%endif
%bcond_without zstd
#global commitnum 2901
#global commit 47fbaa2a0892866d30ec0e1b4c885532d0aca7b8
#global shortcommit %%(c=%%{commit}; echo ${c:0:7})
%define __cmake_switch(b:) %{expand:%%{?with_%{-b*}:ON}}%{expand:%%{!?with_%{-b*}:OFF}}
Name: lib%{libname}
Version: 0.7.16
Release: 3%{?commit:.git.%{commitnum}.%{?shortcommit}}%{?dist}
Version: 0.7.19
Release: 1%{?commit:.git.%{commitnum}.%{?shortcommit}}%{?dist}
Summary: Package dependency solver
License: BSD
@ -55,7 +49,7 @@ Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
%endif
# https://bugzilla.redhat.com/show_bug.cgi?id=1630300
Patch1: 0001-Add-support-for-computing-hashes-using-OpenSSL.patch
Patch2: 0002-testcase_read-error-out-if-repos-are-added-or-the-system-is-changed-too-late.patch
Patch2: 0002-Fix-Memory-leaks-in-SWIG-generated-code-for-Python.patch
BuildRequires: cmake
BuildRequires: gcc-c++
@ -70,8 +64,16 @@ BuildRequires: pkgconfig(openssl)
BuildRequires: xz-devel
# -DENABLE_BZIP2_COMPRESSION=ON
BuildRequires: bzip2-devel
%if %{with zstd}
# -DENABLE_ZSTD_COMPRESSION=ON
BuildRequires: libzstd-devel
%endif
%if %{with zchunk}
# -DENABLE_ZCHUNK_COMPRESSION=ON
BuildRequires: pkgconfig(zck)
%endif
# https://bugzilla.redhat.com/show_bug.cgi?id=1830346
Conflicts: rpm%{?_isa} < 4.14.3
%description
A free package dependency solver using a satisfiability algorithm. The
@ -94,13 +96,8 @@ Development files for %{name}.
%package tools
Summary: Package dependency solver tools
Requires: %{name}%{?_isa} = %{version}-%{release}
# repo2solv dependencies. All of those are used in shell-script.
Requires: %{_bindir}/gzip
Requires: %{_bindir}/bzip2
Requires: %{_bindir}/lzma
Requires: %{_bindir}/xz
Requires: %{_bindir}/cat
Requires: %{_bindir}/find
# repo2solv dependencies. Used as execl()
Requires: /usr/bin/find
%description tools
Package dependency solver tools.
@ -109,8 +106,8 @@ Package dependency solver tools.
Summary: Applications demoing the %{name} library
Requires: %{name}%{?_isa} = %{version}-%{release}
# solv dependencies. Used as execlp() and system()
Requires: %{_bindir}/curl
Requires: %{_bindir}/gpg2
Requires: /usr/bin/curl
Requires: /usr/bin/gpg2
%description demo
Applications demoing the %{name} library.
@ -138,21 +135,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
Ruby bindings for the %{name} library.
%endif
%if %{with python2_bindings}
%package -n python2-%{libname}
Summary: Python bindings for the %{name} library
%{?python_provide:%python_provide python2-%{libname}}
BuildRequires: swig
BuildRequires: python2-devel
Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n python2-%{libname}
Python bindings for the %{name} library.
Python 2 version.
%endif
%if %{with python3_bindings}
%if %{with python_bindings}
%package -n python3-%{libname}
Summary: Python bindings for the %{name} library
%{?python_provide:%python_provide python3-%{libname}}
@ -170,53 +153,51 @@ Python 3 version.
%autosetup -p1 %{?commit:-n %{name}-%{commit}}
%build
%cmake . -B"%{_vpath_builddir}" -GNinja \
-DFEDORA=1 \
-DENABLE_RPMDB=ON \
-DENABLE_RPMDB_BYRPMHEADER=ON \
-DENABLE_RPMDB_LIBRPM=ON \
-DENABLE_RPMPKG_LIBRPM=ON \
-DENABLE_RPMMD=ON \
%{?with_comps:-DENABLE_COMPS=ON} \
%{?with_appdata:-DENABLE_APPDATA=ON} \
-DUSE_VENDORDIRS=ON \
-DWITH_LIBXML2=ON \
-DWITH_OPENSSL=ON \
-DENABLE_LZMA_COMPRESSION=ON \
-DENABLE_BZIP2_COMPRESSION=ON \
-DENABLE_ZSTD_COMPRESSION=ON \
%{?with_helix_repo:-DENABLE_HELIXREPO=ON} \
%{?with_suse_repo:-DENABLE_SUSEREPO=ON} \
%{?with_debian_repo:-DENABLE_DEBIAN=ON} \
%{?with_arch_repo:-DENABLE_ARCHREPO=ON} \
%{?with_multi_semantics:-DMULTI_SEMANTICS=ON} \
%{?with_complex_deps:-DENABLE_COMPLEX_DEPS=1} \
%{?with_perl_bindings:-DENABLE_PERL=ON} \
%{?with_ruby_bindings:-DENABLE_RUBY=ON} \
%if %{with python2_bindings} || %{with python3_bindings}
-DENABLE_PYTHON=ON \
%if %{with python2_bindings}
-DPythonLibs_FIND_VERSION=%{python2_version} \
-DPythonLibs_FIND_VERSION_MAJOR=2 \
%if %{with python3_bindings}
-DENABLE_PYTHON3=ON \
-DPYTHON3_EXECUTABLE=%{__python3} \
%endif
%else
-DPythonLibs_FIND_VERSION=%{python3_version} \
-DPythonLibs_FIND_VERSION_MAJOR=3 \
%cmake -GNinja \
-DFEDORA=1 \
-DENABLE_RPMDB=ON \
-DENABLE_RPMDB_BYRPMHEADER=ON \
-DENABLE_RPMDB_LIBRPM=ON \
-DENABLE_RPMPKG_LIBRPM=ON \
-DENABLE_RPMMD=ON \
-DENABLE_COMPS=%{__cmake_switch -b comps} \
-DENABLE_APPDATA=%{__cmake_switch -b appdata} \
-DUSE_VENDORDIRS=ON \
-DWITH_LIBXML2=ON \
-DWITH_OPENSSL=ON \
-DENABLE_LZMA_COMPRESSION=ON \
-DENABLE_BZIP2_COMPRESSION=ON \
-DENABLE_ZSTD_COMPRESSION=%{__cmake_switch -b zstd} \
-DENABLE_ZCHUNK_COMPRESSION=%{__cmake_switch -b zchunk} \
%if %{with zchunk}
-DWITH_SYSTEM_ZCHUNK=ON \
%endif
-DENABLE_HELIXREPO=%{__cmake_switch -b helix_repo} \
-DENABLE_SUSEREPO=%{__cmake_switch -b suse_repo} \
-DENABLE_DEBIAN=%{__cmake_switch -b debian_repo} \
-DENABLE_ARCHREPO=%{__cmake_switch -b arch_repo} \
-DMULTI_SEMANTICS=%{__cmake_switch -b multi_semantics} \
-DENABLE_COMPLEX_DEPS=%{__cmake_switch -b complex_deps} \
-DENABLE_CONDA=%{__cmake_switch -b conda} \
-DENABLE_PERL=%{__cmake_switch -b perl_bindings} \
-DENABLE_RUBY=%{__cmake_switch -b ruby_bindings} \
-DENABLE_PYTHON=%{__cmake_switch -b python_bindings} \
%if %{with python_bindings}
-DPYTHON_EXECUTABLE=%{python3} \
%endif
%{nil}
%ninja_build -C "%{_vpath_builddir}"
%cmake_build
%install
%ninja_install -C "%{_vpath_builddir}"
%cmake_install
%check
%ninja_test -C "%{_vpath_builddir}"
%ctest
%ldconfig_scriptlets
# Python smoke test (not tested in %%ctest):
export PYTHONPATH=%{buildroot}%{python3_sitearch}
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
%python3 -c 'import solv'
%files
%license LICENSE*
@ -271,6 +252,9 @@ Python 3 version.
%if %{with suse_repo}
%solv_tool susetags2solv
%endif
%if %{with conda}
%{_bindir}/conda2solv
%endif
%files demo
%solv_tool solv
@ -286,13 +270,7 @@ Python 3 version.
%{ruby_vendorarchdir}/%{libname}.so
%endif
%if %{with python2_bindings}
%files -n python2-%{libname}
%{python2_sitearch}/_%{libname}.so
%{python2_sitearch}/%{libname}.py*
%endif
%if %{with python3_bindings}
%if %{with python_bindings}
%files -n python3-%{libname}
%{python3_sitearch}/_%{libname}.so
%{python3_sitearch}/%{libname}.py
@ -300,8 +278,28 @@ Python 3 version.
%endif
%changelog
* Mon Sep 27 2021 Pavla Kratochvilova <pkratoch@redhat.org> - 0.7.11-3
- Backport patch: testcase_read: error out if repos are added or the system is changed too late
* Tue Jul 27 2021 Pavla Kratochvilova <pkratoch@redhat.org> - 0.7.19-1
- Update to 0.7.19
- repo_add_conda: add flag to skip v2 packages
- fix rare segfault in resolve_jobrules() that could happen if new rules are learnt
- fix error handling in solv_xfopen_fd()
- fix memory leaks
* Fri Apr 30 2021 Pavla Kratochvilova <pkratoch@redhat.org> - 0.7.17-2
- Fix rpm dependency
* Thu Apr 29 2021 Pavla Kratochvilova <pkratoch@redhat.org> - 0.7.17-1
- Update to 0.7.17
- selected bug fixes:
* repo_write: fix handling of nested flexarray
* improve choicerule generation a bit more to cover more cases
* harden testcase parser against repos being added too late
* support python-3.10
* check %_dbpath macro in rpmdb code
- new features:
* handle default/visible/langonly attributes in comps parser
* support multiple collections in updateinfo parser
* add '-D' option in rpmdb2solv to set the dbpath
* Thu Jan 14 2021 Nicola Sella <nsella@redhat.com> - 0.7.16-2
- Enable zstd compression in libsolv