diff --git a/.gitignore b/.gitignore index 25a2499..34291a0 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ /libdnf-0.28.0.tar.gz /libdnf-0.28.1.tar.gz /libdnf-0.31.0.tar.gz +/libdnf-0.35.1.tar.gz diff --git a/0002-Reintroduce-hawkeyRepo-deprecated-for-compatibility.patch b/0002-Reintroduce-hawkeyRepo-deprecated-for-compatibility.patch deleted file mode 100644 index 1998ab8..0000000 --- a/0002-Reintroduce-hawkeyRepo-deprecated-for-compatibility.patch +++ /dev/null @@ -1,430 +0,0 @@ -From ab61bd2cb0ae458aae7c8e4ff7081bd2ab2094f5 Mon Sep 17 00:00:00 2001 -From: Jaroslav Rohel -Date: Thu, 2 May 2019 10:56:04 +0200 -Subject: [PATCH] Reintroduce hawkey.Repo (deprecated, for compatibility) - ---- - python/hawkey/CMakeLists.txt | 1 + - python/hawkey/__init__.py | 5 +++-- - python/hawkey/hawkeymodule.cpp | 8 +++++++- - python/hawkey/repo-py.cpp | 213 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - python/hawkey/repo-py.hpp | 33 +++++++++++++++++++++++++++++++++ - python/hawkey/sack-py.cpp | 48 +++++++++++++++++++++++++++++++----------------- - 6 files changed, 288 insertions(+), 20 deletions(-) - create mode 100644 python/hawkey/repo-py.cpp - create mode 100644 python/hawkey/repo-py.hpp - -diff --git a/python/hawkey/CMakeLists.txt b/python/hawkey/CMakeLists.txt -index 96e9d43..d964534 100644 ---- a/python/hawkey/CMakeLists.txt -+++ b/python/hawkey/CMakeLists.txt -@@ -33,6 +33,7 @@ set(hawkeymodule_SRCS - packagedelta-py.cpp - query-py.cpp - reldep-py.cpp -+ repo-py.cpp - sack-py.cpp - selector-py.cpp - subject-py.cpp -diff --git a/python/hawkey/__init__.py b/python/hawkey/__init__.py -index 7ad77f8..f5f0816 100644 ---- a/python/hawkey/__init__.py -+++ b/python/hawkey/__init__.py -@@ -1,5 +1,5 @@ - # --# Copyright (C) 2012-2014 Red Hat, Inc. -+# Copyright (C) 2012-2019 Red Hat, Inc. - # - # Licensed under the GNU Lesser General Public License Version 2.1 - # -@@ -52,7 +52,7 @@ __all__ = [ - # functions - 'chksum_name', 'chksum_type', 'split_nevra', 'convert_hawkey_reason', - # classes -- 'Goal', 'NEVRA', 'NSVCAP', 'Package', 'Query', 'Sack', 'Selector', 'Subject'] -+ 'Goal', 'NEVRA', 'NSVCAP', 'Package', 'Query', 'Repo', 'Sack', 'Selector', 'Subject'] - - NEVRA = _hawkey.NEVRA - Query = _hawkey.Query -@@ -131,6 +131,7 @@ REFERENCE_VENDOR = _hawkey.REFERENCE_VENDOR - - Package = _hawkey.Package - Reldep = _hawkey.Reldep -+Repo = _hawkey.Repo - Sack = _hawkey.Sack - - Exception = _hawkey.Exception -diff --git a/python/hawkey/hawkeymodule.cpp b/python/hawkey/hawkeymodule.cpp -index 70659a8..72e7085 100644 ---- a/python/hawkey/hawkeymodule.cpp -+++ b/python/hawkey/hawkeymodule.cpp -@@ -1,5 +1,5 @@ - /* -- * Copyright (C) 2012-2014 Red Hat, Inc. -+ * Copyright (C) 2012-2019 Red Hat, Inc. - * - * Licensed under the GNU Lesser General Public License Version 2.1 - * -@@ -46,6 +46,7 @@ - #include "packagedelta-py.hpp" - #include "query-py.hpp" - #include "reldep-py.hpp" -+#include "repo-py.hpp" - #include "sack-py.hpp" - #include "selector-py.hpp" - #include "subject-py.hpp" -@@ -193,6 +194,11 @@ PYCOMP_MOD_INIT(_hawkey) - return PYCOMP_MOD_ERROR_VAL; - Py_INCREF(&selector_Type); - PyModule_AddObject(m, "Selector", (PyObject *)&selector_Type); -+ /* _hawkey.Repo */ -+ if (PyType_Ready(&repo_Type) < 0) -+ return PYCOMP_MOD_ERROR_VAL; -+ Py_INCREF(&repo_Type); -+ PyModule_AddObject(m, "Repo", (PyObject *)&repo_Type); - /* _hawkey.NEVRA */ - if (PyType_Ready(&nevra_Type) < 0) - return PYCOMP_MOD_ERROR_VAL; -diff --git a/python/hawkey/repo-py.cpp b/python/hawkey/repo-py.cpp -new file mode 100644 -index 0000000..eff32be ---- /dev/null -+++ b/python/hawkey/repo-py.cpp -@@ -0,0 +1,213 @@ -+/* -+ * Copyright (C) 2012-2019 Red Hat, Inc. -+ * -+ * Licensed under the GNU Lesser General Public License Version 2.1 -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#include -+#include -+ -+// hawkey -+#include "hy-repo.h" -+ -+// pyhawkey -+#include "hawkey-pysys.hpp" -+#include "repo-py.hpp" -+ -+#include "pycomp.hpp" -+ -+typedef struct { -+ PyObject_HEAD -+ HyRepo repo; -+} _RepoObject; -+ -+typedef struct { -+ int (*getter)(HyRepo); -+ void (*setter)(HyRepo, int); -+} IntGetSetter; -+ -+HyRepo repoFromPyObject(PyObject *o) -+{ -+ if (!repoObject_Check(o)) { -+ //PyErr_SetString(PyExc_TypeError, "Expected a Repo object."); -+ return NULL; -+ } -+ return ((_RepoObject *)o)->repo; -+} -+ -+PyObject *repoToPyObject(HyRepo repo) -+{ -+ _RepoObject *self = (_RepoObject *)repo_Type.tp_alloc(&repo_Type, 0); -+ if (self) -+ self->repo = repo; -+ return (PyObject *)self; -+} -+ -+/* functions on the type */ -+ -+static PyObject * -+repo_new(PyTypeObject *type, PyObject *args, PyObject *kwds) -+{ -+ _RepoObject *self = (_RepoObject *)type->tp_alloc(type, 0); -+ if (self) { -+ self->repo = hy_repo_create("(default)"); -+ if (self->repo == NULL) { -+ Py_DECREF(self); -+ return NULL; -+ } -+ } -+ return (PyObject *) self; -+} -+ -+static int -+repo_init(_RepoObject *self, PyObject *args, PyObject *kwds) -+{ -+ const char *name; -+ if (!PyArg_ParseTuple(args, "s", &name)) -+ return -1; -+ hy_repo_set_string(self->repo, HY_REPO_NAME, name); -+ return 0; -+} -+ -+static void -+repo_dealloc(_RepoObject *self) -+{ -+ hy_repo_free(self->repo); -+ Py_TYPE(self)->tp_free(self); -+} -+ -+/* getsetters */ -+ -+static PyObject * -+get_int(_RepoObject *self, void *closure) -+{ -+ IntGetSetter *functions = (IntGetSetter*)closure; -+ return PyLong_FromLong(functions->getter(self->repo)); -+} -+ -+static int -+set_int(_RepoObject *self, PyObject *value, void *closure) -+{ -+ IntGetSetter *functions = (IntGetSetter*)closure; -+ long num = PyLong_AsLong(value); -+ if (PyErr_Occurred()) -+ return -1; -+ if (num > INT_MAX || num < INT_MIN) { -+ PyErr_SetString(PyExc_ValueError, "Value in the integer range expected."); -+ return -1; -+ } -+ functions->setter(self->repo, num); -+ return 0; -+} -+ -+static PyObject * -+get_str(_RepoObject *self, void *closure) -+{ -+ int str_key = (intptr_t)closure; -+ const char *str; -+ PyObject *ret; -+ -+ str = hy_repo_get_string(self->repo, str_key); -+ if (str == NULL) { -+ ret = PyString_FromString(""); -+ } else { -+ ret = PyString_FromString(str); -+ } -+ return ret; // NULL if PyString_FromString failed -+} -+ -+static int -+set_str(_RepoObject *self, PyObject *value, void *closure) -+{ -+ intptr_t str_key = (intptr_t)closure; -+ PycompString str_value(value); -+ if (!str_value.getCString()) -+ return -1; -+ hy_repo_set_string(self->repo, str_key, str_value.getCString()); -+ return 0; -+} -+ -+static IntGetSetter hy_repo_cost{hy_repo_get_cost, hy_repo_set_cost}; -+ -+static IntGetSetter hy_repo_priority{hy_repo_get_priority, hy_repo_set_priority}; -+ -+static PyGetSetDef repo_getsetters[] = { -+ {(char*)"cost", (getter)get_int, (setter)set_int, (char*)"repository cost", -+ (void *)&hy_repo_cost}, -+ {(char*)"name", (getter)get_str, (setter)set_str, NULL, -+ (void *)HY_REPO_NAME}, -+ {(char*)"priority", (getter)get_int, (setter)set_int, (char*)"repository priority", -+ (void *)&hy_repo_priority}, -+ {(char*)"repomd_fn", (getter)get_str, (setter)set_str, NULL, -+ (void *)HY_REPO_MD_FN}, -+ {(char*)"primary_fn", (getter)get_str, (setter)set_str, NULL, -+ (void *)HY_REPO_PRIMARY_FN}, -+ {(char*)"filelists_fn", (getter)get_str, (setter)set_str, NULL, -+ (void *)HY_REPO_FILELISTS_FN}, -+ {(char*)"modules_fn", (getter)get_str, (setter)set_str, NULL, -+ (void *)MODULES_FN}, -+ {(char*)"presto_fn", (getter)get_str, (setter)set_str, NULL, -+ (void *)HY_REPO_PRESTO_FN}, -+ {(char*)"updateinfo_fn", (getter)get_str, (setter)set_str, NULL, -+ (void *)HY_REPO_UPDATEINFO_FN}, -+ {(char*)"other_fn", (getter)get_str, (setter)set_str, NULL, -+ (void *)HY_REPO_OTHER_FN}, -+ {NULL} /* sentinel */ -+}; -+ -+PyTypeObject repo_Type = { -+ PyVarObject_HEAD_INIT(NULL, 0) -+ "_hawkey.Repo", /*tp_name*/ -+ sizeof(_RepoObject), /*tp_basicsize*/ -+ 0, /*tp_itemsize*/ -+ (destructor) repo_dealloc, /*tp_dealloc*/ -+ 0, /*tp_print*/ -+ 0, /*tp_getattr*/ -+ 0, /*tp_setattr*/ -+ 0, /*tp_compare*/ -+ 0, /*tp_repr*/ -+ 0, /*tp_as_number*/ -+ 0, /*tp_as_sequence*/ -+ 0, /*tp_as_mapping*/ -+ 0, /*tp_hash */ -+ 0, /*tp_call*/ -+ 0, /*tp_str*/ -+ 0, /*tp_getattro*/ -+ 0, /*tp_setattro*/ -+ 0, /*tp_as_buffer*/ -+ Py_TPFLAGS_DEFAULT, /*tp_flags*/ -+ "Repo object", /* tp_doc */ -+ 0, /* tp_traverse */ -+ 0, /* tp_clear */ -+ 0, /* tp_richcompare */ -+ 0, /* tp_weaklistoffset */ -+ PyObject_SelfIter, /* tp_iter */ -+ 0, /* tp_iternext */ -+ 0, /* tp_methods */ -+ 0, /* tp_members */ -+ repo_getsetters, /* tp_getset */ -+ 0, /* tp_base */ -+ 0, /* tp_dict */ -+ 0, /* tp_descr_get */ -+ 0, /* tp_descr_set */ -+ 0, /* tp_dictoffset */ -+ (initproc)repo_init, /* tp_init */ -+ 0, /* tp_alloc */ -+ repo_new, /* tp_new */ -+ 0, /* tp_free */ -+ 0, /* tp_is_gc */ -+}; -diff --git a/python/hawkey/repo-py.hpp b/python/hawkey/repo-py.hpp -new file mode 100644 -index 0000000..cb3f014 ---- /dev/null -+++ b/python/hawkey/repo-py.hpp -@@ -0,0 +1,33 @@ -+/* -+ * Copyright (C) 2012-2019 Red Hat, Inc. -+ * -+ * Licensed under the GNU Lesser General Public License Version 2.1 -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+#ifndef REPO_PY_H -+#define REPO_PY_H -+ -+#include "hy-types.h" -+ -+extern PyTypeObject repo_Type; -+ -+#define repoObject_Check(v) ((v)->ob_type == &repo_Type) -+ -+HyRepo repoFromPyObject(PyObject *o); -+PyObject *repoToPyObject(HyRepo repo); -+ -+#endif // REPO_PY_H -diff --git a/python/hawkey/sack-py.cpp b/python/hawkey/sack-py.cpp -index 11f9d7c..63012c7 100644 ---- a/python/hawkey/sack-py.cpp -+++ b/python/hawkey/sack-py.cpp -@@ -1,5 +1,5 @@ - /* -- * Copyright (C) 2012-2015 Red Hat, Inc. -+ * Copyright (C) 2012-2019 Red Hat, Inc. - * - * Licensed under the GNU Lesser General Public License Version 2.1 - * -@@ -37,6 +37,7 @@ - #include "hawkey-pysys.hpp" - #include "iutil-py.hpp" - #include "package-py.hpp" -+#include "repo-py.hpp" - #include "sack-py.hpp" - - #include "pycomp.hpp" -@@ -641,16 +642,23 @@ load_system_repo(_SackObject *self, PyObject *args, PyObject *kwds) - return 0; - - if (repoPyObj) { -- auto repoSwigPyObj = reinterpret_cast(PyObject_GetAttrString(repoPyObj, "this")); -- if (!repoSwigPyObj) { -- PyErr_SetString(PyExc_SystemError, "Unable to parse repoSwigPyObject"); -- return NULL; -- } - -- crepo = repoSwigPyObj->ptr; -+ // Is it old deprecated _hawkey.Repo object? -+ crepo = repoFromPyObject(repoPyObj); -+ -+ // Or is it swig object? - if (!crepo) { -- PyErr_SetString(PyExc_SystemError, "Unable to parse repo swig object"); -- return NULL; -+ auto repoSwigPyObj = reinterpret_cast(PyObject_GetAttrString(repoPyObj, "this")); -+ if (!repoSwigPyObj) { -+ PyErr_SetString(PyExc_SystemError, "Unable to parse repoSwigPyObject"); -+ return NULL; -+ } -+ -+ crepo = repoSwigPyObj->ptr; -+ if (!crepo) { -+ PyErr_SetString(PyExc_SystemError, "Unable to parse repo swig object"); -+ return NULL; -+ } - } - } - -@@ -678,16 +686,22 @@ load_repo(_SackObject *self, PyObject *args, PyObject *kwds) - &load_presto, &load_updateinfo, &load_other)) - return 0; - -- auto repoSwigPyObj = reinterpret_cast(PyObject_GetAttrString(repoPyObj, "this")); -- if (!repoSwigPyObj) { -- PyErr_SetString(PyExc_SystemError, "Unable to parse repoSwigPyObject"); -- return NULL; -- } -+ // Is it old deprecated _hawkey.Repo object? -+ libdnf::Repo * crepo = repoFromPyObject(repoPyObj); - -- libdnf::Repo * crepo = repoSwigPyObj->ptr; -+ // Or is it swig object? - if (!crepo) { -- PyErr_SetString(PyExc_SystemError, "Unable to parse repo swig object"); -- return NULL; -+ auto repoSwigPyObj = reinterpret_cast(PyObject_GetAttrString(repoPyObj, "this")); -+ if (!repoSwigPyObj) { -+ PyErr_SetString(PyExc_SystemError, "Unable to parse repoSwigPyObject"); -+ return NULL; -+ } -+ -+ crepo = repoSwigPyObj->ptr; -+ if (!crepo) { -+ PyErr_SetString(PyExc_SystemError, "Unable to parse repo swig object"); -+ return NULL; -+ } - } - - int flags = 0; --- -libgit2 0.27.7 - diff --git a/0002-Revert-consequences-of-Fail-Safe-mechanism.patch b/0002-Revert-consequences-of-Fail-Safe-mechanism.patch new file mode 100644 index 0000000..701bbae --- /dev/null +++ b/0002-Revert-consequences-of-Fail-Safe-mechanism.patch @@ -0,0 +1,31 @@ +From 0a6de048e9bbb6ec980af16feb3b875aa139128f Mon Sep 17 00:00:00 2001 +From: Jaroslav Mracek +Date: Wed, 3 Jul 2019 12:56:31 +0200 +Subject: [PATCH] Revert consequences of Fail-Safe mechanism + +--- + libdnf/dnf-rpmts.cpp | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/libdnf/dnf-rpmts.cpp b/libdnf/dnf-rpmts.cpp +index 61bb1a2..b996393 100644 +--- a/libdnf/dnf-rpmts.cpp ++++ b/libdnf/dnf-rpmts.cpp +@@ -69,11 +69,9 @@ test_fail_safe(Header * hdr, DnfPackage * pkg, GError **error) + DnfSack * sack = dnf_package_get_sack(pkg); + auto includes = dnf_sack_get_module_includes(sack); + if (!includes || !includes->has(dnf_package_get_id(pkg))) { +- g_set_error(error, DNF_ERROR, DNF_ERROR_INTERNAL_ERROR, +- _("No available modular metadata for modular package '%s'; " +- "cannot be installed on the system"), +- dnf_package_get_nevra(pkg)); +- ret = FALSE; ++ g_critical(_("No available modular metadata for modular package '%s'; " ++ "cannot be installed on the system"), ++ dnf_package_get_nevra(pkg)); + } + } + } +-- +libgit2 0.27.8 + diff --git a/0003-hawkeyRepo-add-deprecation-message.patch b/0003-hawkeyRepo-add-deprecation-message.patch deleted file mode 100644 index af6baf7..0000000 --- a/0003-hawkeyRepo-add-deprecation-message.patch +++ /dev/null @@ -1,76 +0,0 @@ -From f054f908e13e1d2c84e8d1b6443629e20500c2c4 Mon Sep 17 00:00:00 2001 -From: Jaroslav Rohel -Date: Thu, 2 May 2019 14:43:22 +0200 -Subject: [PATCH] hawkey.Repo: add deprecation message - ---- - python/hawkey/__init__.py | 11 ++++++++++- - python/hawkey/repo-py.cpp | 5 ++--- - python/hawkey/repo-py.hpp | 2 -- - 3 files changed, 12 insertions(+), 6 deletions(-) - -diff --git a/python/hawkey/__init__.py b/python/hawkey/__init__.py -index f5f0816..597fbbb 100644 ---- a/python/hawkey/__init__.py -+++ b/python/hawkey/__init__.py -@@ -131,7 +131,6 @@ REFERENCE_VENDOR = _hawkey.REFERENCE_VENDOR - - Package = _hawkey.Package - Reldep = _hawkey.Reldep --Repo = _hawkey.Repo - Sack = _hawkey.Sack - - Exception = _hawkey.Exception -@@ -334,3 +333,13 @@ class Subject(_hawkey.Subject): - def _list_or_query_to_selector(sack, list_or_query): - sltr = Selector(sack) - return sltr.set(pkg=list_or_query) -+ -+ -+class Repo(_hawkey.Repo): -+ -+ def __init__(self, name): -+ warnings.simplefilter('always', DeprecationWarning) -+ msg = "The class hawkey.Repo is deprecated. " \ -+ "Please use dnf.repo.Repo instead. The class will be removed on 2019-12-31." -+ warnings.warn(msg, DeprecationWarning) -+ super(Repo, self).__init__(name) -diff --git a/python/hawkey/repo-py.cpp b/python/hawkey/repo-py.cpp -index eff32be..4e4c045 100644 ---- a/python/hawkey/repo-py.cpp -+++ b/python/hawkey/repo-py.cpp -@@ -42,8 +42,7 @@ typedef struct { - - HyRepo repoFromPyObject(PyObject *o) - { -- if (!repoObject_Check(o)) { -- //PyErr_SetString(PyExc_TypeError, "Expected a Repo object."); -+ if (!PyObject_TypeCheck(o, &repo_Type)) { - return NULL; - } - return ((_RepoObject *)o)->repo; -@@ -189,7 +188,7 @@ PyTypeObject repo_Type = { - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ -- Py_TPFLAGS_DEFAULT, /*tp_flags*/ -+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - "Repo object", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ -diff --git a/python/hawkey/repo-py.hpp b/python/hawkey/repo-py.hpp -index cb3f014..f7a449a 100644 ---- a/python/hawkey/repo-py.hpp -+++ b/python/hawkey/repo-py.hpp -@@ -25,8 +25,6 @@ - - extern PyTypeObject repo_Type; - --#define repoObject_Check(v) ((v)->ob_type == &repo_Type) -- - HyRepo repoFromPyObject(PyObject *o); - PyObject *repoToPyObject(HyRepo repo); - --- -libgit2 0.27.7 - diff --git a/0004-Unit-tests-for-reintroduced-hawkeyRepo.patch b/0004-Unit-tests-for-reintroduced-hawkeyRepo.patch deleted file mode 100644 index 0d673ac..0000000 --- a/0004-Unit-tests-for-reintroduced-hawkeyRepo.patch +++ /dev/null @@ -1,186 +0,0 @@ -From 0999f890e57e45b0124fe1ddf1c368e63bd5c5c4 Mon Sep 17 00:00:00 2001 -From: Jaroslav Rohel -Date: Thu, 2 May 2019 14:08:06 +0200 -Subject: [PATCH] Unit tests for reintroduced hawkey.Repo - ---- - python/hawkey/tests/module/__init__.py | 2 ++ - python/hawkey/tests/module/hawkey_testmodule.cpp | 16 ++++++++++++++++ - python/hawkey/tests/tests/base.py | 8 +++++++- - python/hawkey/tests/tests/test_repo.py | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ - python/hawkey/tests/tests/test_sack.py | 17 ++++++++++++++++- - 5 files changed, 90 insertions(+), 2 deletions(-) - create mode 100644 python/hawkey/tests/tests/test_repo.py - -diff --git a/python/hawkey/tests/module/__init__.py b/python/hawkey/tests/module/__init__.py -index b41c3cc..b2ccd3d 100644 ---- a/python/hawkey/tests/module/__init__.py -+++ b/python/hawkey/tests/module/__init__.py -@@ -32,6 +32,8 @@ FIXED_ARCH = _hawkey_test.FIXED_ARCH - UNITTEST_DIR = _hawkey_test.UNITTEST_DIR - YUM_DIR_SUFFIX = _hawkey_test.YUM_DIR_SUFFIX - -+glob_for_repofiles = _hawkey_test.glob_for_repofiles -+ - class TestSackMixin(object): - def __init__(self, repo_dir): - self.repo_dir = repo_dir -diff --git a/python/hawkey/tests/module/hawkey_testmodule.cpp b/python/hawkey/tests/module/hawkey_testmodule.cpp -index b705701..9b21ad2 100644 ---- a/python/hawkey/tests/module/hawkey_testmodule.cpp -+++ b/python/hawkey/tests/module/hawkey_testmodule.cpp -@@ -23,6 +23,7 @@ - // hawkey - #include "dnf-sack-private.hpp" - -+#include "python/hawkey/repo-py.hpp" - #include "python/hawkey/sack-py.hpp" - #include "tests/hawkey/testshared.h" - -@@ -53,9 +54,24 @@ py_load_repo(PyObject *unused, PyObject *args) - Py_RETURN_NONE; - } - -+static PyObject * -+py_glob_for_repofiles(PyObject *unused, PyObject *args) -+{ -+ const char *repo_name, *path; -+ DnfSack *sack; -+ -+ if (!PyArg_ParseTuple(args, "O&ss", -+ sack_converter, &sack, &repo_name, &path)) -+ return NULL; -+ HyRepo repo = glob_for_repofiles(dnf_sack_get_pool(sack), repo_name, path); -+ return repoToPyObject(repo); -+} -+ - static struct PyMethodDef testmodule_methods[] = { - {"load_repo", (PyCFunction)py_load_repo, - METH_VARARGS, NULL}, -+ {"glob_for_repofiles", (PyCFunction)py_glob_for_repofiles, -+ METH_VARARGS, NULL}, - {NULL} /* sentinel */ - }; - -diff --git a/python/hawkey/tests/tests/base.py b/python/hawkey/tests/tests/base.py -index 8f1c1af..4d5937b 100644 ---- a/python/hawkey/tests/tests/base.py -+++ b/python/hawkey/tests/tests/base.py -@@ -1,5 +1,5 @@ - # --# Copyright (C) 2012-2013 Red Hat, Inc. -+# Copyright (C) 2012-2019 Red Hat, Inc. - # - # Licensed under the GNU Lesser General Public License Version 2.1 - # -@@ -72,6 +72,12 @@ class TestSack(hawkey.test.TestSackMixin, hawkey.Sack): - repo.load() - super(TestSack, self).load_repo(repo, **kwargs) - -+ # Loading using hawkey.Repo -+ def load_repo_hawkey_Repo(self, **kwargs): -+ d = os.path.join(self.repo_dir, hawkey.test.YUM_DIR_SUFFIX) -+ repo = hawkey.test.glob_for_repofiles(self, "messerk", d) -+ super(TestSack, self).load_repo(repo, **kwargs) -+ - def by_name(sack, name): - return hawkey.Query(sack).filter(name=name)[0] - -diff --git a/python/hawkey/tests/tests/test_repo.py b/python/hawkey/tests/tests/test_repo.py -new file mode 100644 -index 0000000..8ae0544 ---- /dev/null -+++ b/python/hawkey/tests/tests/test_repo.py -@@ -0,0 +1,49 @@ -+# -+# Copyright (C) 2012-2019 Red Hat, Inc. -+# -+# Licensed under the GNU Lesser General Public License Version 2.1 -+# -+# This library is free software; you can redistribute it and/or -+# modify it under the terms of the GNU Lesser General Public -+# License as published by the Free Software Foundation; either -+# version 2.1 of the License, or (at your option) any later version. -+# -+# This library is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+# Lesser General Public License for more details. -+# -+# You should have received a copy of the GNU Lesser General Public -+# License along with this library; if not, write to the Free Software -+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+# -+ -+import hawkey -+import unittest -+ -+ -+class Package(unittest.TestCase): -+ def test_create(self): -+ r = hawkey.Repo("fog") -+ self.assertIsNotNone(r) -+ self.assertRaises(TypeError, hawkey.Repo); -+ self.assertRaises(TypeError, hawkey.Repo, 3) -+ self.assertRaises(TypeError, hawkey.Repo, rain="pouring") -+ -+ def test_cost_assignment(self): -+ r = hawkey.Repo("fog") -+ r.cost = 300 -+ self.assertEqual(300, r.cost) -+ -+ r2 = hawkey.Repo("blizzard") -+ self.assertEqual(1000, r2.cost) -+ with self.assertRaises(TypeError): -+ r2.cost = '4' -+ -+ def test_str_assignment(self): -+ r = hawkey.Repo('fog') -+ with self.assertRaises(TypeError): -+ r.repomd_fn = 3 -+ r.repomd_fn = 'rain' -+ self.assertEqual(r.repomd_fn, 'rain') -+ -diff --git a/python/hawkey/tests/tests/test_sack.py b/python/hawkey/tests/tests/test_sack.py -index fe36b86..4645b37 100644 ---- a/python/hawkey/tests/tests/test_sack.py -+++ b/python/hawkey/tests/tests/test_sack.py -@@ -1,5 +1,5 @@ - # --# Copyright (C) 2012-2015 Red Hat, Inc. -+# Copyright (C) 2012-2019 Red Hat, Inc. - # - # Licensed under the GNU Lesser General Public License Version 2.1 - # -@@ -48,6 +48,14 @@ class TestSackTest(base.TestCase): - self.assertEqual(len(sack), hawkey.test.EXPECT_YUM_NSOLVABLES + - hawkey.test.EXPECT_SYSTEM_NSOLVABLES) - -+ # Loading test using hawkey.Repo -+ def test_load_yum_hawkey_Repo(self): -+ sack = base.TestSack(repo_dir=self.repo_dir) -+ sack.load_system_repo() -+ sack.load_repo_hawkey_Repo(build_cache=True) -+ self.assertEqual(len(sack), hawkey.test.EXPECT_YUM_NSOLVABLES + -+ hawkey.test.EXPECT_SYSTEM_NSOLVABLES) -+ - def test_cache_dir(self): - sack = base.TestSack(repo_dir=self.repo_dir) - self.assertTrue(sack.cache_dir.startswith("/tmp/pyhawkey")) -@@ -77,6 +85,13 @@ class BasicTest(unittest.TestCase): - self.assertRaises(IOError, sack.load_repo, repo) - sack = hawkey.Sack() - -+ # Loading test using hawkey.Repo -+ def test_failed_load_hawkey_Repo(self): -+ sack = hawkey.Sack(cachedir=base.cachedir) -+ repo = hawkey.Repo("name") -+ self.assertRaises(IOError, sack.load_repo, repo) -+ sack = hawkey.Sack() -+ - def test_unicoded_cachedir(self): - # does not raise UnicodeEncodeError - hawkey.Sack(cachedir=u"unicod\xe9") --- -libgit2 0.27.7 - diff --git a/libdnf.spec b/libdnf.spec index e2096b8..23d2fce 100644 --- a/libdnf.spec +++ b/libdnf.spec @@ -1,6 +1,6 @@ %global libsolv_version 0.7.4-1 %global libmodulemd_version 1.6.1 -%global librepo_version 1.9.5 +%global librepo_version 1.10.0 %global dnf_conflict 4.2.5 %global swig_version 3.0.12 @@ -13,6 +13,12 @@ %bcond_without python3 %endif +%if 0%{?rhel} + %global rpm_version 4.14.2 +%else + %global rpm_version 4.14.2.1-4 +%endif + %if 0%{?rhel} > 7 || 0%{?fedora} > 29 # Disable python2 build by default %bcond_with python2 @@ -31,16 +37,16 @@ %{nil} Name: libdnf -Version: 0.31.0 -Release: 5%{?dist} +Version: 0.35.1 +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 Patch0001: 0001-Revert-9309e92332241ff1113433057c969cebf127734e.patch -Patch0002: 0002-Reintroduce-hawkeyRepo-deprecated-for-compatibility.patch -Patch0003: 0003-hawkeyRepo-add-deprecation-message.patch -Patch0004: 0004-Unit-tests-for-reintroduced-hawkeyRepo.patch +# Temporary patch to not fail on modular RPMs without modular metadata +# until the infrastructure is ready +Patch0002: 0002-Revert-consequences-of-Fail-Safe-mechanism.patch BuildRequires: cmake BuildRequires: gcc @@ -53,7 +59,7 @@ BuildRequires: valgrind %endif BuildRequires: pkgconfig(gio-unix-2.0) >= 2.46.0 BuildRequires: pkgconfig(gtk-doc) -BuildRequires: rpm-devel >= 4.11.0 +BuildRequires: rpm-devel >= %{rpm_version} %if %{with rhsm} BuildRequires: pkgconfig(librhsm) >= 0.0.3 %endif @@ -251,13 +257,32 @@ popd %endif %changelog +* Thu Jul 04 2019 Pavla Kratochvilova - 0.35.1-1 +- Update to 0.35.1 +- Enhance logging handling +- Do not log DEBUG messages by default +- Also add subkeys when adding GPG keys +- [module] Fix swig binding for getModuleDependencies() +- Skip invalid key files in "/etc/pki/rpm-gpg" with warning (RhBug:1644040) +- Enable timestamp preserving for downloaded data (RhBug:1688537) +- Set default to skip_if_unavailable=false (RhBug:1679509) +- Add configuration option skip_if_unavailable (RhBug:1689931) +- Fix 'database is locked' error (RhBug:1631533) +- Replace the 'Failed to synchronize cache' message (RhBug:1712055) +- Fix 'no such table: main.trans_cmdline' error (RhBug:1596540) +- Add support of modular FailSafe (RhBug:1623128) (temporarily with warnings + instead of errors when installing modular RPMs without modular metadata) +- Add support of DNF main config file in context; used by PackageKit and + microdnf (RhBug:1689331) +- Exit gpg-agent after repokey import (RhBug:1650266) + * Mon Jun 10 22:13:19 CET 2019 Igor Gnatenko - 0.31.0-5 - Rebuild for RPM 4.15 * Mon Jun 10 15:42:02 CET 2019 Igor Gnatenko - 0.31.0-4 - Rebuild for RPM 4.15 -* Thu May 03 2019 Pavla Kratochvilova - 0.31.0-3 +* Fri May 03 2019 Pavla Kratochvilova - 0.31.0-3 - Backport patches to reintroduce hawkeyRepo * Thu Apr 25 2019 Pavla Kratochvilova - 0.31.0-1 diff --git a/sources b/sources index 42c0f7c..5d3e740 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libdnf-0.31.0.tar.gz) = 8aeb94cf612e8f26038774465b5ea66eec54169428773d0b846d706b4a3cc79eca6d329d002cfce8779795257ff39a59f5de8bdfc142a5c57b02f442a9267aea +SHA512 (libdnf-0.35.1.tar.gz) = a83fc170624af8ae4df1eb82a1a5df3e9b1b51d27b8cc2e032d2826ef4f7684da0364f937141c577f038215de02fc4442c67d6365cc0ce0ad92b18694faab8d9