Update to 0.20.0
This commit is contained in:
		
							parent
							
								
									7307bfb7ba
								
							
						
					
					
						commit
						1936b507d7
					
				
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -25,3 +25,4 @@ | ||||
| /libdnf-0.17.2.tar.gz | ||||
| /libdnf-0.19.0.tar.gz | ||||
| /libdnf-0.19.1.tar.gz | ||||
| /libdnf-0.20.0.tar.gz | ||||
|  | ||||
| @ -1,38 +0,0 @@ | ||||
| From ccf8b4945ba6a7c888237ff0b439153b79740d80 Mon Sep 17 00:00:00 2001 | ||||
| From: Kalev Lember <klember@redhat.com> | ||||
| Date: Wed, 12 Sep 2018 15:24:05 +0200 | ||||
| Subject: [PATCH] db: Don't crash when a package has no origin | ||||
| 
 | ||||
| This fixes a NULL pointer dereference in a debug print that was causing | ||||
| packagekitd crashes. | ||||
| 
 | ||||
| https://bugzilla.redhat.com/show_bug.cgi?id=1626851 | ||||
| ---
 | ||||
|  libdnf/dnf-db.cpp | 4 +--- | ||||
|  1 file changed, 1 insertion(+), 3 deletions(-) | ||||
| 
 | ||||
| diff --git a/libdnf/dnf-db.cpp b/libdnf/dnf-db.cpp
 | ||||
| index 5b28288f..894703d3 100644
 | ||||
| --- a/libdnf/dnf-db.cpp
 | ||||
| +++ b/libdnf/dnf-db.cpp
 | ||||
| @@ -36,8 +36,6 @@
 | ||||
|  void | ||||
|  dnf_db_ensure_origin_pkg(DnfDb *db, DnfPackage *pkg) | ||||
|  { | ||||
| -    g_autoptr(GError) error = NULL;
 | ||||
| -
 | ||||
|      /* already set */ | ||||
|      if (dnf_package_get_origin(pkg) != NULL) | ||||
|          return; | ||||
| @@ -47,7 +45,7 @@ dnf_db_ensure_origin_pkg(DnfDb *db, DnfPackage *pkg)
 | ||||
|      /* set from the database if available */ | ||||
|      auto tmp = db->getRPMRepo(dnf_package_get_nevra(pkg)); | ||||
|      if (tmp.empty()) { | ||||
| -        g_debug("no origin for %s: %s", dnf_package_get_package_id(pkg), error->message);
 | ||||
| +        g_debug("no origin for %s", dnf_package_get_package_id(pkg));
 | ||||
|      } else { | ||||
|          dnf_package_set_origin(pkg, tmp.c_str()); | ||||
|      } | ||||
| -- 
 | ||||
| 2.19.0.rc0 | ||||
| 
 | ||||
| @ -1,51 +0,0 @@ | ||||
| From bc3b61f81a691eee19aa4da04bf8279f35a7c031 Mon Sep 17 00:00:00 2001 | ||||
| From: Daniel Mach <dmach@redhat.com> | ||||
| Date: Fri, 10 Aug 2018 17:55:33 +0200 | ||||
| Subject: [PATCH] [transaction] Fix crash after using dnf.comps.CompsQuery and | ||||
|  forking the process in Anaconda. | ||||
| 
 | ||||
| dnf.base.Base.install_specs() uses CompsQuery. | ||||
| CompsQuery opens a connection to the history database. | ||||
| Anaconda runs do_transaction() as a background (forked) process. | ||||
| The fork leads to undefined behavior and crash after an attempt | ||||
| to work with the history database. | ||||
| ---
 | ||||
|  libdnf/transaction/CompsEnvironmentItem.cpp | 5 ++++- | ||||
|  libdnf/transaction/CompsGroupItem.cpp       | 5 ++++- | ||||
|  2 files changed, 8 insertions(+), 2 deletions(-) | ||||
| 
 | ||||
| diff --git a/libdnf/transaction/CompsEnvironmentItem.cpp b/libdnf/transaction/CompsEnvironmentItem.cpp
 | ||||
| index d1c0fb40..9b399161 100644
 | ||||
| --- a/libdnf/transaction/CompsEnvironmentItem.cpp
 | ||||
| +++ b/libdnf/transaction/CompsEnvironmentItem.cpp
 | ||||
| @@ -185,7 +185,10 @@ CompsEnvironmentItem::getTransactionItemsByPattern(SQLite3Ptr conn, const std::s
 | ||||
|   | ||||
|      std::vector< TransactionItemPtr > result; | ||||
|   | ||||
| -    SQLite3::Query query(*conn, sql);
 | ||||
| +    // HACK: create a private connection to avoid undefined behavior
 | ||||
| +    // after forking process in Anaconda
 | ||||
| +    SQLite3 privateConn(conn->getPath());
 | ||||
| +    SQLite3::Query query(privateConn, sql);
 | ||||
|      std::string pattern_sql = pattern; | ||||
|      std::replace(pattern_sql.begin(), pattern_sql.end(), '*', '%'); | ||||
|      query.bindv(pattern, pattern, pattern); | ||||
| diff --git a/libdnf/transaction/CompsGroupItem.cpp b/libdnf/transaction/CompsGroupItem.cpp
 | ||||
| index ce7b9146..1eb162e1 100644
 | ||||
| --- a/libdnf/transaction/CompsGroupItem.cpp
 | ||||
| +++ b/libdnf/transaction/CompsGroupItem.cpp
 | ||||
| @@ -181,7 +181,10 @@ CompsGroupItem::getTransactionItemsByPattern(SQLite3Ptr conn, const std::string
 | ||||
|   | ||||
|      std::vector< TransactionItemPtr > result; | ||||
|   | ||||
| -    SQLite3::Query query(*conn, sql);
 | ||||
| +    // HACK: create a private connection to avoid undefined behavior
 | ||||
| +    // after forking process in Anaconda
 | ||||
| +    SQLite3 privateConn(conn->getPath());
 | ||||
| +    SQLite3::Query query(privateConn, sql);
 | ||||
|      std::string pattern_sql = pattern; | ||||
|      std::replace(pattern_sql.begin(), pattern_sql.end(), '*', '%'); | ||||
|      query.bindv(pattern, pattern, pattern); | ||||
| -- 
 | ||||
| 2.18.0 | ||||
| 
 | ||||
							
								
								
									
										34
									
								
								585.patch
									
									
									
									
									
								
							
							
						
						
									
										34
									
								
								585.patch
									
									
									
									
									
								
							| @ -1,34 +0,0 @@ | ||||
| From 8e16fa3adc4ae1c3657956eef5eee5b40d1208c0 Mon Sep 17 00:00:00 2001 | ||||
| From: Daniel Mach <dmach@redhat.com> | ||||
| Date: Tue, 18 Sep 2018 21:42:03 +0200 | ||||
| Subject: [PATCH] [transaction] Skip storing some obsoletes in the history | ||||
|  database. | ||||
| 
 | ||||
| ---
 | ||||
|  libdnf/dnf-transaction.cpp | 13 +++++++++++++ | ||||
|  1 file changed, 13 insertions(+) | ||||
| 
 | ||||
| diff --git a/libdnf/dnf-transaction.cpp b/libdnf/dnf-transaction.cpp
 | ||||
| index 28d15d803..638b0640a 100644
 | ||||
| --- a/libdnf/dnf-transaction.cpp
 | ||||
| +++ b/libdnf/dnf-transaction.cpp
 | ||||
| @@ -1258,6 +1258,19 @@ dnf_transaction_commit(DnfTransaction *transaction, HyGoal goal, DnfState *state
 | ||||
|                  } | ||||
|              } | ||||
|   | ||||
| +            if (swdbAction == libdnf::TransactionItemAction::OBSOLETED
 | ||||
| +                && dnf_find_pkg_from_name(priv->install, pkg_tmp_name) != NULL
 | ||||
| +                && g_strcmp0(pkg_name, pkg_tmp_name) != 0) {
 | ||||
| +                    // If a package is obsoleted and there's a package with the same name
 | ||||
| +                    // in the install set, skip recording the obsolete in the history db
 | ||||
| +                    // because the package upgrade prevails over the obsolete.
 | ||||
| +                    //
 | ||||
| +                    // Example:
 | ||||
| +                    // grub2-tools-efi obsoletes grub2-tools  # skip as grub2-tools is also upgraded
 | ||||
| +                    // grub2-tools upgrades grub2-tools
 | ||||
| +                    continue;
 | ||||
| +            }
 | ||||
| +
 | ||||
|              // TODO SWDB add pkg_tmp replaced_by pkg | ||||
|              _history_write_item(pkg_tmp, priv->swdb, swdbAction); | ||||
|          } | ||||
							
								
								
									
										45
									
								
								libdnf.spec
									
									
									
									
									
								
							
							
						
						
									
										45
									
								
								libdnf.spec
									
									
									
									
									
								
							| @ -1,6 +1,6 @@ | ||||
| %global libsolv_version 0.6.30-1 | ||||
| %global libmodulemd_version 1.6.1 | ||||
| %global dnf_conflict 3.0.0 | ||||
| %global dnf_conflict 3.6.0 | ||||
| %global swig_version 3.0.12 | ||||
| 
 | ||||
| %bcond_with valgrind | ||||
| @ -12,6 +12,13 @@ | ||||
| %bcond_without python3 | ||||
| %endif | ||||
| 
 | ||||
| %if 0%{?rhel} > 7 || 0%{?fedora} > 29 | ||||
| # Disable python2 build by default | ||||
| %bcond_with python2 | ||||
| %else | ||||
| %bcond_without python2 | ||||
| %endif | ||||
| 
 | ||||
| %if 0%{?rhel} && ! 0%{?centos} | ||||
| %bcond_without rhsm | ||||
| %else | ||||
| @ -23,19 +30,13 @@ | ||||
|     %{nil} | ||||
| 
 | ||||
| Name:           libdnf | ||||
| Version:        0.19.1 | ||||
| Release:        3%{?dist} | ||||
| Version:        0.20.0 | ||||
| Release:        1%{?dist} | ||||
| Summary:        Library providing simplified C and Python API to libsolv | ||||
| License:        LGPLv2+ | ||||
| URL:            https://github.com/rpm-software-management/libdnf | ||||
| Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz | ||||
| 
 | ||||
| # https://bugzilla.redhat.com/show_bug.cgi?id=1626851 | ||||
| Patch1:         0001-db-Don-t-crash-when-a-package-has-no-origin.patch | ||||
| # https://bugzilla.redhat.com/show_bug.cgi?id=1629340 | ||||
| # https://github.com/rpm-software-management/libdnf/pull/585 | ||||
| Patch2:         585.patch | ||||
| 
 | ||||
| BuildRequires:  cmake | ||||
| BuildRequires:  gcc | ||||
| BuildRequires:  gcc-c++ | ||||
| @ -73,6 +74,7 @@ Requires:       libsolv-devel%{?_isa} >= %{libsolv_version} | ||||
| %description devel | ||||
| Development files for %{name}. | ||||
| 
 | ||||
| %if %{with python2} | ||||
| %package -n python2-%{name} | ||||
| %{?python_provide:%python_provide python2-%{name}} | ||||
| Summary:        Python 2 bindings for the libdnf library. | ||||
| @ -88,7 +90,7 @@ BuildRequires:  swig >= %{swig_version} | ||||
| 
 | ||||
| %description -n python2-%{name} | ||||
| Python 2 bindings for the libdnf library. | ||||
| 
 | ||||
| %endif # with python2 | ||||
| 
 | ||||
| %if %{with python3} | ||||
| %package -n python3-%{name} | ||||
| @ -103,6 +105,7 @@ BuildRequires:  swig >= %{swig_version} | ||||
| Python 3 bindings for the libdnf library. | ||||
| %endif | ||||
| 
 | ||||
| %if %{with python2} | ||||
| %package -n python2-hawkey | ||||
| Summary:        Python 2 bindings for the hawkey library | ||||
| %{?python_provide:%python_provide python2-hawkey} | ||||
| @ -121,6 +124,7 @@ Conflicts:      python-dnf < %{dnf_conflict} | ||||
| 
 | ||||
| %description -n python2-hawkey | ||||
| Python 2 bindings for the hawkey library. | ||||
| %endif # with python2 | ||||
| 
 | ||||
| %if %{with python3} | ||||
| %package -n python3-hawkey | ||||
| @ -142,16 +146,20 @@ Python 3 bindings for the hawkey library. | ||||
| 
 | ||||
| %prep | ||||
| %autosetup -p1 | ||||
| %if %{with python2} | ||||
| mkdir build-py2 | ||||
| %endif # with python2 | ||||
| %if %{with python3} | ||||
| mkdir build-py3 | ||||
| %endif | ||||
| 
 | ||||
| %build | ||||
| %if %{with python2} | ||||
| pushd build-py2 | ||||
|   %cmake -DPYTHON_DESIRED:FILEPATH=%{__python2} -DWITH_MAN=OFF ../ %{!?with_valgrind:-DDISABLE_VALGRIND=1} %{_cmake_opts} | ||||
|   %make_build | ||||
| popd | ||||
| %endif # with python2 | ||||
| 
 | ||||
| %if %{with python3} | ||||
| pushd build-py3 | ||||
| @ -169,9 +177,11 @@ ERROR | ||||
|         exit 1 | ||||
| fi | ||||
| 
 | ||||
| %if %{with python2} | ||||
| pushd build-py2 | ||||
|   make ARGS="-V" test | ||||
| popd | ||||
| %endif # with python2 | ||||
| %if %{with python3} | ||||
| # Run just the Python tests, not all of them, since | ||||
| # we have coverage of the core from the first build | ||||
| @ -181,9 +191,11 @@ popd | ||||
| %endif | ||||
| 
 | ||||
| %install | ||||
| %if %{with python2} | ||||
| pushd build-py2 | ||||
|   %make_install | ||||
| popd | ||||
| %endif # with python2 | ||||
| %if %{with python3} | ||||
| pushd build-py3 | ||||
|   %make_install | ||||
| @ -210,16 +222,20 @@ popd | ||||
| %{_libdir}/pkgconfig/%{name}.pc | ||||
| %{_includedir}/%{name}/ | ||||
| 
 | ||||
| %if %{with python2} | ||||
| %files -n python2-%{name} | ||||
| %{python2_sitearch}/%{name}/ | ||||
| %endif # with python2 | ||||
| 
 | ||||
| %if %{with python3} | ||||
| %files -n python3-%{name} | ||||
| %{python3_sitearch}/%{name}/ | ||||
| %endif | ||||
| 
 | ||||
| %if %{with python2} | ||||
| %files -n python2-hawkey | ||||
| %{python2_sitearch}/hawkey/ | ||||
| %endif # with python2 | ||||
| 
 | ||||
| %if %{with python3} | ||||
| %files -n python3-hawkey | ||||
| @ -227,6 +243,15 @@ popd | ||||
| %endif | ||||
| 
 | ||||
| %changelog | ||||
| * Tue Sep 25 2018 Jaroslav Mracek <jmracek@redhat.com> - 0.20.0-1 | ||||
| - [module] Report module solver errors | ||||
| - [module] Enhance module commands and errors | ||||
| - [transaction] Fixed several problems with SWDB | ||||
| - Remove unneeded regex URL tests (RhBug:1598336) | ||||
| - Allow quoted values in ini files (RhBug:1624056) | ||||
| - Filter out not unique set of solver problems (RhBug:1564369) | ||||
| - Disable python2 build for Fedora 30+ | ||||
| 
 | ||||
| * Tue Sep 18 2018 Adam Williamson <awilliam@redhat.com> - 0.19.1-3 | ||||
| - Backport PR #585 for an update crash bug (#1629340) | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										2
									
								
								sources
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								sources
									
									
									
									
									
								
							| @ -1 +1 @@ | ||||
| SHA512 (libdnf-0.19.1.tar.gz) = 450c10487e102315ccf1a2d393ba7b3f9717263f36b44e898123b02c8b9ff30b269dbfaa549197dc47e16e0fc9798785b058b0e1c1601e7616232d4e8c6b135e | ||||
| SHA512 (libdnf-0.20.0.tar.gz) = 70fd838d7683c1017415e7630c072bdd8de70f61efc54b37c1b67887f428ec37550f5eb40843535e76633ccfc290c893a754622ab444a87d1864ec6e405e352c | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user