diff options
author | Peter Pentchev <roam@debian.org> | 2021-12-27 22:49:29 +0200 |
---|---|---|
committer | Peter Pentchev <roam@debian.org> | 2021-12-27 22:49:29 +0200 |
commit | 71b14ca55d62fcaeaa99073d8c7b4e9aa3f9164c (patch) | |
tree | 6e06437a32ad1e8379eb9a8b2a364007aedf7181 | |
parent | 581df435975144d33fe6ff311de5177e6ac6bdf7 (diff) | |
parent | 8196982f0974c268898a5550d61b374bd58103e2 (diff) |
Merge createrepo-c-0.17.3 into the Debian branch.
-rw-r--r-- | .github/workflows/ci-python.yml | 2 | ||||
-rw-r--r-- | VERSION.cmake | 2 | ||||
-rw-r--r-- | createrepo_c.spec | 6 | ||||
-rw-r--r-- | src/load_metadata.c | 8 | ||||
-rw-r--r-- | src/misc.c | 2 | ||||
-rw-r--r-- | src/python/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/xml_parser_filelists.c | 2 | ||||
-rw-r--r-- | src/xml_parser_internal.h | 4 | ||||
-rw-r--r-- | tests/python/tests/test_crfile.py | 4 | ||||
-rw-r--r-- | utils/setup_for_python_metadata.py | 2 |
10 files changed, 18 insertions, 16 deletions
diff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.yml index b3b39a1..0603861 100644 --- a/.github/workflows/ci-python.yml +++ b/.github/workflows/ci-python.yml @@ -12,7 +12,7 @@ jobs: - name: Install dependencies run: | - sudo dnf -y install dnf-plugins-core + sudo dnf -y install dnf-plugins-core python3-pip sudo dnf -y builddep createrepo_c.spec pip install --upgrade pip pip install pytest diff --git a/VERSION.cmake b/VERSION.cmake index 0c790cd..4a0b4fa 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -1,3 +1,3 @@ SET(CR_MAJOR "0") SET(CR_MINOR "17") -SET(CR_PATCH "2") +SET(CR_PATCH "3") diff --git a/createrepo_c.spec b/createrepo_c.spec index a0ed90c..d9864bf 100644 --- a/createrepo_c.spec +++ b/createrepo_c.spec @@ -10,13 +10,13 @@ %bcond_without drpm %endif -%if 0%{?rhel} || 0%{?fedora} < 29 +%if 0%{?rhel} %bcond_with zchunk %else %bcond_without zchunk %endif -%if 0%{?rhel} || 0%{?fedora} < 29 +%if 0%{?rhel} && 0%{?rhel} < 8 %bcond_with libmodulemd %else %bcond_without libmodulemd @@ -24,7 +24,7 @@ Summary: Creates a common metadata repository Name: createrepo_c -Version: 0.17.2 +Version: 0.17.3 Release: 1%{?dist} License: GPLv2+ URL: https://github.com/rpm-software-management/createrepo_c diff --git a/src/load_metadata.c b/src/load_metadata.c index b734e72..dcde8f6 100644 --- a/src/load_metadata.c +++ b/src/load_metadata.c @@ -173,7 +173,7 @@ typedef struct { GStringChunk *chunk; GHashTable *pkglist_ht; GHashTable *ignored_pkgIds; /*!< If there are multiple packages - wich have the same checksum (pkgId) but they are in fact different + which have the same checksum (pkgId) but they are in fact different (they have different basenames, mtimes or sizes), then we want to ignore these packages during loading. It's because the pkgId is used to pair metadata from @@ -495,7 +495,7 @@ cr_metadata_load_modulemd(cr_Metadata *md, &tmp_err); if (!result) { if (!tmp_err){ - g_set_error(err, CRE_MODULEMD, CREATEREPO_C_ERROR, + g_set_error(err, CRE_MODULEMD, CREATEREPO_C_ERROR, "Unknown error in libmodulemd with %s", modulemd_metadatum->name); }else{ @@ -586,7 +586,7 @@ cr_metadata_load_xml(cr_Metadata *md, break; default: // Well, this SHOULD never happend! - // (md->key SHOULD be setted only by cr_metadata_new() + // (md->key SHOULD be set only by cr_metadata_new() // and it SHOULD set only valid key values) g_critical("%s: Unknown hash table key selected", __func__); assert(0); @@ -610,7 +610,7 @@ cr_metadata_load_xml(cr_Metadata *md, ) { // We got a key (checksum, filename, pkg name, ..) - // which has a multiple occurences which are different. + // which has a multiple occurrences which are different. // Ignore such key g_debug("%s: Key \"%s\" is present multiple times and with " "different values. Ignoring all occurrences. " @@ -503,6 +503,8 @@ cr_compress_file_with_stat(const char *src, if (!orig) { ret = tmp_err->code; g_propagate_prefixed_error(err, tmp_err, "Cannot open %s: ", src); + if (dst != in_dst) + g_free(dst); return ret; } diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt index ecc262d..a31b14d 100644 --- a/src/python/CMakeLists.txt +++ b/src/python/CMakeLists.txt @@ -14,7 +14,7 @@ if (NOT SKBUILD) FIND_PACKAGE(PythonLibs 3 REQUIRED) endif (NOT SKBUILD) -EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from distutils import sysconfig; stdout.write(sysconfig.get_python_lib(True))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR) +EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "from sys import stdout; from sysconfig import get_path; stdout.write(get_path('platlib'))" OUTPUT_VARIABLE PYTHON_INSTALL_DIR) INCLUDE_DIRECTORIES (${PYTHON_INCLUDE_PATH}) MESSAGE(STATUS "Python install dir is ${PYTHON_INSTALL_DIR}") diff --git a/src/xml_parser_filelists.c b/src/xml_parser_filelists.c index 880c225..f4fe6c0 100644 --- a/src/xml_parser_filelists.c +++ b/src/xml_parser_filelists.c @@ -116,7 +116,7 @@ cr_start_handler(void *pdata, const xmlChar *element, const xmlChar **attr) if (!pkgId) { // Package without a pkgid attr is error g_set_error(&pd->err, ERR_DOMAIN, ERR_CODE_XML, - "Package pkgid attributte is missing!"); + "Package pkgid attribute is missing!"); break; } diff --git a/src/xml_parser_internal.h b/src/xml_parser_internal.h index b684594..c80e5b5 100644 --- a/src/xml_parser_internal.h +++ b/src/xml_parser_internal.h @@ -117,9 +117,9 @@ typedef struct _cr_ParserData { int do_files; /*!< If == 0 then parser will ignore files elements in the primary.xml. - This is useful when you are inteding parse primary.xml as well as + This is useful when you are intending to parse primary.xml as well as filelists.xml. In this case files will be filled from filelists.xml. - If you are inteding parse only the primary.xml then it coud be useful + If you are intending to parse only the primary.xml then it could be useful to parse files in primary. If you parse files from both a primary.xml and a filelists.xml then some files in package object will be duplicated! */ diff --git a/tests/python/tests/test_crfile.py b/tests/python/tests/test_crfile.py index ee92516..bf13f89 100644 --- a/tests/python/tests/test_crfile.py +++ b/tests/python/tests/test_crfile.py @@ -102,7 +102,7 @@ class TestCaseCrFile(unittest.TestCase): f.close() import subprocess - with subprocess.Popen(["unxz", "--stdout", path], stdout=subprocess.PIPE) as p: + with subprocess.Popen(["unxz", "--stdout", path], stdout=subprocess.PIPE, close_fds=False) as p: content = p.stdout.read().decode('utf-8') self.assertEqual(content, "foobar") @@ -118,6 +118,6 @@ class TestCaseCrFile(unittest.TestCase): f.close() import subprocess - with subprocess.Popen(["unzck", "--stdout", path], stdout=subprocess.PIPE) as p: + with subprocess.Popen(["unzck", "--stdout", path], stdout=subprocess.PIPE, close_fds=False) as p: content = p.stdout.read().decode('utf-8') self.assertEqual(content, "foobar") diff --git a/utils/setup_for_python_metadata.py b/utils/setup_for_python_metadata.py index c4bdce0..b1f3bd7 100644 --- a/utils/setup_for_python_metadata.py +++ b/utils/setup_for_python_metadata.py @@ -1,4 +1,4 @@ -from distutils.core import setup +from setuptools import setup import sys # This is a simple and fragile way of passing the current version |