From 8a3ee4025085d6ff48cc2213bc1198dc580c523a Mon Sep 17 00:00:00 2001 From: Marek Blaha Date: Wed, 27 Jun 2018 12:12:32 +0200 Subject: [PATCH] Update to 0.11.0 --- .gitignore | 1 + 64.patch | 61 ---------------- 66.patch | 66 ----------------- ...erepo_c-0.10.0-ignorelock-doublefree.patch | 72 ------------------- createrepo_c.spec | 11 ++- sources | 2 +- 6 files changed, 7 insertions(+), 206 deletions(-) delete mode 100644 64.patch delete mode 100644 66.patch delete mode 100644 createrepo_c-0.10.0-ignorelock-doublefree.patch diff --git a/.gitignore b/.gitignore index 043a80e..164c639 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ /createrepo_c-7b68123.tar.xz /createrepo_c-7a74bb7.tar.xz /createrepo_c-0.10.0.tar.gz +/createrepo_c-0.11.0.tar.gz diff --git a/64.patch b/64.patch deleted file mode 100644 index 87672f6..0000000 --- a/64.patch +++ /dev/null @@ -1,61 +0,0 @@ -From f1a7d9b5e7ee493133daf608adaf80b10a87b915 Mon Sep 17 00:00:00 2001 -From: Patrick Uiterwijk -Date: Mon, 26 Sep 2016 12:45:25 +0000 -Subject: [PATCH 1/2] Make set_record act like a setter - -This will make sure that when set_record is called, all existing -records of the same type are removed. -It makes no sense to have multiple records of the same type, -and it actively breaks libhifs checksum validation. - -Signed-off-by: Patrick Uiterwijk ---- - src/repomd.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/src/repomd.c b/src/repomd.c -index fea2c7e..3e79ccf 100644 ---- a/src/repomd.c -+++ b/src/repomd.c -@@ -682,6 +682,14 @@ cr_repomd_set_record(cr_Repomd *repomd, - cr_RepomdRecord *record) - { - if (!repomd || !record) return; -+ -+ cr_RepomdRecord *delrec = NULL; -+ // Remove all existing record of the same type -+ while((delrec = cr_repomd_get_record(repomd, record->type)) != NULL) { -+ cr_repomd_detach_record(repomd, delrec); -+ cr_repomd_record_free(delrec); -+ } -+ - repomd->records = g_slist_append(repomd->records, record); - } - - -From 5e44d23842d68e31e92498edeb6aba2e72a63abd Mon Sep 17 00:00:00 2001 -From: Patrick Uiterwijk -Date: Mon, 26 Sep 2016 12:48:31 +0000 -Subject: [PATCH 2/2] Add test to make sure that set_record overrides the - current record - -Signed-off-by: Patrick Uiterwijk ---- - tests/python/tests/test_repomd.py | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/tests/python/tests/test_repomd.py b/tests/python/tests/test_repomd.py -index 283dedc..6b6b3ad 100644 ---- a/tests/python/tests/test_repomd.py -+++ b/tests/python/tests/test_repomd.py -@@ -99,6 +99,10 @@ def test_repomd(self): - - self.assertEqual(len(md.records), 1) - -+ md.set_record(rec) -+ -+ self.assertEqual(len(md.records), 1) -+ - md.repoid = None - md.contenthash = None - diff --git a/66.patch b/66.patch deleted file mode 100644 index f29611b..0000000 --- a/66.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 35ae4edd9a6abef11fbdbfef5e717ba6eee6f8ee Mon Sep 17 00:00:00 2001 -From: Patrick Uiterwijk -Date: Wed, 28 Sep 2016 12:09:07 +0000 -Subject: [PATCH] Close BZ2 compressed files on cr_close - -Per bzip2 documentation: "BZ2_bzReadClose does not call fclose on the underlying file -handle, so you should do that yourself if appropriate.". -This patch adds a INNERFILE element to CR_FILE to keep track of the FILE object so we -can properly close the file on cr_close. - -Signed-off-by: Patrick Uiterwijk ---- - src/compression_wrapper.c | 6 ++++++ - src/compression_wrapper.h | 1 + - 2 files changed, 7 insertions(+) - -diff --git a/src/compression_wrapper.c b/src/compression_wrapper.c -index aacaf90..adc2f39 100644 ---- a/src/compression_wrapper.c -+++ b/src/compression_wrapper.c -@@ -347,6 +347,7 @@ cr_sopen(const char *filename, - file = g_malloc0(sizeof(CR_FILE)); - file->mode = mode; - file->type = type; -+ file->INNERFILE = NULL; - - switch (type) { - -@@ -380,6 +381,7 @@ cr_sopen(const char *filename, - - case (CR_CW_BZ2_COMPRESSION): { // ------------------------------------ - FILE *f = fopen(filename, mode_str); -+ file->INNERFILE = f; - int bzerror; - - if (!f) { -@@ -405,6 +407,8 @@ cr_sopen(const char *filename, - if (bzerror != BZ_OK) { - const char *err_msg; - -+ fclose(f); -+ - switch (bzerror) { - case BZ_CONFIG_ERROR: - err_msg = "library has been mis-compiled"; -@@ -642,6 +646,8 @@ cr_close(CR_FILE *cr_file, GError **err) - BZ2_bzWriteClose(&rc, (BZFILE *) cr_file->FILE, - BZ2_SKIP_FFLUSH, NULL, NULL); - -+ fclose(cr_file->INNERFILE); -+ - if (rc == BZ_OK) { - ret = CRE_OK; - } else { -diff --git a/src/compression_wrapper.h b/src/compression_wrapper.h -index 910fd45..65022d9 100644 ---- a/src/compression_wrapper.h -+++ b/src/compression_wrapper.h -@@ -79,6 +79,7 @@ void cr_contentstat_free(cr_ContentStat *cstat, GError **err); - typedef struct { - cr_CompressionType type; /*!< Type of compression */ - void *FILE; /*!< Pointer to gzFile, BZFILE, ... */ -+ void *INNERFILE; /*!< Pointer to underlying FILE */ - cr_OpenMode mode; /*!< Mode */ - cr_ContentStat *stat; /*!< Content stats */ - cr_ChecksumCtx *checksum_ctx; /*!< Checksum contenxt */ diff --git a/createrepo_c-0.10.0-ignorelock-doublefree.patch b/createrepo_c-0.10.0-ignorelock-doublefree.patch deleted file mode 100644 index ba24aa0..0000000 --- a/createrepo_c-0.10.0-ignorelock-doublefree.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 3519f493ce51bac53d178f7ff9e5b84ca98a158a Mon Sep 17 00:00:00 2001 -From: Tomas Mlcoch -Date: Fri, 19 Aug 2016 14:59:26 +0200 -Subject: [PATCH 1/2] cr_lock_repo: Fix segfault caused by freed - tmp_repodata_dir variable - ---- - src/createrepo_shared.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/src/createrepo_shared.c b/src/createrepo_shared.c -index 5872029..d4df86c 100644 ---- a/src/createrepo_shared.c -+++ b/src/createrepo_shared.c -@@ -258,12 +258,11 @@ cr_lock_repo(const gchar *repo_dir, - g_debug("(--ignore-lock enabled) For data generation is used: %s", - tmp_repodata_dir); - } -- } - -- if (tmp_repodata_dir) - *tmp_repodata_dir_p = g_strdup(tmp_repodata_dir); -- else -+ } else { - *tmp_repodata_dir_p = g_strdup(lock_dir); -+ } - - return TRUE; - } --- -2.9.3 - - -From 07f5cce3eff5c62f0c16143c7eaab64eb0e3ebf8 Mon Sep 17 00:00:00 2001 -From: Tomas Mlcoch -Date: Thu, 8 Sep 2016 09:45:38 +0200 -Subject: [PATCH 2/2] cr_lock_repo: Fix double free (RhBz: 1355720) - ---- - src/createrepo_shared.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/createrepo_shared.c b/src/createrepo_shared.c -index d4df86c..8a26787 100644 ---- a/src/createrepo_shared.c -+++ b/src/createrepo_shared.c -@@ -188,7 +188,6 @@ cr_lock_repo(const gchar *repo_dir, - assert(!err || *err == NULL); - - _cleanup_free_ gchar *lock_dir = NULL; -- _cleanup_free_ gchar *tmp_repodata_dir = NULL; - _cleanup_error_free_ GError *tmp_err = NULL; - - lock_dir = g_build_filename(repo_dir, ".repodata/", NULL); -@@ -242,10 +241,11 @@ cr_lock_repo(const gchar *repo_dir, - } - - // To data generation use a different one -+ _cleanup_free_ gchar *tmp_repodata_dir = NULL; - _cleanup_free_ gchar *tmp = NULL; -- tmp_repodata_dir = g_build_filename(repo_dir, ".repodata.", NULL); -- tmp = cr_append_pid_and_datetime(tmp_repodata_dir, "/"); -- tmp_repodata_dir = tmp; -+ -+ tmp = g_build_filename(repo_dir, ".repodata.", NULL); -+ tmp_repodata_dir = cr_append_pid_and_datetime(tmp, "/"); - - if (g_mkdir(tmp_repodata_dir, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)) { - g_critical("(--ignore-lock enabled) Cannot create %s: %s", --- -2.9.3 - diff --git a/createrepo_c.spec b/createrepo_c.spec index 3cf711d..c664178 100644 --- a/createrepo_c.spec +++ b/createrepo_c.spec @@ -25,16 +25,12 @@ Summary: Creates a common metadata repository Name: createrepo_c -Version: 0.10.0 -Release: 21%{?dist} +Version: 0.11.0 +Release: 1%{?dist} License: GPLv2+ URL: https://github.com/rpm-software-management/createrepo_c Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz -Patch0: createrepo_c-0.10.0-ignorelock-doublefree.patch -Patch1: https://patch-diff.githubusercontent.com/raw/rpm-software-management/createrepo_c/pull/64.patch -Patch2: https://patch-diff.githubusercontent.com/raw/rpm-software-management/createrepo_c/pull/66.patch - BuildRequires: cmake BuildRequires: gcc BuildRequires: bzip2-devel @@ -227,6 +223,9 @@ ln -sr %{buildroot}%{_bindir}/modifyrepo_c %{buildroot}%{_bindir}/modifyrepo %endif %changelog +* Wed Jun 27 2018 Marek Blaha - 0.11.0-1 +- Update to 0.11.0 + * Mon Jun 18 2018 Miro HronĨok - 0.10.0-21 - Rebuilt for Python 3.7 diff --git a/sources b/sources index d38acc0..eb86d1e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2e14b3e5d289875b894000ab1e54f1ec createrepo_c-0.10.0.tar.gz +SHA512 (createrepo_c-0.11.0.tar.gz) = b03b218695a0b3e204f601698be6f61f476a790f5602da52e73de89ab0d7754814b8627fd298b66474474bd47e14bbaf3f2cab4c6546dd9966ea6e1f9afd191c