summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-09-26 15:00:19 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-28 12:37:44 +0100
commit1036bec2e99edd4c59ae1b6eedfbdc933104a9e4 (patch)
tree5f801cd1b6f337bedfb073ca89e73dcb9e61547d
parent12eed1e6c701759321541d2c04eeca3db3c99247 (diff)
downloadopenembedded-core-contrib-1036bec2e99edd4c59ae1b6eedfbdc933104a9e4.tar.gz
createrepo-c: Fix function declaration bug found with clang
clang is stricter about function parameter types in its functions and errors out. error: incompatible integer to pointer conversion initializing 'gchar *' (aka 'char *') Real problem is in createrepo_c code where funciton definition and declaration scopes are different Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r--meta/recipes-devtools/createrepo-c/createrepo-c/0001-Move-cr_compress_groupfile-outside-WITH_LIBMODULEMD.patch46
-rw-r--r--meta/recipes-devtools/createrepo-c/createrepo-c_1.0.0.bb1
2 files changed, 47 insertions, 0 deletions
diff --git a/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Move-cr_compress_groupfile-outside-WITH_LIBMODULEMD.patch b/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Move-cr_compress_groupfile-outside-WITH_LIBMODULEMD.patch
new file mode 100644
index 0000000000..ea768e06e6
--- /dev/null
+++ b/meta/recipes-devtools/createrepo-c/createrepo-c/0001-Move-cr_compress_groupfile-outside-WITH_LIBMODULEMD.patch
@@ -0,0 +1,46 @@
+From 5326969acc0c7e9e3cabca202154e4120c0d2c2f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 26 Sep 2023 14:52:11 -0700
+Subject: [PATCH] Move cr_compress_groupfile outside WITH_LIBMODULEMD
+
+This function is used in code which is not conditional under WITH_LIBMODULEMD
+therefore the declaration should also match its definition scope
+
+Fixes build issues flagged by clang
+
+src/createrepo_c.c:850:16: error: incompatible integer to pointer conversion initializing 'gchar *' (aka 'char *') with an
+ expression of type 'int' [-Wint-conversion]
+| 850 | gchar *compressed_path = cr_compress_groupfile(cmd_options->groupfile_fullpath, tmp_out_repo, compression);
+| | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Upstream-Status: Submitted [https://github.com/rpm-software-management/createrepo_c/pull/387]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/metadata_internal.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/metadata_internal.h b/src/metadata_internal.h
+index 8ba0576..ecfbac2 100644
+--- a/src/metadata_internal.h
++++ b/src/metadata_internal.h
+@@ -52,14 +52,14 @@ cr_metadata_load_modulemd(ModulemdModuleIndex **moduleindex,
+ * @param dest_dir Path to directory where the compressed groupfile should be stored.
+ * @return Path to the new compressed groupfile. Has to be freed by the caller.
+ */
++
++#endif /* WITH_LIBMODULEMD */
++
+ gchar *
+ cr_compress_groupfile(const char *groupfile,
+ const char *dest_dir,
+ cr_CompressionType compression);
+
+-
+-#endif /* WITH_LIBMODULEMD */
+-
+ #ifdef __cplusplus
+ }
+ #endif
+--
+2.42.0
+
diff --git a/meta/recipes-devtools/createrepo-c/createrepo-c_1.0.0.bb b/meta/recipes-devtools/createrepo-c/createrepo-c_1.0.0.bb
index 9b109327c8..f4e65492f8 100644
--- a/meta/recipes-devtools/createrepo-c/createrepo-c_1.0.0.bb
+++ b/meta/recipes-devtools/createrepo-c/createrepo-c_1.0.0.bb
@@ -8,6 +8,7 @@ SRC_URI = "git://github.com/rpm-software-management/createrepo_c;branch=master;p
file://0001-Do-not-set-PYTHON_INSTALL_DIR-by-running-python.patch \
file://0001-include-rpm-rpmstring.h.patch \
file://time64fix.patch \
+ file://0001-Move-cr_compress_groupfile-outside-WITH_LIBMODULEMD.patch \
"
SRCREV = "0cc13920991b2fb8f87fb9d352bd3394c2983289"