diff --git a/.gitignore b/.gitignore index a960d9e..56a1ed7 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ /createrepo_c-0.12.1.tar.gz /createrepo_c-0.12.2.tar.gz /createrepo_c-0.13.2.tar.gz +/createrepo_c-0.14.1.tar.gz diff --git a/0001-Fix-crash-when-dumping-updateinfo-and-module-is-ommited-RhBug1707981.patch b/0001-Fix-crash-when-dumping-updateinfo-and-module-is-ommited-RhBug1707981.patch deleted file mode 100644 index bfca237..0000000 --- a/0001-Fix-crash-when-dumping-updateinfo-and-module-is-ommited-RhBug1707981.patch +++ /dev/null @@ -1,234 +0,0 @@ -From 60ca8fe3db7d2032a815f19a8299a86ee63c5267 Mon Sep 17 00:00:00 2001 -From: Aleš Matěj -Date: Thu, 9 May 2019 08:48:32 +0200 -Subject: [PATCH] Fix crash when dumping updateinfo and module is ommited (RhBug:1707981) - ---- - src/xml_dump_updateinfo.c | 23 +++++++++++++---------- - tests/python/tests/test_updateinfo.py | 179 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 192 insertions(+), 10 deletions(-) - -diff --git a/src/xml_dump_updateinfo.c b/src/xml_dump_updateinfo.c -index d5ae96f..fafe686 100644 ---- a/src/xml_dump_updateinfo.c -+++ b/src/xml_dump_updateinfo.c -@@ -68,16 +68,19 @@ cr_xml_dump_updatecollectionpackages(xmlNodePtr collection, GSList *packages) - void - cr_xml_dump_updatecollectionmodule(xmlNodePtr collection, cr_UpdateCollectionModule *module) - { -- xmlNodePtr xml_module; -- xml_module = xmlNewChild(collection, NULL, BAD_CAST "module", NULL); -- -- cr_xmlNewProp_c(xml_module, BAD_CAST "name", BAD_CAST module->name); -- cr_xmlNewProp_c(xml_module, BAD_CAST "stream", BAD_CAST module->stream); -- gchar buf[21]; //20 + '\0' is max number of chars of guint64: G_MAXUINT64 (= 18,446,744,073,709,551,615) -- snprintf(buf, 21, "%" G_GUINT64_FORMAT, module->version); -- cr_xmlNewProp_c(xml_module, BAD_CAST "version", BAD_CAST buf); -- cr_xmlNewProp_c(xml_module, BAD_CAST "context", BAD_CAST module->context); -- cr_xmlNewProp_c(xml_module, BAD_CAST "arch", BAD_CAST module->arch); -+ if (!module) -+ return; -+ -+ xmlNodePtr xml_module; -+ xml_module = xmlNewChild(collection, NULL, BAD_CAST "module", NULL); -+ -+ cr_xmlNewProp_c(xml_module, BAD_CAST "name", BAD_CAST module->name); -+ cr_xmlNewProp_c(xml_module, BAD_CAST "stream", BAD_CAST module->stream); -+ gchar buf[21]; //20 + '\0' is max number of chars of guint64: G_MAXUINT64 (= 18,446,744,073,709,551,615) -+ snprintf(buf, 21, "%" G_GUINT64_FORMAT, module->version); -+ cr_xmlNewProp_c(xml_module, BAD_CAST "version", BAD_CAST buf); -+ cr_xmlNewProp_c(xml_module, BAD_CAST "context", BAD_CAST module->context); -+ cr_xmlNewProp_c(xml_module, BAD_CAST "arch", BAD_CAST module->arch); - } - - void -diff --git a/tests/python/tests/test_updateinfo.py b/tests/python/tests/test_updateinfo.py -index e89f1a8..727b707 100644 ---- a/tests/python/tests/test_updateinfo.py -+++ b/tests/python/tests/test_updateinfo.py -@@ -210,3 +210,182 @@ class TestCaseUpdateInfo(unittest.TestCase): - - - """ % {"now": now.strftime("%Y-%m-%d %H:%M:%S")}) -+ -+ def test_updateinfo_xml_dump_04(self): -+ now = datetime.now() -+ # Microseconds are always 0 in updateinfo -+ now = datetime(now.year, now.month, now.day, now.hour, now.minute, -+ now.second, 0) -+ -+ pkg = cr.UpdateCollectionPackage() -+ pkg.name = "foo" -+ pkg.version = "1.2" -+ pkg.release = "3" -+ pkg.epoch = "0" -+ pkg.arch = "x86" -+ pkg.src = "foo.src.rpm" -+ pkg.filename = "foo.rpm" -+ pkg.sum = "abcdef" -+ pkg.sum_type = cr.SHA1 -+ pkg.reboot_suggested = True -+ -+ # Collection without module -+ col = cr.UpdateCollection() -+ col.shortname = "short name" -+ col.name = "long name" -+ col.append(pkg) -+ -+ ref = cr.UpdateReference() -+ ref.href = "href" -+ ref.id = "id" -+ ref.type = "type" -+ ref.title = "title" -+ -+ rec = cr.UpdateRecord() -+ rec.fromstr = "from" -+ rec.status = "status" -+ rec.type = "type" -+ rec.version = "version" -+ rec.id = "id" -+ rec.title = "title" -+ rec.issued_date = now -+ rec.updated_date = now -+ rec.rights = "rights" -+ rec.release = "release" -+ rec.pushcount = "pushcount" -+ rec.severity = "severity" -+ rec.summary = "summary" -+ rec.description = "description" -+ rec.solution = "solution" -+ rec.append_collection(col) -+ rec.append_reference(ref) -+ -+ ui = cr.UpdateInfo() -+ ui.append(rec) -+ -+ xml = ui.xml_dump() -+ -+ self.assertEqual(xml, -+""" -+ -+ -+ id -+ title -+ -+ -+ rights -+ release -+ pushcount -+ severity -+ summary -+ description -+ solution -+ -+ -+ -+ -+ -+ long name -+ -+ foo.rpm -+ abcdef -+ -+ -+ -+ -+ -+ -+""" % {"now": now.strftime("%Y-%m-%d %H:%M:%S")}) -+ -+ def test_updateinfo_xml_dump_05(self): -+ now = datetime.now() -+ # Microseconds are always 0 in updateinfo -+ now = datetime(now.year, now.month, now.day, now.hour, now.minute, -+ now.second, 0) -+ -+ # Collection module with unset fields -+ mod = cr.UpdateCollectionModule() -+ mod.version = 18446744073709551615 -+ mod.context = "deadbeef" -+ mod.arch = "x86" -+ -+ pkg = cr.UpdateCollectionPackage() -+ pkg.name = "foo" -+ pkg.version = "1.2" -+ pkg.release = "3" -+ pkg.epoch = "0" -+ pkg.arch = "x86" -+ pkg.src = "foo.src.rpm" -+ pkg.filename = "foo.rpm" -+ pkg.sum = "abcdef" -+ pkg.sum_type = cr.SHA1 -+ pkg.reboot_suggested = True -+ -+ col = cr.UpdateCollection() -+ col.shortname = "short name" -+ col.name = "long name" -+ col.module = mod -+ col.append(pkg) -+ -+ ref = cr.UpdateReference() -+ ref.href = "href" -+ ref.id = "id" -+ ref.type = "type" -+ ref.title = "title" -+ -+ rec = cr.UpdateRecord() -+ rec.fromstr = "from" -+ rec.status = "status" -+ rec.type = "type" -+ rec.version = "version" -+ rec.id = "id" -+ rec.title = "title" -+ rec.issued_date = now -+ rec.updated_date = now -+ rec.rights = "rights" -+ rec.release = "release" -+ rec.pushcount = "pushcount" -+ rec.severity = "severity" -+ rec.summary = "summary" -+ rec.description = "description" -+ rec.solution = "solution" -+ rec.append_collection(col) -+ rec.append_reference(ref) -+ -+ ui = cr.UpdateInfo() -+ ui.append(rec) -+ -+ xml = ui.xml_dump() -+ -+ self.assertEqual(xml, -+""" -+ -+ -+ id -+ title -+ -+ -+ rights -+ release -+ pushcount -+ severity -+ summary -+ description -+ solution -+ -+ -+ -+ -+ -+ long name -+ -+ -+ foo.rpm -+ abcdef -+ -+ -+ -+ -+ -+ -+""" % {"now": now.strftime("%Y-%m-%d %H:%M:%S")}) --- -libgit2 0.27.7 - diff --git a/createrepo_c.spec b/createrepo_c.spec index a175863..0d22001 100644 --- a/createrepo_c.spec +++ b/createrepo_c.spec @@ -33,13 +33,11 @@ Summary: Creates a common metadata repository Name: createrepo_c -Version: 0.13.2 -Release: 2%{?dist} +Version: 0.14.1 +Release: 1%{?dist} License: GPLv2+ URL: https://github.com/rpm-software-management/createrepo_c Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz -# https://bugzilla.redhat.com/show_bug.cgi?id=1707981 -Patch0: 0001-Fix-crash-when-dumping-updateinfo-and-module-is-ommited-RhBug1707981.patch BuildRequires: cmake BuildRequires: gcc @@ -258,6 +256,12 @@ ln -sr %{buildroot}%{_bindir}/modifyrepo_c %{buildroot}%{_bindir}/modifyrepo %endif %changelog +* Fri May 24 2019 Pavla Kratochvilova - 0.14.1-1 +- Update to 0.14.1 +- Add --pkgorigins mode for Koji +- Correct pkg count in headers if there were invalid pkgs (RhBug:1596211) +- Prevent exiting with 0 if errors occur while finalizing repodata. + * Mon May 20 2019 Pavla Kratochvilova - 0.13.2-2 - Backport patch to fix crash when dumping updateinfo and module is ommited (RhBug:1707981) diff --git a/sources b/sources index 877dcfd..c13ffcb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (createrepo_c-0.13.2.tar.gz) = 071372d8df02d5a103c00e9ec99a1e4482337afdf49fe17f7643293060fe8b794d2efd12992f3afef281ad796ed21b3c6dd3a610cdd4ea229a45a7b482764201 +SHA512 (createrepo_c-0.14.1.tar.gz) = 40a7b4c46b7eda4bde8a6082c06e3b5e2ace8c80d288c3d47e431a7f2402a8bf8f4d1ea666dc207f995ace37a134576f0d70fe93e9066374b1ead79abd7622b6